O
- Type of an object.S
- Type of a subject.public class RecommendationDatasetData<O extends Serializable,S extends Serializable> extends Object implements AutoCloseable
data
of a dataset required in RecommendationTrainer
.Constructor and Description |
---|
RecommendationDatasetData(List<? extends ObjectSubjectRatingTriplet<O,S>> ratings)
Constructs a new instance of recommendation dataset data.
|
Modifier and Type | Method and Description |
---|---|
MatrixFactorizationGradient<O,S> |
calculateGradient(Map<O,Vector> objMatrix,
Map<S,Vector> subjMatrix,
int batchSize,
int seed,
double regParam,
double learningRate)
Calculates gradient of the loss function of recommendation system SGD training.
|
void |
close() |
Set<O> |
getObjects()
Returns set of objects contained in
ratings . |
Set<S> |
getSubjects()
Returns set of subjects contained in
ratings . |
public RecommendationDatasetData(List<? extends ObjectSubjectRatingTriplet<O,S>> ratings)
ratings
- All ratings related to the partition.public MatrixFactorizationGradient<O,S> calculateGradient(Map<O,Vector> objMatrix, Map<S,Vector> subjMatrix, int batchSize, int seed, double regParam, double learningRate)
objMatrix
- Object matrix obtained as a result of factorization of rating matrix.subjMatrix
- Subject matrix obtained as a result of factorization of rating matrix.batchSize
- Batch size of stochastic gradient descent. The size of a dataset used on each step of SGD.seed
- Seed (required to make randomized part behaviour repeatable).regParam
- Regularization parameter.learningRate
- Learning rate.public Set<O> getObjects()
ratings
.public Set<S> getSubjects()
ratings
.public void close()
close
in interface AutoCloseable
GridGain In-Memory Computing Platform : ver. 8.9.14 Release Date : November 5 2024