public class BRISMFPredictor extends Object implements Updatable
Parameters:
Modifier and Type | Field and Description |
---|---|
protected RecommenderData |
data |
protected HashMap<Integer,float[]> |
itemFeature |
protected double |
lRate |
protected int |
nFeatures |
protected int |
nIterations |
protected double |
rFactor |
protected Random |
rnd |
protected HashMap<Integer,float[]> |
userFeature |
Constructor and Description |
---|
BRISMFPredictor(int nFeatures,
RecommenderData data,
boolean train) |
BRISMFPredictor(int nFeatures,
RecommenderData data,
double lRate,
double rFactor,
boolean train) |
Modifier and Type | Method and Description |
---|---|
RecommenderData |
getData() |
float[] |
getItemFeatures(int itemID) |
int |
getNumFeatures() |
float[] |
getUserFeatures(int userID) |
double |
predictRating(float[] userFeats,
float[] itemFeats) |
double |
predictRating(int userID,
int itemID) |
List<Double> |
predictRatings(int userID,
List<Integer> itemIDS) |
void |
setLRate(double lRate) |
void |
setNIterations(int nIterations) |
void |
setRFactor(double rFactor) |
void |
train() |
void |
trainItem(int itemID) |
void |
trainItem(int itemID,
int nIts) |
void |
trainItem(int itemID,
List<Integer> usr,
List<Double> rat) |
void |
trainItem(int itemID,
List<Integer> usr,
List<Double> rat,
int nIts) |
float[] |
trainItemFeats(int itemID,
List<Integer> usr,
List<Double> rat,
int nIts) |
void |
trainUser(int userID) |
void |
trainUser(int userID,
int nIts) |
void |
trainUser(int userID,
List<Integer> itm,
List<Double> rat) |
void |
trainUser(int userID,
List<Integer> itm,
List<Double> rat,
int nIts) |
float[] |
trainUserFeats(List<Integer> itm,
List<Double> rat,
int nIts) |
void |
updateNewItem(int itemID,
List<Integer> ratingUsers,
List<Double> ratings) |
void |
updateNewUser(int userID,
List<Integer> ratedItems,
List<Double> ratings) |
void |
updateRemoveItem(int itemID) |
void |
updateRemoveRating(int userID,
int itemID) |
void |
updateRemoveUser(int userID) |
void |
updateSetRating(int userID,
int itemID,
double rating) |
protected RecommenderData data
protected int nFeatures
protected Random rnd
protected double lRate
protected double rFactor
protected int nIterations
public BRISMFPredictor(int nFeatures, RecommenderData data, boolean train)
public BRISMFPredictor(int nFeatures, RecommenderData data, double lRate, double rFactor, boolean train)
public void setLRate(double lRate)
public void setRFactor(double rFactor)
public void setNIterations(int nIterations)
public RecommenderData getData()
public double predictRating(int userID, int itemID)
public double predictRating(float[] userFeats, float[] itemFeats)
public float[] trainItemFeats(int itemID, List<Integer> usr, List<Double> rat, int nIts)
public void trainUser(int userID, int nIts)
public void trainItem(int itemID)
public void trainItem(int itemID, int nIts)
public void trainUser(int userID)
public void train()
public float[] getUserFeatures(int userID)
public float[] getItemFeatures(int itemID)
public int getNumFeatures()
public void updateNewUser(int userID, List<Integer> ratedItems, List<Double> ratings)
updateNewUser
in interface Updatable
public void updateNewItem(int itemID, List<Integer> ratingUsers, List<Double> ratings)
updateNewItem
in interface Updatable
public void updateRemoveUser(int userID)
updateRemoveUser
in interface Updatable
public void updateRemoveItem(int itemID)
updateRemoveItem
in interface Updatable
public void updateSetRating(int userID, int itemID, double rating)
updateSetRating
in interface Updatable
public void updateRemoveRating(int userID, int itemID)
updateRemoveRating
in interface Updatable
Copyright © 2014 University of Waikato, Hamilton, NZ. All Rights Reserved.