|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnetkit.classifiers.DataSampler
public final class DataSampler
Field Summary | |
---|---|
int |
clsIdx
|
Constructor Summary | |
---|---|
DataSampler(Node[] nodes,
int attribIdx)
|
|
DataSampler(Node[] nodes,
int attribIdx,
long seed)
|
|
DataSampler(Node[] nodes,
int attribIdx,
long seed,
boolean replacement,
boolean stratified,
boolean sampleUnknown)
|
Method Summary | |
---|---|
static Graph |
buildGraph()
|
DataSampler |
clone()
|
Node[][][] |
crossValidate(int numSplits)
Create full cross-validation node sets in the form result[numsplit][0][...]
is the training set for split numsplit and result[numsplit][1][...]
is the test set for split numsplit . |
boolean |
doReplacement()
|
boolean |
doStratified()
|
double[] |
getDistribution()
|
static void |
main(java.lang.String[] args)
|
int |
numMissingValues()
|
Node[][] |
sample(int... sizes)
Sample sets of the given size from the underlying distribution of nodes and return them in a a list of lists. |
Node[] |
sample(int size)
Sample the given number of nodes and return a new array filled with the samples. |
void |
sample(Node[]... result)
Fill the given list of arrays with sample nodes, ensuring that there is no overlap between nodes sampled in each of the sub-arrays (unless you are sampling with replacement). |
void |
sample(Node[] result)
Fill the array with sampled data |
boolean |
sampleUnknown()
|
int |
size()
|
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public final int clsIdx
Constructor Detail |
---|
public DataSampler(Node[] nodes, int attribIdx)
public DataSampler(Node[] nodes, int attribIdx, long seed)
public DataSampler(Node[] nodes, int attribIdx, long seed, boolean replacement, boolean stratified, boolean sampleUnknown)
Method Detail |
---|
public DataSampler clone()
clone
in class java.lang.Object
public int numMissingValues()
public int size()
public double[] getDistribution()
public boolean doReplacement()
public boolean sampleUnknown()
public boolean doStratified()
public void sample(Node[] result)
result
- public Node[] sample(int size)
size
-
public Node[][] sample(int... sizes)
NOTE: there is no guarantee of non-overlap if you are sampling with replacement.
sizes
- The sizes of the lists to sample
public void sample(Node[]... result)
NOTE: there is no guarantee of non-overlap if you are sampling with replacement.
result
- public Node[][][] crossValidate(int numSplits)
result[numsplit][0][...]
is the training set for split numsplit
and result[numsplit][1][...]
is the test set for split numsplit
.
NOTE: there is no guarantee of non-overlap if you are sampling with replacement.
numSplits
-
public java.lang.String toString()
toString
in class java.lang.Object
public static Graph buildGraph()
public static void main(java.lang.String[] args)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |