I am new in R.
I am using R language to build prototype for Recommendation System using recommenderlab
package.
I am getting below error message.
Error in evaluate(x = eval_sets, method = models_to_evaluate, n = n_recommendations) :
unused arguments (x = eval_sets, method = models_to_evaluate, n = n_recommendations)
On executing below code :
library(recommenderlab)
library(ggplot2)
data("MovieLense")
ratings_movies <- MovieLense[rowCounts(MovieLense) > 27, colCounts(MovieLense) > 21]
n_fold <- 4
items_to_keep <- 15
rating_threshold <- 3
eval_sets <- evaluationScheme(data = ratings_movies,
method = "cross-validation",
k = n_fold,
given = items_to_keep,
goodRating = rating_threshold)
models_to_evaluate <- list(
IBCF_cos = list(name = "IBCF", param = list(method = "cosine")),
IBCF_cor = list(name = "IBCF", param = list(method = "pearson")),
UBCF_cos = list(name = "UBCF", param = list(method = "cosine")),
UBCF_cor = list(name = "UBCF", param = list(method = "pearson")),
random = list(name = "RANDOM", param=NULL)
)
n_recommendations <- c(1, 5, seq(10, 100, 10))
list_results <- evaluate(x = eval_sets,
method = models_to_evaluate,
n = n_recommendations)
I am not sure why the error is coming and how can I fix this.
I will be very thankful if somebody can help me out with this.
Thanks in advance.
The reason for why evaluate()
is having difficult being called is R believe a function exists without the arguments you are specifying. This evaluate function lacks even a ...
so the additional arguments are not referring to any kind of fixed or unfixed parameters and, hence, are "unused" arguments. The underlying reason for this is either
recommenderlab
package is not loaded via library()
/require()
, orevaluate()
as one of the functions. Hence, we opt to simplify the confusion R has when it searches through the different package namespaces for evaluate()
by specifying the package namespace that should be used, e.g. recommenderlab::
Thus, the reason for:
recommenderlab::evaluate(x = eval_sets, method = models_to_evaluate, n = n_recommendations)