
Provides the generic function affinity
and the S4 methods
to compute and return a similarity matrix with the affinities between items
for a set of '>transactions
.
affinity(x)
a matrix or an object of class itemMatrix
or transactions
.
returns an object of class ar_similarity
which represents
the affinities between items in x
.
Affinity between the two items
Charu C. Aggarwal, Cecilia Procopiuc, and Philip S. Yu (2002) Finding localized associations in market basket data, IEEE Trans. on Knowledge and Data Engineering, 14(1):51--62.
# NOT RUN {
data("Adult")
## choose a sample, calculate affinities
s <- sample(Adult, 500)
s
a <- affinity(s)
image(a)
# }
Run the code above in your browser using DataLab