Class QualityMeasure
- java.lang.Object
-
- es.upm.etsisi.cf4j.qualityMeasure.QualityMeasure
-
- Direct Known Subclasses:
Coverage
,Discovery
,Diversity
,F1
,MAE
,Max
,MSE
,MSLE
,NDCG
,Novelty
,Perfect
,Precision
,R2
,Recall
public abstract class QualityMeasure extends Object
Abstract class used to simplify the evaluation of collaborative filtering based recommendation models. To define a new quality measure, getScore(TestUser testUser, double[] predictions) must be encoded.
-
-
Field Summary
Fields Modifier and Type Field Description protected Recommender
recommender
Recommender instance for which the quality measure are going to be computed
-
Constructor Summary
Constructors Constructor Description QualityMeasure(Recommender recommender)
Creates a new quality measure
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description double
getScore()
Computes the quality measure of the recommenderdouble
getScore(int numThreads)
Computes the quality measure of the recommenderprotected abstract double
getScore(TestUser testUser, double[] predictions)
Computes the quality measure score for a TestUser given the predictions for his/her test ratings
-
-
-
Field Detail
-
recommender
protected Recommender recommender
Recommender instance for which the quality measure are going to be computed
-
-
Constructor Detail
-
QualityMeasure
public QualityMeasure(Recommender recommender)
Creates a new quality measure- Parameters:
recommender
- Recommender instance for which the quality measure are going to be computed
-
-
Method Detail
-
getScore
protected abstract double getScore(TestUser testUser, double[] predictions)
Computes the quality measure score for a TestUser given the predictions for his/her test ratings- Parameters:
testUser
- TestUser for which the quality measure score is computedpredictions
- Prediction value for the test items rated by the test user- Returns:
- Quality measure score
-
getScore
public double getScore(int numThreads)
Computes the quality measure of the recommender- Parameters:
numThreads
- Number of threads to compute de quality measure in parallel for each test user. Use all available threads by default.- Returns:
- Quality measure score
-
getScore
public double getScore()
Computes the quality measure of the recommender- Returns:
- Quality measure score
-
-