R : Use custom similarity function in Recommender function in R

140 Views Asked by At

I try to build a model using my dataset matrix (ratingmatrix) and a similarity matrix (Custom similarity matrix) in R using RecommerderLab. In the Recommender function I'm only able to pass default similarity fucntions as method parameter such as "Cosine", "Jaccard". How can I use my own similarity function or similarity matrix to make the model as shown below? I have already created my custom similarity matrix. Thank you.

e <- evaluationScheme(ratingmatrix, method="split", train=0.8, given=1)

model <- Recommender(getData(e, "train"), method = "UBCF",param=list(normalize = "center", method="Custom_Similarity_Function", nn=50))

prediction <- predict(model, getData(e, "known"), type="ratings")

rmse_ubcf <- calcPredictionAccuracy(prediction, getData(e, "unknown"))[1]
0

There are 0 best solutions below