public class Singularities extends UserSimilarityMetric
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(User user,
User otherUser)
This method must returns the similarity between two users.
|
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<User>
beforeRun
in class UserSimilarityMetric
public double similarity(User user, User otherUser)
UserSimilarityMetric
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.
similarity
in class UserSimilarityMetric
user
- A userotherUser
- Other userpublic String toString()
toString
in class UserSimilarityMetric
Copyright © 2020. All rights reserved.