Similarity_Pearson {GACFF}R Documentation

Similarity between users in Pearson method.

Description

Finding the similarity with Pearson's method.

Usage

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

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]))

[Package GACFF version 1.0 Index]