|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.mymedialite.ratingprediction.RatingPredictor
public abstract class RatingPredictor
Abstract class for rating predictors that keep the rating data in memory for training (and possibly prediction)
Field Summary | |
---|---|
int |
maxItemID
Maximum item ID |
double |
maxRating
The maximum rating value |
int |
maxUserID
Maximum user ID |
double |
minRating
The minimum rating value |
protected IRatings |
ratings
The rating data |
Constructor Summary | |
---|---|
RatingPredictor()
|
Method Summary | |
---|---|
boolean |
canPredict(int user_id,
int item_id)
Check whether a useful prediction can be made for a given user-item combination. |
RatingPredictor |
clone()
|
double |
getMaxRating()
Get the max rating value. |
double |
getMinRating()
Get the min rating value. |
IRatings |
getRatings()
|
abstract void |
loadModel(java.lang.String filename)
Get the model parameters from a file |
abstract double |
predict(int user_id,
int item_id)
Predict the rating or score for a given user-item combination. |
abstract void |
saveModel(java.lang.String filename)
Save the model parameters to a file |
void |
setMaxRating(double max_rating)
Set the max rating value. |
void |
setMinRating(double min_rating)
Set the min rating value. |
void |
setRatings(IRatings ratings)
|
java.lang.String |
toString()
Return a string representation of the recommender |
abstract void |
train()
Learn the model parameters of the recommender from the training data |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public int maxUserID
public int maxItemID
public double maxRating
public double minRating
protected IRatings ratings
Constructor Detail |
---|
public RatingPredictor()
Method Detail |
---|
public double getMaxRating()
IRatingPredictor
getMaxRating
in interface IRatingPredictor
public void setMaxRating(double max_rating)
IRatingPredictor
setMaxRating
in interface IRatingPredictor
public double getMinRating()
IRatingPredictor
getMinRating
in interface IRatingPredictor
public void setMinRating(double min_rating)
IRatingPredictor
setMinRating
in interface IRatingPredictor
public IRatings getRatings()
public void setRatings(IRatings ratings)
public RatingPredictor clone() throws java.lang.CloneNotSupportedException
clone
in class java.lang.Object
java.lang.CloneNotSupportedException
public abstract double predict(int user_id, int item_id)
IRecommender
predict
in interface IRecommender
user_id
- the user IDitem_id
- the item ID
public abstract void train()
IRecommender
train
in interface IRecommender
public abstract void saveModel(java.lang.String filename) throws java.io.IOException
IRecommender
saveModel
in interface IRecommender
filename
- the file to write to
java.io.IOException
public abstract void loadModel(java.lang.String filename) throws java.io.IOException
IRecommender
loadModel
in interface IRecommender
filename
- the file to read from
java.io.IOException
public boolean canPredict(int user_id, int item_id)
IRecommender
canPredict
in interface IRecommender
user_id
- the user IDitem_id
- the item ID
public java.lang.String toString()
IRecommender
toString
in interface IRecommender
toString
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |