trainReco: Parallelized Recosystem

Description Usage Arguments Details Author(s) Examples

Description

Convenience wrappers for specific aspects of the recosystem package, adding a parallel computation capability.

Usage

1
2
	trainReco(ratingsIn,rnk = 10)
	predict.Reco(recoObj,predSet)

Arguments

ratingsIn

Input data frame, training set. Within-row format is (UserID, ItemID, rating).

recoObj

Object of type 'Reco', output of trainReco.

predSet

Data to be predicted, having within-row format (UserID, ItemID).

rnk

Desired rank for the matrix factors.

Details

The function trainReco simply calls r$train on the input data.

The latter function returns several key components, including:

The product of these two matricies consists of the predicted ratings of all users on all items.

The function predict.Reco is a method for the generic function predict.

Author(s)

Pooja Rajkumar and Norm Matloff

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
   ivl <- InstEval 
   ivl$s <- as.numeric(ivl$s) 
   ivl$d <- as.numeric(ivl$d) 
   ivl3 <- ivl[,c(1,2,7)]
   set.seed(9999)
   trn <- trainReco(ivl3)
   onerec <- ivl3[1,]  # form dummy 1-rec data frame
   # how would student 788 would like lecturer 28?
   onerec$s <- 788  
   onerec$d <- 28  
   onerec <- onerec[,-3]
   predict(trn,onerec)  # 1.49

Pooja-Rajkumar/rectools documentation built on May 8, 2019, 2:56 p.m.