|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.stanford.nlp.classify.GeneralDataset
public abstract class GeneralDataset
The purpose of this interface is to unify Dataset
and RVFDataset
.
Field Summary | |
---|---|
protected int[][] |
data
|
Index<Object> |
featureIndex
|
Index<Object> |
labelIndex
|
protected int[] |
labels
|
protected int |
size
|
Constructor Summary | |
---|---|
GeneralDataset()
|
Method Summary | |
---|---|
abstract void |
add(Datum d)
|
void |
addAll(Collection<Datum> data)
Adds all Datums in the given collection of data to this dataset |
void |
applyFeatureCountThreshold(int k)
Applies a feature count threshold to the Dataset. |
void |
clear()
Resets the Dataset so that it is empty and ready to collect data. |
void |
clear(int numDatums)
Resets the Dataset so that it is empty and ready to collect data. |
Index |
featureIndex()
|
int[][] |
getDataArray()
|
protected float[] |
getFeatureCounts()
Get the total count (over all data instances) of each feature |
int[] |
getLabelsArray()
|
abstract RVFDatum |
getRVFDatum(int index)
|
abstract double[][] |
getValuesArray()
|
protected abstract void |
initialize(int numDatums)
This method takes care of resetting values of the dataset such that it is empty with an initial capacity of numDatums Should be accessed only by appropriate methods within the class, such as clear(), which take care of other parts of the emptying of data |
Index |
labelIndex()
|
Iterator |
labelIterator()
Returns an iterator over the class labels of the Dataset |
int |
numClasses()
|
int |
numFeatures()
|
int |
numFeatureTokens()
returns the number of feature tokens in the Dataset. |
int |
numFeatureTypes()
returns the number of distinct feature types in the Dataset. |
void |
printSVMLightFormat()
Dumps the Dataset as a training/test file for SVMLight. |
void |
printSVMLightFormat(PrintWriter pw)
Print SVM Light Format file. |
int |
size()
Returns the number of examples ( Datum s) in the Dataset. |
abstract Pair<GeneralDataset,GeneralDataset> |
split(double p)
|
abstract Pair<GeneralDataset,GeneralDataset> |
split(int start,
int end)
|
abstract void |
summaryStatistics()
Print some statistics summarizing the dataset |
protected void |
trimData()
|
protected void |
trimLabels()
|
protected double[][] |
trimToSize(double[][] i)
|
protected int[] |
trimToSize(int[] i)
|
protected int[][] |
trimToSize(int[][] i)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public Index<Object> labelIndex
public Index<Object> featureIndex
protected int[] labels
protected int[][] data
protected int size
Constructor Detail |
---|
public GeneralDataset()
Method Detail |
---|
public Index labelIndex()
public Index featureIndex()
public int numFeatures()
public int numClasses()
public int[] getLabelsArray()
public int[][] getDataArray()
public abstract double[][] getValuesArray()
public void clear()
public void clear(int numDatums)
numDatums
- initial capacity of datasetprotected abstract void initialize(int numDatums)
numDatums
- initial capacity of datasetpublic abstract RVFDatum getRVFDatum(int index)
public abstract void add(Datum d)
protected float[] getFeatureCounts()
public void applyFeatureCountThreshold(int k)
public int numFeatureTokens()
public int numFeatureTypes()
public void addAll(Collection<Datum> data)
data
- collection of datums you would like to add to the datasetpublic abstract Pair<GeneralDataset,GeneralDataset> split(int start, int end)
public abstract Pair<GeneralDataset,GeneralDataset> split(double p)
public int size()
Datum
s) in the Dataset.
protected void trimData()
protected void trimLabels()
protected int[] trimToSize(int[] i)
protected int[][] trimToSize(int[][] i)
protected double[][] trimToSize(double[][] i)
public abstract void summaryStatistics()
public Iterator labelIterator()
public void printSVMLightFormat()
public void printSVMLightFormat(PrintWriter pw)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |