Similarity_Pearson: Similarity between users in Pearson method.

Description Usage Arguments Details Value References Examples

View source: R/Similarity_Pearson.R

Description

Finding the similarity with Pearson's method.

Usage

1
Similarity_Pearson(ratings, active_user, near_user)

Arguments

ratings

A rating matrix whose rows are items and columns are users.

active_user

The id of an active user as an integer greater than zero (for example active_user<-6).

near_user

A vector of neighbor users that in the Pearson method are all users.

Details

Obtaining the Pearson similarity through the cor command from state package does not produce the desired response.

Value

sim_ac

Pearson's similarity between the active user and all users.

References

Karabadji, N.E.I., Beldjoudi, S., Seridi, H., Aridhi, S. and Dhifli, W. (2018). Improving memory-based user collaborative filtering with evolutionary multi-objective optimization. Expert Systems with Applications, vol. 98, pp.153-165.

Examples

1
2
3
4
5
6
7
8
9
ratings <- matrix(c(  2,    5,  NaN,  NaN,  NaN,    4,
                    NaN,  NaN,  NaN,    1,  NaN,    5,
                    NaN,    4,    5,  NaN,    4,  NaN,
                      4,  NaN,  NaN,    5,  NaN,  NaN,
                      5,  NaN,    2,  NaN,  NaN,  NaN,
                    NaN,    1,  NaN,    4,    2,  NaN),nrow=6,byrow=TRUE)	

sim.Pearson  <- Similarity_Pearson (ratings, active_user=6, 
                                   near_user=c(1:dim(ratings)[2]))

GACFF documentation built on Dec. 20, 2019, 5:07 p.m.