|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectprea.recommender.matrix.MatrixFactorizationRecommender
prea.recommender.matrix.NMF
public class NMF
This is a class implementing Non-negative Matrix Factorization. Technical detail of the algorithm can be found in Daniel D. Lee and H. Sebastian Seung, Algorithms for Non-negative Matrix Factorization, Advances in Neural Information Processing Systems, 2001.
| Field Summary | |
|---|---|
private SparseMatrix |
validationMatrix
Rating matrix for items which will be used during the validation phase. |
private double |
validationRatio
Proportion of dataset, using for validation purpose. |
| Fields inherited from class prea.recommender.matrix.MatrixFactorizationRecommender |
|---|
featureCount, itemCount, itemFeatures, learningRate, maxIter, maxValue, minValue, momentum, offset, regularizer, showProgress, userCount, userFeatures |
| Constructor Summary | |
|---|---|
NMF(int uc,
int ic,
double max,
double min,
int fc,
double lr,
double r,
double m,
int iter,
double vr,
boolean verbose)
Construct a matrix-factorization model with the given data. |
|
| Method Summary | |
|---|---|
void |
buildModel(SparseMatrix rateMatrix)
Build a model with given training set. |
private void |
makeValidationSet(SparseMatrix rateMatrix,
double validationRatio)
Items which will be used for validation purpose are moved from rateMatrix to validationMatrix. |
private void |
restoreValidationSet(SparseMatrix rateMatrix)
Items in validationMatrix are moved to original rateMatrix. |
| Methods inherited from class prea.recommender.matrix.MatrixFactorizationRecommender |
|---|
evaluate |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private SparseMatrix validationMatrix
private double validationRatio
| Constructor Detail |
|---|
public NMF(int uc,
int ic,
double max,
double min,
int fc,
double lr,
double r,
double m,
int iter,
double vr,
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 in low-rank factorized matrix.lr - The learning rate for gradient-descent method.r - The regularization factor.m - The momentum parameter.iter - The maximum number of iteration.verbose - Show progress of iterative methods.| Method Detail |
|---|
public void buildModel(SparseMatrix rateMatrix)
buildModel in interface RecommenderbuildModel in class MatrixFactorizationRecommenderrateMatrix - Training data set.
private void makeValidationSet(SparseMatrix rateMatrix,
double validationRatio)
validationRatio - Proportion of dataset, using for validation purpose.private void restoreValidationSet(SparseMatrix rateMatrix)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||