Dissimilarity and Similarity Calculation Between Rating Data
Calculate dissimilarities/similarities between ratings by users and for items.
"dissimilarity"(x, y = NULL, method = NULL, args = NULL, which="users") "dissimilarity"(x, y = NULL, method = NULL, args = NULL, which="users")similarity(x, y = NULL, method = NULL, args = NULL, ...) "similarity"(x, y = NULL, method = NULL, args = NULL, which="users")
- a ratingMatrix.
NULLor a second ratingMatrix to calculate cross-(dis)similarities.
- (dis)similarity measure to use. Available measures
"jaccard", etc. See
itemMatrixin arules for details about measures for
distin proxy for
- a list of additional arguments for the methods.
- a character string indicating if the (dis)similarity should be
- further arguments.
Similarities are computed from dissimilarities using $s=1/(1+d)$ or $s=1-d$ depending on the measure. For Pearson we use 1 - positive correlation.
returns an object of class
similor an appropriate object (e.g., a matrix) to represent a cross-(dis)similarity.
dissimilarity in arules.
data(MSWeb) ## between 5 users dissimilarity(MSWeb[1:5,], method = "jaccard") similarity(MSWeb[1:5,], method = "jaccard") ## between first 3 items dissimilarity(MSWeb[,1:3], method = "jaccard", which = "items") similarity(MSWeb[,1:3], method = "jaccard", which = "items") ## cross-similarity between first 2 users and users 10-20 similarity(MSWeb[1:2,], MSWeb[10:20,], method="jaccard")