Class Singularities

  • All Implemented Interfaces:
    Partible<User>

    public class Singularities
    extends UserSimilarityMetric
    Implements the following CF similarity metric: Bobadilla, J., Ortega, F., & Hernando, A. (2012). A collaborative filtering similarity measure based on singularities, Information Processing and Management, 48 (2), 204-217.
    • Constructor Detail

      • Singularities

        public Singularities​(double[] relevantRatings,
                             double[] notRelevantRatings)
        Constructor of the similarity metric
        Parameters:
        relevantRatings - Relevant ratings array
        notRelevantRatings - Not relevant ratings array
    • Method Detail

      • similarity

        public double similarity​(User user,
                                 User otherUser)
        Description copied from class: UserSimilarityMetric
        This method must returns the similarity between two users.

        If two users do not have a similarity value, the method must return Double.NEGATIVE_INFINITY.

        The value returned by this method should be higher the greater the similarity between users.

        Specified by:
        similarity in class UserSimilarityMetric
        Parameters:
        user - A user
        otherUser - Other user
        Returns:
        Similarity between user and otherUser