createRatingsModel

using Collaborative Filtering

This operator makes automatic predictions (filtering) about the interests of a user by collecting preferences or taste information from many users (collaborating). The underlying assumption of the collaborative filtering approach is that if a person A has the same opinion as a person B on an issue, A is more likely to have B's opinion on a different issue than that of a randomly chosen person. For example, a collaborative filtering recommendation system for television tastes could make predictions about which television show a user should like given a partial list of that user's tastes (likes or dislikes). Note that these predictions are specific to the user, but use information gleaned from many users.

Operator Usage in Easy Mode

  1. Click + on the parent node.
  2. Enter Create Ratings Model operator in the search field and select the operator from the Results to open the operator form.
  3. In the Table drop-down, enter or select the table to create a model.
  4. In the Model Name field, enter the name of the model to store it in a particular location.
  5. In the Users Column drop-down, enter or select a usernames column.
  6. In the Items Column drop-down, enter or select a column to create a column.
  7. In the Ratings Column, enter or select a column.
  8. Click Run to view the result.
  9. Click Save to add the operator to the playbook.
  10. Click Cancel to discard the operator form.

Usage Details

createRatingModel(table, modelName, user, item, rating)
// table: input table
// modelName: name of a model to store
// user: username column or you can treat is as field1
// item: item column e.g. field2
// rating: rating column (numeric), e.g. metric column
// This operator will create a model that will learn rating of the metric field based on collaborative filtering and will store it as a "modelName" file name that was provided by user
predictRating(table, modelName, user, item)
//table: input table
//modelName: name of the model that was given during createRatingModel operator
//user: username column e.g. field1
//item: item column e.g. field2
// This operator will create a "prediction" column which is the prediction of rating based on the (username, item) from the training dataset.

In layman's term, if there are users with similar behaviors in the training dataset, extract information and apply them to find the rating.

Example

Input
trainingTable

username movie rating
emilTitanic5.0
emilBrave Heart4.0
emilRed Wings1.0
kumarTitanic4.0
kumarBrave Heart4.0

testTable

username movie rating
kumarRed Wings1.0
createRatinsModel(trainingTable, "ratingModel", "username", "movie", "rating")
// output of this should say that it successfully created the model

result = predictRating(testTable, "ratingModel", "username", "movie")
// result should contain "prediction" column, and the value should be between 0.0 and 2.0
// since Emil and Kumar have rated similarly for previous two movies, so Kumar more likely will rate third movie similar to emil's rating where emil rated it as 1.0

Output

username movie prediction
kumarRed Wings1.0

Did this page help you?