|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectprea.util.EvaluationMetrics
public class EvaluationMetrics
This is a unified class providing evaluation metrics, including comparison of predicted ratings and rank-based metrics, etc.
Field Summary | |
---|---|
private double |
asymmetricLoss
Asymmetric Loss |
private int |
halflife
Half-life in rank-based metrics |
private double |
hlu
Rank-based Half-Life Utility (HLU) |
private double |
kendallsTau
Rank-based Kendall's Tau |
private double |
mae
Mean Absoulte Error (MAE) |
private double |
maxValue
Maximum value of rating, existing in the dataset. |
private double |
minValue
Minimum value of rating, existing in the dataset. |
private double |
mse
Mean Squared Error (MSE) |
private double |
ndcg
Rank-based Normalized Discounted Cumulative Gain (NDCG) |
private SparseMatrix |
predicted
Predicted ratings by CF algorithms for test items. |
private int |
recommendCount
The number of items to recommend, in rank-based metrics |
private double |
spearman
Rank-based Spear |
private SparseMatrix |
testMatrix
Real ratings for test items. |
Constructor Summary | |
---|---|
EvaluationMetrics(SparseMatrix tm,
SparseMatrix p,
double max,
double min)
Standard constructor for EvaluationMetrics class. |
Method Summary | |
---|---|
private void |
build()
Calculate all evaluation metrics with given real and predicted rating matrices. |
double |
getAsymmetricLoss()
Getter method for Asymmetric loss |
double |
getHLU()
Getter method for Rank-based Half-life score |
double |
getKendall()
Getter method for Rank-based Kendall's Tau |
double |
getMAE()
Getter method for Mean Absolute Error (MAE) |
double |
getMSE()
Getter method for Mean Squared Error (MSE) |
double |
getNDCG()
Getter method for Rank-based NDCG |
double |
getNMAE()
Getter method for Normalized Mean Absolute Error (NMAE) |
double |
getRMSE()
Getter method for Root of Mean Squared Error (RMSE) |
double |
getSpearman()
Getter method for Rank-based Spearman score |
java.lang.String |
printMultiLine()
|
java.lang.String |
printOneLine()
|
static java.lang.String |
printTitle()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private SparseMatrix testMatrix
private SparseMatrix predicted
private double maxValue
private double minValue
private int recommendCount
private int halflife
private double mae
private double mse
private double hlu
private double ndcg
private double kendallsTau
private double spearman
private double asymmetricLoss
Constructor Detail |
---|
public EvaluationMetrics(SparseMatrix tm, SparseMatrix p, double max, double min)
tm
- Real ratings of test items.p
- Predicted ratings of test items.max
- Maximum value of rating, existing in the dataset.min
- Minimum value of rating, existing in the dataset.Method Detail |
---|
public double getMAE()
public double getNMAE()
public double getMSE()
public double getRMSE()
public double getHLU()
public double getNDCG()
public double getKendall()
public double getSpearman()
public double getAsymmetricLoss()
private void build()
public java.lang.String printMultiLine()
public java.lang.String printOneLine()
public static java.lang.String printTitle()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |