|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object edu.cmu.minorthird.classify.experiments.WebmasterSplitter<T>
public class WebmasterSplitter<T>
A complicated splitter that stratifies samples according to an arbitrary "profile" property, and restricts train/test splits to not cross boundaries defined by "user" and "request" properties. This will do a random split according to users, then a stratified split according to requests (with the stratification done according to profiles).
Constraints on splitting are defined by a file with
multiple lines of the form
.
where each Id is a String.
msgId userId requestId profileId
The main purpose is of this is to split webmaster data, hence the name.
Constructor Summary | |
---|---|
WebmasterSplitter(java.lang.String constraintFileName,
double fraction,
int folds)
|
Method Summary | |
---|---|
int |
getNumPartitions()
Return the number of partitions produced by the last call to split() |
java.util.Iterator<T> |
getTest(int k)
Return an iterator over the test cases in the k-th split. |
java.util.Iterator<T> |
getTrain(int k)
Return an iterator over the training cases in the k-th split. |
static void |
main(java.lang.String[] args)
|
void |
split(java.util.Iterator<T> it)
Split the iterator into a number of train/test partitions. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public WebmasterSplitter(java.lang.String constraintFileName, double fraction, int folds)
Method Detail |
---|
public void split(java.util.Iterator<T> it)
Splitter
split
in interface Splitter<T>
public int getNumPartitions()
Splitter
getNumPartitions
in interface Splitter<T>
public java.util.Iterator<T> getTrain(int k)
Splitter
getTrain
in interface Splitter<T>
public java.util.Iterator<T> getTest(int k)
Splitter
getTest
in interface Splitter<T>
public java.lang.String toString()
toString
in class java.lang.Object
public static void main(java.lang.String[] args)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |