|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.mahout.classifier.df.data.Data
public class Data
Holds a list of vectors and their corresponding Dataset. contains various operations that deals with the vectors (subset, count,...)
Constructor Summary | |
---|---|
Data(Dataset dataset)
|
|
Data(Dataset dataset,
List<Instance> instances)
|
Method Summary | |
---|---|
Data |
bagging(Random rng)
if data has N cases, sample N cases at random -but with replacement. |
Data |
bagging(Random rng,
boolean[] sampled)
if data has N cases, sample N cases at random -but with replacement. |
Data |
clone()
|
boolean |
contains(Instance v)
|
void |
countLabels(int[] counts)
Counts the number of occurrences of each label value This method can be used when the criterion variable is the categorical attribute. |
boolean |
equals(Object obj)
|
double[] |
extractLabels()
extract the labels of all instances |
Instance |
get(int index)
Returns the element at the specified position |
Dataset |
getDataset()
|
int |
hashCode()
|
boolean |
identicalLabel()
checks if all the vectors have identical label values |
boolean |
isEmpty()
|
boolean |
isIdentical()
checks if all the vectors have identical attribute values |
int |
majorityLabel(Random rng)
finds the majority label, breaking ties randomly This method can be used when the criterion variable is the categorical attribute. |
Data |
rsplit(Random rng,
int subsize)
Splits the data in two, returns one part, and this gets the rest of the data. |
int |
size()
|
Data |
subset(Condition condition)
|
double[] |
values(int attr)
finds all distinct values of a given attribute |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Data(Dataset dataset)
public Data(Dataset dataset, List<Instance> instances)
Method Detail |
---|
public int size()
public boolean isEmpty()
public boolean contains(Instance v)
v
- element whose presence in this list if to be searched
public Instance get(int index)
index
- index of element to return
IndexOutOfBoundsException
- if the index is out of rangepublic Data subset(Condition condition)
public Data bagging(Random rng)
public Data bagging(Random rng, boolean[] sampled)
sampled
- indicating which instance has been sampled
public Data rsplit(Random rng, int subsize)
public boolean isIdentical()
public boolean identicalLabel()
public double[] values(int attr)
public Data clone()
clone
in class Object
public boolean equals(Object obj)
equals
in class Object
public int hashCode()
hashCode
in class Object
public double[] extractLabels()
public int majorityLabel(Random rng)
public void countLabels(int[] counts)
counts
- will contain the results, supposed to be initialized at 0public Dataset getDataset()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |