Created
June 12, 2012 16:24
-
-
Save sanealytics/2918506 to your computer and use it in GitHub Desktop.
Recommenderlab walkthrough 1-6
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
recommenderRegistry$get_entries(dataType = "realRatingMatrix") | |
# We have a few options | |
# Let's check some algorithms against each other | |
scheme <- evaluationScheme(MovieLense, method = "split", train = .9, | |
k = 1, given = 10, goodRating = 4) | |
scheme | |
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)), | |
"item-based CF" = list(name="IBCF2", param=list(normalize = "Z-score" | |
)) | |
) | |
# 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) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment