|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.mymedialite.ensemble.Ensemble
org.mymedialite.ensemble.WeightedEnsemble
public class WeightedEnsemble
Combining several predictors with a weighted ensemble. This recommender does NOT support incremental updates.
Field Summary | |
---|---|
protected double |
weight_sum
Sum of the component weights. |
java.util.List<java.lang.Double> |
weights
List of component weights. |
Fields inherited from class org.mymedialite.ensemble.Ensemble |
---|
recommenders |
Constructor Summary | |
---|---|
WeightedEnsemble()
|
Method Summary | |
---|---|
void |
loadModel(java.lang.String filename)
Get the model parameters from a file |
double |
predict(int user_id,
int item_id)
Predict the rating or score for a given user-item combination. |
void |
saveModel(java.lang.String filename)
Save the model parameters to a file |
void |
train()
Learn the model parameters of the recommender from the training data |
Methods inherited from class org.mymedialite.ensemble.Ensemble |
---|
canPredict, clone, getMaxRatingValue, getMinRatingValue, setMaxRatingValue, setMinRatingValue |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.mymedialite.IRecommender |
---|
toString |
Field Detail |
---|
public java.util.List<java.lang.Double> weights
protected double weight_sum
Constructor Detail |
---|
public WeightedEnsemble()
Method Detail |
---|
public void train()
IRecommender
train
in interface IRecommender
train
in class Ensemble
public double predict(int user_id, int item_id)
IRecommender
predict
in interface IRecommender
predict
in class Ensemble
user_id
- the user IDitem_id
- the item ID
public void saveModel(java.lang.String filename) throws java.io.IOException
IRecommender
saveModel
in interface IRecommender
saveModel
in class Ensemble
filename
- the file to write to
java.io.IOException
public void loadModel(java.lang.String filename) throws java.io.IOException
IRecommender
loadModel
in interface IRecommender
loadModel
in class Ensemble
filename
- the file to read from
java.io.IOException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |