public class HPF extends Recommender
Modifier and Type | Field and Description |
---|---|
protected double |
a |
protected double |
aPrime |
protected double |
bPrime |
protected double |
c |
protected double |
cPrime |
protected static double |
DEFAULT_A |
protected static double |
DEFAULT_A_PRIME |
protected static double |
DEFAULT_B_PRIME |
protected static double |
DEFAULT_C |
protected static double |
DEFAULT_C_PRIME |
protected static double |
DEFAULT_D_PRIME |
protected double |
dPrime |
protected double[][] |
gamma |
protected double[][] |
gammaRte |
protected double[][] |
gammaShp |
protected double[] |
kappaRte |
protected double |
kappaShp |
protected double[][] |
lambda |
protected double[][] |
lambdaRte |
protected double[][] |
lambdaShp |
protected int |
numFactors
Number of latent factors
|
protected int |
numIters
Number of iterations
|
protected double[] |
tauRte |
protected double |
tauShp |
datamodel
Constructor and Description |
---|
HPF(DataModel datamodel,
int numFactors,
int numIters)
Models constructor
|
HPF(DataModel datamodel,
int numFactors,
int numIters,
double a,
double aPrime,
double bPrime,
double c,
double cPrime,
double dPrime)
Models constructor
|
HPF(DataModel datamodel,
int numFactors,
int numIters,
double a,
double aPrime,
double bPrime,
double c,
double cPrime,
double dPrime,
long seed)
Models constructor
|
HPF(DataModel datamodel,
int numFactors,
int numIters,
long seed)
Models constructor
|
HPF(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
|
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_A
protected static final double DEFAULT_A_PRIME
protected static final double DEFAULT_B_PRIME
protected static final double DEFAULT_C
protected static final double DEFAULT_C_PRIME
protected static final double DEFAULT_D_PRIME
protected final int numFactors
protected final int numIters
protected final double a
protected final double aPrime
protected final double bPrime
protected final double c
protected final double cPrime
protected final double dPrime
protected final double[][] gamma
protected final double[][] gammaShp
protected final double[][] gammaRte
protected final double kappaShp
protected final double[] kappaRte
protected final double[][] lambda
protected final double[][] lambdaShp
protected final double[][] lambdaRte
protected final double tauShp
protected final double[] tauRte
public HPF(DataModel datamodel, Map<String,Object> params)
datamodel
- DataModel instanceparams
- Model's hyper-parameters valuespublic HPF(DataModel datamodel, int numFactors, int numIters)
datamodel
- DataModel instancenumFactors
- Number of latent factorsnumIters
- Number of iterationspublic HPF(DataModel datamodel, int numFactors, int numIters, long seed)
datamodel
- DataModel instancenumFactors
- Number of latent factorsnumIters
- Number of iterationsseed
- Seed for random numbers generationpublic HPF(DataModel datamodel, int numFactors, int numIters, double a, double aPrime, double bPrime, double c, double cPrime, double dPrime)
datamodel
- DataModel instancenumFactors
- Number of latent factorsnumIters
- Number of iterationsa
- Model hyper-parameter. Read the paper for more information related to this
hyper-parameter.aPrime
- Model hyper-parameter. Read the paper for more information related to this
hyper-parameter.bPrime
- Model hyper-parameter. Read the paper for more information related to this
hyper-parameter.c
- Model hyper-parameter. Read the paper for more information related to this
hyper-parameter.cPrime
- Model hyper-parameter. Read the paper for more information related to this
hyper-parameter.dPrime
- Model hyper-parameter. Read the paper for more information related to this
hyper-parameter.public HPF(DataModel datamodel, int numFactors, int numIters, double a, double aPrime, double bPrime, double c, double cPrime, double dPrime, long seed)
datamodel
- DataModel instancenumFactors
- Number of latent factorsnumIters
- Number of iterationsa
- Model hyper-parameter. Read the paper for more information related to this
hyper-parameter.aPrime
- Model hyper-parameter. Read the paper for more information related to this
hyper-parameter.bPrime
- Model hyper-parameter. Read the paper for more information related to this
hyper-parameter.c
- Model hyper-parameter. Read the paper for more information related to this
hyper-parameter.cPrime
- Model hyper-parameter. Read the paper for more information related to this
hyper-parameter.dPrime
- Model hyper-parameter. Read the paper for more information related to this
hyper-parameter.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()
Copyright © 2020. All rights reserved.