Last active
January 4, 2016 16:09
-
-
Save mklew/8645738 to your computer and use it in GitHub Desktop.
recommenderlab z parametrami dla realRatingMatrix
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$set_entry( | |
method="IBCF", dataType = "realRatingMatrix", fun=REAL_IBCF, | |
description="Recommender based on item-based collaborative filtering (real data).", | |
parameters=.REAL_IBCF_params) | |
.REAL_IBCF_params <- list( | |
k = 30, | |
method="Cosine", | |
normalize = "center", | |
normalize_sim_matrix = FALSE, | |
alpha = 0.5, | |
na_as_zero = FALSE, | |
minRating = NA | |
) |
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
dissimilarity method for binaryRatingMatrix: | |
"jaccard" | |
"karypis" | |
"conditional" | |
dissimilarity method for realRatingMatrix: | |
"cosine" | |
"karypis" | |
"conditional" | |
"pearson" | |
similarity: | |
"cosine" | |
"karypis" | |
"conditional" | |
normalize: | |
"center" | |
"Z-score" |
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$set_entry( | |
method="PCA", dataType = "realRatingMatrix", fun=REAL_PCA, | |
description="Recommender based on PCA approximation (real data).", | |
parameters = .REAL_PCA_param) | |
.REAL_PCA_param <- list( | |
categories = 20, | |
method="Cosine", | |
normalize = "center", | |
normalize_sim_matrix = FALSE, | |
alpha = 0.5, | |
na_as_zero = FALSE, | |
minRating = NA | |
) |
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
nie ma parametrów |
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
nie ma parametrów |
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
Tutaj widać, że z recommenderRegistry brana jest odpowiednia metoda a potem dla tej metody wołana | |
jest funkcja do której przekazywane są parametry prosto z wywołania Recommender(parameter=...) | |
setMethod("Recommender", signature(data = "ratingMatrix"), | |
function(data, method, parameter = NULL) { | |
recom <- recommenderRegistry$get_entry( | |
method = method, dataType = class(data)) | |
if(is.null(recom)) stop(paste("Recommender method", method, | |
"not implemented for data type", class(data),".")) | |
## this is expected to return a valid Recommender object | |
recom$fun(data = data, parameter = parameter) | |
}) |
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
.REAL_SVD_param <- list( | |
categories = 50, | |
method="Cosine", | |
normalize = "center", | |
normalize_sim_matrix = FALSE, | |
alpha = 0.5, | |
treat_na = "median", | |
minRating = NA | |
) | |
recommenderRegistry$set_entry( | |
method="SVD", dataType = "realRatingMatrix", fun=REAL_SVD, | |
description="Recommender based on SVD approximation (real data).", | |
parameters = .REAL_SVD_param) |
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
.REAL_UBCF_param <- list( | |
method = "cosine", | |
nn = 25, | |
sample = FALSE, | |
## FIXME: implement weighted = TRUE, | |
normalize="center", | |
minRating = NA | |
) | |
recommenderRegistry$set_entry( | |
method="UBCF", dataType = "realRatingMatrix", fun=REAL_UBCF, | |
description="Recommender based on user-based collaborative filtering (real data).", | |
parameters=.REAL_UBCF_param) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment