Description Usage Arguments Details Value See Also Examples
Calculate dissimilarities/similarities between ratings by users and for items.
1 2 3 4 5 6 7 8 | ## S4 method for signature 'binaryRatingMatrix'
dissimilarity(x, y = NULL, method = NULL, args = NULL, which="users")
## S4 method for signature 'realRatingMatrix'
dissimilarity(x, y = NULL, method = NULL, args = NULL, which="users")
similarity(x, y = NULL, method = NULL, args = NULL, ...)
## S4 method for signature 'ratingMatrix'
similarity(x, y = NULL, method = NULL, args = NULL, which="users")
|
x |
a ratingMatrix. |
y |
|
method |
(dis)similarity measure to use. Available measures
are typically |
args |
a list of additional arguments for the methods. |
which |
a character string indicating if the (dis)similarity should be
calculated between |
... |
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 dist
, simil
or an appropriate object (e.g.,
a matrix) to represent a cross-(dis)similarity.
ratingMatrix
and
dissimilarity
in arules.
1 2 3 4 5 6 7 8 9 10 11 12 | 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")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.