Skip to content

Instantly share code, notes, and snippets.

@sanealytics
Created March 18, 2015 00:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sanealytics/6521ee55e3c06f6778d1 to your computer and use it in GitHub Desktop.
Save sanealytics/6521ee55e3c06f6778d1 to your computer and use it in GitHub Desktop.
testing Rcgmin
data(MovieLense)
scheme <- evaluationScheme(MovieLense, method = "split", train = .9,
k = 1, given = 10, goodRating = 4)
scheme
# register recommender
recommenderRegistry$set_entry(
method="RSVD", dataType = "realRatingMatrix", fun=REAL_RSVD,
description="Recommender based on Low Rank Matrix Factorization (real data).")
algorithms <- list(
"random items" = list(name="RANDOM", param=list(normalize = "Z-score")),
"popular items" = list(name="POPULAR", param=list(normalize = "Z-score")),
"user-based CF" = list(name="UBCF", param=list(normalize = "Z-score",
method="Cosine",
nn=50, minRating=3)),
"Matrix Factorization (L-BFGS-B)" = list(name="RSVD", param=list(categories = 50,
lambda = 10,
maxit = 100)),
"Matrix Factorization (Rcgmin)" = list(name="RSVD", param=list(categories = 50,
lambda = 10,
optimize = Rcgmin,
maxit = 100))
)
# run algorithms, predict next n movies
results <- evaluate(scheme, algorithms, n=c(1, 3, 5, 10, 15, 20))
# Draw ROC curve
plot(results, annotate = 1:4, legend="topleft")
# See precision / recall
plot(results, "prec/rec", annotate=3)
@surekhabyra
Copy link

how to install "sanealytics","recommenderlabrats"from hitgub and this statement is not working "install_github("sanealytics", "recommenderlabrats")"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment