public class Singularities extends ItemSimilarityMetric
datamodel, similarities
Constructor and Description |
---|
Singularities(double[] relevantRatings,
double[] notRelevantRatings)
Constructor of the similarity metric
|
Modifier and Type | Method and 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.
|
String |
toString() |
afterRun, getSimilarities, run, setDatamodel
public Singularities(double[] relevantRatings, double[] notRelevantRatings)
relevantRatings
- Relevant ratings arraynotRelevantRatings
- Not relevant ratings arraypublic void beforeRun()
Partible
beforeRun
in interface Partible<Item>
beforeRun
in class ItemSimilarityMetric
public double similarity(Item item, Item otherItem)
ItemSimilarityMetric
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.
similarity
in class ItemSimilarityMetric
item
- An itemotherItem
- Other itempublic String toString()
toString
in class ItemSimilarityMetric
Copyright © 2020. All rights reserved.