Class PIP
- java.lang.Object
-
- es.upm.etsisi.cf4j.recommender.knn.itemSimilarityMetric.ItemSimilarityMetric
-
- es.upm.etsisi.cf4j.recommender.knn.itemSimilarityMetric.PIP
-
public class PIP extends ItemSimilarityMetric
This class implements the PIP CF similarity metric for the items. The similarity metric is described here: Ahn, H. J. (2008). A new similarity measure for collaborative filtering o alleviate the new user cold-starting problem, Information Sciences, 178, 37??51.
-
-
Field Summary
-
Fields inherited from class es.upm.etsisi.cf4j.recommender.knn.itemSimilarityMetric.ItemSimilarityMetric
datamodel, similarities
-
-
Constructor Summary
Constructors Constructor Description PIP()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
beforeRun()
Is executed once before execute the method 'exec'.double
similarity(Item item, Item otherItem)
This method must returns the similarity between two items.-
Methods inherited from class es.upm.etsisi.cf4j.recommender.knn.itemSimilarityMetric.ItemSimilarityMetric
afterRun, getSimilarities, run, setDatamodel, toString
-
-
-
-
Method Detail
-
beforeRun
public void beforeRun()
Description copied from interface:Partible
Is executed once before execute the method 'exec'. It can be used to initialize resources.- Specified by:
beforeRun
in interfacePartible<Item>
- Overrides:
beforeRun
in classItemSimilarityMetric
-
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 classItemSimilarityMetric
- Parameters:
item
- An itemotherItem
- Other item- Returns:
- Similarity between item and otherItem
-
-