DESCRIPTION Students: Please note instructions in paper copy of quiz. Save your files often, make sure OMSI fills your entire screen at all times, etc. A question may not fully fit into your OMSI question box, which is not scrollable. You can try adjusting the relative size of the question and answer boxes, but remember that clicking CopyQtoA will copy the entire question box to the answer box. QUESTION -ext .R -run 'Rscript omsi_answer1.txt' (25 pts, text) In grading Homework I, the TA will first load rectools, then load your predict.usrData() function, replacing the one that was included in rectools. She could avoid such replacement, i.e. keep the old version and still have a new version, by giving a different name to your function, say predict.usrData1(). But this would cause problems in prediction. Explain. QUESTION -ext .R -run 'Rscript omsi_answer2.R' (25 pts, code) Here you write code that will first load the InstEval dataset and then print the number of users who rated instructor number 36. Fill in the blanks: library(rectools) print( ) # should print 21 QUESTION -ext .R -run 'Rscript omsi_answer3.R' (25 pts, text) Consider the InstEval data. Suppose we were to call prcomp() on ivl[,-(1:2)], and decide to use 3 principal components, i.e. use the eigenvectors corresponding to the 3 largest eigenvalues. State how many rows and columns the matrix R would have in Equation (2.26). Note: You may find you need to use the fact that there are 73421 rows in ivl. QUESTION -ext .R -run 'Rscript omsi_answer4.R' (25 pts, code) In this problem you will write a function with call form meanActivity(db) where db is the database returned by formUserData(). The return value is the average number of ratings, across all users. Fill in the blanks (or, for partial credit, write your own code with the same call form and return value). meanActivity <- function(db) { tmp <- sapply( , function(dbElement) ) } library(rectools) d <- data.frame(uID=c(1,2,1),iID=c(5,1,8),rat=c(3,3,5)) db <- formUserData(d) print(meanActivity(db)) # should print 1.5