CFF-package {CFF}R Documentation

Simple Similarity for User-Based Collaborative Filtering Systems

Description

A simple, fast algorithm to find the neighbors and similarities of users in user-based filtering systems, to break free from the complex computation of existing similarity formulas and the ability to solve big data.

Details

The DESCRIPTION file:

Package: CFF
Title: Simple Similarity for User-Based Collaborative Filtering Systems
Version: 1.0
Date: 2020-02-25
Authors@R: c(person(given="Farimah", family="Houshmand Nanehkaran", role = c("aut", "cre"), email="hoshmandcomputer@gmail.com", comment = c(ORCID = "0000-0003-1687-1719", "University=Islamic Azad University of Kashan,Kashan,Iran")), person(given="Seyed Mohammad Reza", family="Lajevardi", role = c("ctb"), email="R.Lajevardi@iaukashan.ac.ir", comment = c(ORCID = "0000-0002-4744-2784","University=Islamic Azad University of Kashan,Kashan,Iran")), person(given="Mahmoud", family="Mahlouji Bidgholi", role = c("ctb"), email="m.mahlouji@iaukashan.ac.ir", comment = c(ORCID = "0000-0001-8895-8501","University=Islamic Azad University of Kashan,Kashan,Iran")))
Maintainer: Farimah Houshmand Nanehkaran <hoshmandcomputer@gmail.com>
Description: A simple, fast algorithm to find the neighbors and similarities of users in user-based filtering systems, to break free from the complex computation of existing similarity formulas and the ability to solve big data.
License: GPL (>= 2)
Encoding: UTF-8
RoxygenNote: 7.0.2
Author: Farimah Houshmand Nanehkaran [aut, cre] (<https://orcid.org/0000-0003-1687-1719>, University=Islamic Azad University of Kashan,Kashan,Iran), Seyed Mohammad Reza Lajevardi [ctb] (<https://orcid.org/0000-0002-4744-2784>, University=Islamic Azad University of Kashan,Kashan,Iran), Mahmoud Mahlouji Bidgholi [ctb] (<https://orcid.org/0000-0001-8895-8501>, University=Islamic Azad University of Kashan,Kashan,Iran)

Index of help topics:

CFF-package             Simple Similarity for User-Based Collaborative
                        Filtering Systems
Score_replace           Replacing of Neighbor Users' Ratings on
                        Non-Rated Items By The Active User
simple_predict          Prediction Unseen Items For The Active User
simple_similarity       Finding Neighbor Users And Their Similarity
                        Values

User-Based Collaborative Filtering Systems

Author(s)

NA

Maintainer: Farimah Houshmand Nanehkaran <hoshmandcomputer@gmail.com>

References

Kumar, P., Kumar, V., & Thakur, R. S. (2019). A new approach for rating prediction system using collaborative filtering. Iran Journal of Computer Science, vol.2, no. 2, pp. 81-87.

Zhang, P., Zhang, Z., Tian, T., & Wang, Y. (2019). Collaborative filtering recommendation algorithm integrating time windows and rating predictions. Applied Intelligence, vol. 49, no. 8, pp. 3146-3157.

Gadekula, S. K., Rao, U. P., Vyas, R. K., Dontula, A. L., & Gaikwad, S. V. (2019). Improved Pearson Similarity for Collaborative Filtering Recommendation System. In 2019 6th International Conference on Computing for Sustainable Global Development (INDIACom), pp. 1047-1054, IEEE.

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)
active_users <- c(1:dim(ratings)[2])

time_all <- c(rep(NaN, length(active_users)))

ratings3 <- ratings

for (ac in 1:length(active_users))
{
  cat("=========== user",active_users[ac], "==================", "\n","\n")
  ##1
  T1_start <- Sys.time()
  sim <- simple_similarity(ratings, max_score=5, min_score=1, ac)
  T1_end <- Sys.time()

  cat("    Similar Users =", sim$sim_index,                      "\n","\n")
  cat("Similarity Values =", sim$sim_x,                          "\n","\n")

  ##2
  T2_start <- Sys.time()
  ratings2 <- Score_replace(ratings, sim_index= sim$sim_index, ac)
  T2_end   <- Sys.time()

  cat(" Predicted Scores =", ratings2[,ac],                      "\n","\n")

  ##3
  T3_start <- Sys.time()
  predictedItems <- simple_predict(ratings, ratings2, ac)
  T3_end <- Sys.time()

  cat("  Predicted Items =", predictedItems,                    "\n","\n")

  ##4
  time_all[ac] <- (T1_end - T1_start) + (T2_end - T2_start) + (T3_end - T3_start)

  cat("             Time =", time_all[ac],                      "\n","\n")

  ##5
  ratings3[,ac] <- ratings2[,ac]
}

Mean_Time <- mean(time_all)

cat("=========== Mean Time ==================",                "\n","\n")

cat("         Mean Time =", Mean_Time,                         "\n","\n")

cat("       Full Matrix =",                                    "\n","\n")

print(ratings3)

[Package CFF version 1.0 Index]