|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectprea.data.splitter.DataSplitManager
prea.data.splitter.KfoldCrossValidation
public class KfoldCrossValidation
This class implements K-fold cross-validation.
| Field Summary | |
|---|---|
private SparseMatrix |
assign
|
private int |
foldCount
|
| Fields inherited from class prea.data.splitter.DataSplitManager |
|---|
itemCount, itemRateAverage, K_FOLD_CROSS_VALIDATION, maxValue, minValue, PREDEFINED_SPLIT, rateMatrix, SIMPLE_SPLIT, testMatrix, userCount, userRateAverage |
| Constructor Summary | |
|---|---|
KfoldCrossValidation(SparseMatrix originalMatrix,
int k,
int max,
int min)
Construct an instance for K-fold cross-validation. |
|
| Method Summary | |
|---|---|
private void |
divideFolds(int k)
Divide the original rating matrix into k-fold. |
SparseMatrix |
getKthFold(int k)
Return the k-th fold as test set (testMatrix), making all the others as train set in rateMatrix. |
| Methods inherited from class prea.data.splitter.DataSplitManager |
|---|
calculateAverage, getItemRateAverage, getTestMatrix, getUserRateAverage, recoverTestItems |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private SparseMatrix assign
private int foldCount
| Constructor Detail |
|---|
public KfoldCrossValidation(SparseMatrix originalMatrix,
int k,
int max,
int min)
| Method Detail |
|---|
private void divideFolds(int k)
k - The index for desired fold.public SparseMatrix getKthFold(int k)
k - The index for desired fold.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||