|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectprea.recommender.matrix.MatrixFactorizationRecommender
public abstract class MatrixFactorizationRecommender
This is an abstract class implementing four matrix-factorization-based methods including Regularized SVD, NMF, PMF, and Bayesian PMF.
Field Summary | |
---|---|
int |
featureCount
The number of features. |
int |
itemCount
The number of items. |
protected SparseMatrix |
itemFeatures
Item profile in low-rank matrix form. |
double |
learningRate
Learning rate parameter. |
int |
maxIter
Maximum number of iteration. |
double |
maxValue
Maximum value of rating, existing in the dataset. |
double |
minValue
Minimum value of rating, existing in the dataset. |
double |
momentum
Momentum parameter. |
protected double |
offset
Offset to rating estimation. |
double |
regularizer
Regularization factor parameter. |
boolean |
showProgress
Indicator whether to show progress of iteration. |
int |
userCount
The number of users. |
protected SparseMatrix |
userFeatures
User profile in low-rank matrix form. |
Constructor Summary | |
---|---|
MatrixFactorizationRecommender(int uc,
int ic,
double max,
double min,
int fc,
double lr,
double r,
double m,
int iter,
boolean verbose)
Construct a matrix-factorization-based model with the given data. |
Method Summary | |
---|---|
void |
buildModel(SparseMatrix rateMatrix)
Build a model with given training set. |
EvaluationMetrics |
evaluate(SparseMatrix testMatrix)
Evaluate the designated algorithm with the given test data. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public int userCount
public int itemCount
public double maxValue
public double minValue
public int featureCount
public double learningRate
public double regularizer
public double momentum
public int maxIter
public boolean showProgress
protected double offset
protected SparseMatrix userFeatures
protected SparseMatrix itemFeatures
Constructor Detail |
---|
public MatrixFactorizationRecommender(int uc, int ic, double max, double min, int fc, double lr, double r, double m, int iter, boolean verbose)
uc
- The number of users in the dataset.ic
- The number of items in the dataset.max
- The maximum rating value in the dataset.min
- The minimum rating value in the dataset.fc
- The number of features used for describing user and item profiles.lr
- Learning rate for gradient-based or iterative optimization.r
- Controlling factor for the degree of regularization.m
- Momentum used in gradient-based or iterative optimization.iter
- The maximum number of iterations.verbose
- Indicating whether to show iteration steps and train error.Method Detail |
---|
public void buildModel(SparseMatrix rateMatrix)
buildModel
in interface Recommender
rateMatrix
- The rating matrix with train data.public EvaluationMetrics evaluate(SparseMatrix testMatrix)
evaluate
in interface Recommender
testMatrix
- The rating matrix with test data.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |