Coursera 機器學習第9周作業2

1. Suppose you run a bookstore, andhave ratings (1 to 5 stars) of books. Your collaborative filtering algorithmhas learned a parameter vector θ(j) for user j,and a feature vector x(i) for each book. You would liketo compute the "training error", meaning the average squared error ofyour system's predictions on all the ratings that you have gotten from yourusers. Which of these are correct ways of doing so (check all that apply)? Forthis problem, let m be the total number of ratings you

have gotten from your users. (Another wayof saying this is that m=∑nmi=1∑nuj=1r(i,j)).[Hint: Two of the four options below are correct.]  選1和3

1mnuj=1∑i:r(i,j)=1(∑nk=1(θ(k))jx(k)iy(i,j))2

1m∑(i,j):r(i,j)=1((θ(j))Tx(i)−r(i,j))2

1m∑(i,j):r(i,j)=1((θ(j))Tx(i)−y(i,j))2

1mnmi=1∑j:r(i,j)=1(∑nk=1(θ(j))kx(i)ky(i,j))2

2. In which of the followingsituations will a collaborative filtering system be the most appropriatelearning algorithm (compared to linear or logistic regression)? 選1和3

You'vewritten a piece of software that has downloaded news articles from many newswebsites. In your system, you also keep track of which articles you personallylike vs. dislike, and the system also stores away features of these articles(e.g., word counts, name of author). Using this information, you want to builda system to try to find additional new articles that you personally will like.

Youmanage an online bookstore and you have the book ratings from many users. Youwant to learn to predict the expected sales volume (number of books sold) as afunction of the average rating of a book.

Yourun an online news aggregator, and for every user, you know some subset ofarticles that the user likes and some different subset that the user dislikes.You'd want to use this to find other articles that the user likes.

Youmanage an online bookstore and you have the book ratings from many users. Foreach user, you want to recommend other books she will enjoy, based on her ownratings and the ratings of other users.

3. You run a movie empire, and want tobuild a movie recommendation system based on collaborative filtering. Therewere three popular review websites (which we'll call A, B and C) which users togo to rate movies, and you have just acquired all three companies that runthese websites. You'd like to merge the three companies' datasets together tobuild a single/unified system. On website A, users rank a movie as having 1through 5 stars. On website B, users rank on a scale of 1 - 10, and decimalvalues (e.g., 7.5) are allowed. On website C, the ratings are from 1 to 100.You also have enough information to identify users/movies on one website withusers/movies on a different website. Which of the following statements is true?  選4

Itis not possible to combine these websites' data. You must build three separaterecommendation systems.

Assumingthat there is at least one movie/user in one database that doesn't also appearin a second database, there is no sound way to merge the datasets, because ofthe missing data.

Youcan combine all three training sets into one without any modification andexpect high performance from a recommendation system.

Youcan merge the three datasets into one, but you should first normalize eachdataset's ratings (say rescale each dataset's ratings to a 1-100 range).

5. Suppose you have two matrices A and B,where A is 5x3 and B is 3x5. Their productis C=AB, a 5x5 matrix. Furthermore, you have a 5x5matrix R where every entry is 0 or 1. You want to find the sumof all elements C(i,j) for which thecorresponding R(i,j) is 1, and ignore allelements C(i,j) where R(i,j)=0.One way to do so is the following code:

 

Which of the following pieces of Octavecode will also correctly compute this total? Check all that apply. Assume alloptions are in code. 選1和3

total= sum(sum((A * B) .* R))

C= A * B; total = sum(sum(C(R == 1)));

C= (A * B) * .R; total = sum(C(:));

total= sum(sum(A * B*R));

發佈了33 篇原創文章 · 獲贊 19 · 訪問量 10萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章