Train model

We have our data split into the following:

  • train: The user matrix we will use to build our recommendation model.
  • test.known: We will feed this for our predict method along with our model. The output can now be compared to our test dataset.
  • test: The test dataset is used for evaluating our model

Using these, let us go ahead and build our recommender system. For the first model, we are going to build a random model.

Building the random model looks as follows:

> random.model <- Recommender(train, "RANDOM")> random.modelRecommender of type 'RANDOM' for 'realRatingMatrix' learned using 1350 users.> getModel(random.model)$range[1] -5.998287  5.224277$labels [1] "j1" "j2" "j3" "j4" "j5" "j6" "j7" "j8" "j9" "j10" "j11" "j12" "j13" "j14" ...

Get R Data Analysis Projects now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.