Class Singularities

  • All Implemented Interfaces:
    Partible<Item>

    public class Singularities
    extends ItemSimilarityMetric
    This class implements the singularities CF similarity metric. The similarity metric is described here: 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​(Item item,
                                 Item otherItem)
        Description copied from class: ItemSimilarityMetric
        This method must returns the similarity between two items.

        If two items 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 items.

        Specified by:
        similarity in class ItemSimilarityMetric
        Parameters:
        item - An item
        otherItem - Other item
        Returns:
        Similarity between item and otherItem