Description Usage Arguments Value Author(s) Examples
Rating prediction via nearest neighbors, via cosDist
(inner product);
the latter, though standard, has certain problems (e.g., its
scale-free nature), and other choices for distance measure will be added.
covariates (e.g. age, gender) and item type preferences (e.g.
preferred movie genres) are allowed
1 | predict.usrData(origData, newData, newItem, k, wtcovs = NULL, wtcats = NULL)
|
origData: |
training set, object of class 'usrData', output of
|
newData: |
data point (just one for now) to be predicted, object
of class |
newItem: |
ID of the item rating to be predicted for the user
specified in |
k: |
number of nearest neighbors. |
wtcovs: |
weight to put on covariates; NULL if no covs. |
wtcats: |
weight to put on item categories; NULL if no cats. |
Predicted rating for newData
.
Vishal Chakraborty and Norm Matloff
1 2 3 4 5 6 7 | ivl <- InstEval
ivl$s <- as.numeric(ivl$s)
ivl$d <- as.numeric(ivl$d)
ivl <- ivl[,c(1,2,7)]
usrdata <- formUserData(ivl[,1:3])
# predict the rating user 3 would give item 8
predict(usrdata,usrdata[[3]],8,10) # 2.6
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.