public class CLiMF extends Recommender
Modifier and Type | Field and Description |
---|---|
protected static double |
DEFAULT_GAMMA |
protected static double |
DEFAULT_LAMBDA |
protected double |
gamma
Learning rate
|
protected double |
lambda
Regularization
|
protected int |
numFactors
Number of latent factors
|
protected int |
numIters
Number of iterations
|
protected double |
threshold
Threshold to binarize rating matrix.
|
protected double[][] |
U
Users' latent factors
|
protected double[][] |
V
Items's latent factors
|
datamodel
Constructor and Description |
---|
CLiMF(DataModel datamodel,
int numFactors,
double gamma,
double lambda,
int numIters,
double threshold)
Model constructor
|
CLiMF(DataModel datamodel,
int numFactors,
double gamma,
double lambda,
int numIters,
double threshold,
long seed)
Model constructor
|
CLiMF(DataModel datamodel,
int numFactors,
int numIters)
Model constructor
|
CLiMF(DataModel datamodel,
int numFactors,
int numIters,
double threshold)
Model constructor
|
CLiMF(DataModel datamodel,
int numFactors,
int numIters,
double threshold,
long seed)
Model constructor
|
CLiMF(DataModel datamodel,
int numFactors,
int numIters,
long seed)
Model constructor
|
CLiMF(DataModel datamodel,
Map<String,Object> params)
Model constructor from a Map containing the model's hyper-parameters values.
|
Modifier and Type | Method and Description |
---|---|
void |
fit()
Estimates model parameters given the hyper-parameters
|
double |
getGamma()
Get the learning rate parameter of the model
|
double |
getLambda()
Get the regularization parameter of the model
|
int |
getNumFactors()
Get the number of factors of the model
|
int |
getNumIters()
Get the number of iterations
|
double |
predict(int userIndex,
int itemIndex)
Computes a rating prediction
|
String |
toString() |
getDataModel, predict
protected static final double DEFAULT_GAMMA
protected static final double DEFAULT_LAMBDA
protected int numFactors
protected double gamma
protected double lambda
protected int numIters
protected double threshold
protected double[][] U
protected double[][] V
public CLiMF(DataModel datamodel, Map<String,Object> params)
datamodel
- DataModel instanceparams
- Model's hyper-parameters valuespublic CLiMF(DataModel datamodel, int numFactors, int numIters)
datamodel
- DataModel instancenumFactors
- Number of latent factorsnumIters
- Number of iterationspublic CLiMF(DataModel datamodel, int numFactors, int numIters, long seed)
datamodel
- DataModel instancenumFactors
- Number of latent factorsnumIters
- Number of iterationsseed
- Seed for random numbers generationpublic CLiMF(DataModel datamodel, int numFactors, int numIters, double threshold, long seed)
datamodel
- DataModel instancenumFactors
- Number of latent factorsnumIters
- Number of iterationsthreshold
- Threshold to binarize rating matrix. Any rating greater or equal than this
threshold will be used during the training process.seed
- Seed for random numbers generationpublic CLiMF(DataModel datamodel, int numFactors, int numIters, double threshold)
datamodel
- DataModel instancenumFactors
- Number of latent factorsnumIters
- Number of iterationsthreshold
- Threshold to binarize rating matrix. Any rating greater or equal than this
threshold will be used during the training process.public CLiMF(DataModel datamodel, int numFactors, double gamma, double lambda, int numIters, double threshold)
datamodel
- DataModel instancenumFactors
- Number of latent factorsgamma
- Learning ratelambda
- RegularizationnumIters
- Number of iterationsthreshold
- Threshold to binarize rating matrix. Any rating greater or equal than this
threshold will be used during the training process.public CLiMF(DataModel datamodel, int numFactors, double gamma, double lambda, int numIters, double threshold, long seed)
datamodel
- DataModel instancenumFactors
- Number of latent factorsgamma
- Learning ratelambda
- RegularizationnumIters
- Number of iterationsthreshold
- Threshold to binarize rating matrix. Any rating greater or equal than this
threshold will be used during the training process.seed
- Seed for random numbers generationpublic void fit()
Recommender
fit
in class Recommender
public double predict(int userIndex, int itemIndex)
Recommender
predict
in class Recommender
userIndex
- Index of the user in the array of Users of the DataModel instanceitemIndex
- Index of the item in the array of Items of the DataModel instancepublic int getNumFactors()
public int getNumIters()
public double getLambda()
public double getGamma()
Copyright © 2020. All rights reserved.