|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.stanford.nlp.classify.GeneralDataset
edu.stanford.nlp.classify.RVFDataset
public class RVFDataset
An interfacing class for ClassifierFactory
that incrementally
builds a more memory-efficent representation of a List
of
RVFDatum
objects for the purposes of training a Classifier
with a ClassifierFactory
.
Field Summary |
---|
Fields inherited from class edu.stanford.nlp.classify.GeneralDataset |
---|
data, featureIndex, labelIndex, labels, size |
Constructor Summary | |
---|---|
RVFDataset()
|
|
RVFDataset(Index labelIndex,
int[] labels,
Index featureIndex,
int[][] data,
double[][] values)
Constructor that fully specifies a Dataset. |
|
RVFDataset(int numDatums)
|
|
RVFDataset(int numDatums,
Index featureIndex,
Index labelIndex)
|
Method Summary | |
---|---|
void |
add(Datum d)
|
void |
add(Datum d,
String src,
String id)
|
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. |
RVFDatum |
getRVFDatum(int index)
|
String |
getRVFDatumId(int index)
|
String |
getRVFDatumSource(int index)
|
double[][] |
getValuesArray()
|
protected 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 |
static void |
main(String[] args)
|
void |
printFullFeatureMatrix(PrintWriter pw)
prints the full feature matrix in tab-delimited form. |
void |
printFullFeatureMatrixWithValues(PrintWriter pw)
Modification of printFullFeatureMatrix to correct bugs & print values (Rajat). |
void |
printSparseFeatureMatrix()
prints the sparse feature matrix using printSparseFeatureMatrix()
to System.out . |
void |
printSparseFeatureMatrix(PrintWriter pw)
prints a sparse feature matrix representation of the Dataset. |
static RVFDataset |
readSVMLightFormat(String filename)
Constructs a Dataset by reading in a file in SVM light format. |
static RVFDataset |
readSVMLightFormat(String filename,
Index featureIndex,
Index labelIndex)
Constructs a Dataset by reading in a file in SVM light format. |
static RVFDataset |
readSVMLightFormat(String filename,
List<String> lines)
Constructs a Dataset by reading in a file in SVM light format. |
Pair<GeneralDataset,GeneralDataset> |
split(double percentDev)
|
Pair<GeneralDataset,GeneralDataset> |
split(int start,
int end)
|
void |
summaryStatistics()
Prints some summary statistics to stderr for the Dataset. |
static RVFDatum |
svmLightLineToRVFDatum(String l)
|
String |
toString()
|
String |
toSummaryString()
|
Methods inherited from class edu.stanford.nlp.classify.GeneralDataset |
---|
addAll, applyFeatureCountThreshold, featureIndex, getDataArray, getFeatureCounts, getLabelsArray, labelIndex, labelIterator, numClasses, numFeatures, numFeatureTokens, numFeatureTypes, printSVMLightFormat, printSVMLightFormat, size, trimData, trimLabels, trimToSize, trimToSize, trimToSize |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public RVFDataset()
public RVFDataset(int numDatums, Index featureIndex, Index labelIndex)
public RVFDataset(int numDatums)
public RVFDataset(Index labelIndex, int[] labels, Index featureIndex, int[][] data, double[][] values)
Method Detail |
---|
public Pair<GeneralDataset,GeneralDataset> split(double percentDev)
split
in class GeneralDataset
public Pair<GeneralDataset,GeneralDataset> split(int start, int end)
split
in class GeneralDataset
public void add(Datum d)
add
in class GeneralDataset
public void add(Datum d, String src, String id)
public RVFDatum getRVFDatum(int index)
getRVFDatum
in class GeneralDataset
index
-
public String getRVFDatumSource(int index)
public String getRVFDatumId(int index)
public void clear()
clear
in class GeneralDataset
public void clear(int numDatums)
clear
in class GeneralDataset
numDatums
- initial capacity of datasetprotected void initialize(int numDatums)
GeneralDataset
initialize
in class GeneralDataset
numDatums
- initial capacity of datasetpublic void summaryStatistics()
summaryStatistics
in class GeneralDataset
public void printFullFeatureMatrix(PrintWriter pw)
public void printFullFeatureMatrixWithValues(PrintWriter pw)
public static RVFDataset readSVMLightFormat(String filename)
public static RVFDataset readSVMLightFormat(String filename, List<String> lines)
public static RVFDataset readSVMLightFormat(String filename, Index featureIndex, Index labelIndex)
public static RVFDatum svmLightLineToRVFDatum(String l)
public void printSparseFeatureMatrix()
printSparseFeatureMatrix()
to System.out
.
public void printSparseFeatureMatrix(PrintWriter pw)
Object.toString()
representations of features.
public static void main(String[] args)
public double[][] getValuesArray()
getValuesArray
in class GeneralDataset
public String toString()
toString
in class Object
public String toSummaryString()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |