|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.sun.labs.minion.classification.KFoldSplitter
public class KFoldSplitter
Provides a K-fold splitter. The results are divided up into K equal sized subsets. At each of K iterations, one subset is withheld from the training set to be the validation set.
| Nested Class Summary | |
|---|---|
class |
KFoldSplitter.Doc
|
| Field Summary | |
|---|---|
protected KFoldSplitter.Doc[][] |
allDocs
All the docs, paired with the array group each comes from |
int |
currFold
The current fold when iterating |
int |
foldSize
The number of documents in each fold. |
int |
k
|
protected static java.lang.String |
logTag
The tag for this module. |
protected int |
numArrayGroups
The number of array groups in the result set |
protected ResultSetImpl |
parent
The full results, as passed in |
protected ResultSetImpl |
train
The set that should be trained on |
protected ResultSetImpl |
validate
The set that should be used for validation |
| Constructor Summary | |
|---|---|
KFoldSplitter()
Default constructor. |
|
| Method Summary | |
|---|---|
int |
getMinDocs()
Gets the minimum number of docs needed for this splitter to be useful. |
ResultSetImpl |
getTrainSet()
Gets the first of the two subset |
ResultSetImpl |
getValidateSet()
Gets the second of the two subsets |
void |
init(ResultSetImpl parent,
IndexConfig iC)
Initializes the class. |
boolean |
nextSplit()
Advances to the next split, if there is one. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public int k
public int foldSize
public int currFold
protected ResultSetImpl train
protected ResultSetImpl validate
protected ResultSetImpl parent
protected int numArrayGroups
protected KFoldSplitter.Doc[][] allDocs
protected static java.lang.String logTag
| Constructor Detail |
|---|
public KFoldSplitter()
| Method Detail |
|---|
public void init(ResultSetImpl parent,
IndexConfig iC)
ResultSplitter
init in interface ResultSplitterparent - the result set to split upiC - the index config, possibly containing relevent settings for this splitterpublic int getMinDocs()
getMinDocs in interface ResultSplitterpublic ResultSetImpl getTrainSet()
getTrainSet in interface ResultSplitterpublic ResultSetImpl getValidateSet()
getValidateSet in interface ResultSplitterpublic boolean nextSplit()
nextSplit in interface ResultSplitter
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||