|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectprea.data.splitter.DataSplitManager
public abstract class DataSplitManager
This class implements data split functions, which are common in individual model selection methods.
Field Summary | |
---|---|
protected int |
itemCount
The number of items. |
protected static SparseVector |
itemRateAverage
Average of ratings for each item. |
static int |
K_FOLD_CROSS_VALIDATION
Evaluation with K-fold cross-validation. |
int |
maxValue
Maximum value of rating, existing in the dataset. |
int |
minValue
Minimum value of rating, existing in the dataset. |
static int |
PREDEFINED_SPLIT
Use predefined split file. |
protected SparseMatrix |
rateMatrix
Rating matrix for each user (row) and item (column) |
static int |
SIMPLE_SPLIT
Randomly split train/test set. |
protected SparseMatrix |
testMatrix
Rating matrix for test items. |
protected int |
userCount
The number of users. |
protected static SparseVector |
userRateAverage
Average of ratings for each user. |
Constructor Summary | |
---|---|
DataSplitManager(SparseMatrix originalMatrix,
int max,
int min)
Construct a data set manager. |
Method Summary | |
---|---|
protected void |
calculateAverage(double defaultValue)
Calculate average of ratings for each user and each item. |
SparseVector |
getItemRateAverage()
Getter method for average of each item's rating. |
SparseMatrix |
getTestMatrix()
Getter method for rating matrix with test data. |
SparseVector |
getUserRateAverage()
Getter method for average of each user's rating. |
protected void |
recoverTestItems()
Items in testMatrix are moved back to original rateMatrix. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int SIMPLE_SPLIT
public static final int PREDEFINED_SPLIT
public static final int K_FOLD_CROSS_VALIDATION
protected SparseMatrix rateMatrix
protected SparseMatrix testMatrix
protected int userCount
protected int itemCount
public int maxValue
public int minValue
protected static SparseVector userRateAverage
protected static SparseVector itemRateAverage
Constructor Detail |
---|
public DataSplitManager(SparseMatrix originalMatrix, int max, int min)
Method Detail |
---|
protected void recoverTestItems()
protected void calculateAverage(double defaultValue)
public SparseMatrix getTestMatrix()
public SparseVector getUserRateAverage()
public SparseVector getItemRateAverage()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |