edu.stanford.nlp.classify
Class WeightedDataset
java.lang.Object
edu.stanford.nlp.classify.GeneralDataset
edu.stanford.nlp.classify.Dataset
edu.stanford.nlp.classify.WeightedDataset
public class WeightedDataset
- extends Dataset
- Author:
- Galen Andrew
Field Summary |
protected float[] |
weights
|
Methods inherited from class edu.stanford.nlp.classify.Dataset |
addFeatures, addLabel, applyFeatureCountThreshold, changeFeatureIndex, changeLabelIndex, getDatum, getFeatureCounter, getInformationGains, getRandomSubDataset, getRVFDatum, getValuesArray, initialize, main, printFullFeatureMatrix, printSparseFeatureMatrix, printSparseFeatureMatrix, printSVMLightFormat, readSVMLightFormat, readSVMLightFormat, readSVMLightFormat, readSVMLightFormat, selectFeaturesBinaryInformationGain, split, split, summaryStatistics, svmLightLineToDatum, toString, toSummaryStatistics, toSummaryString |
Methods inherited from class edu.stanford.nlp.classify.GeneralDataset |
addAll, applyFeatureCountThreshold, clear, clear, featureIndex, getDataArray, getLabelsArray, labelIndex, labelIterator, numClasses, numFeatures, numFeatureTokens, numFeatureTypes, printSVMLightFormat, printSVMLightFormat, size, trimData, trimLabels, trimToSize, trimToSize, trimToSize |
weights
protected float[] weights
WeightedDataset
public WeightedDataset(Index labelIndex,
int[] labels,
Index featureIndex,
int[][] data,
int size,
float[] weights)
WeightedDataset
public WeightedDataset()
WeightedDataset
public WeightedDataset(int initSize)
getWeights
public float[] getWeights()
getFeatureCounts
protected float[] getFeatureCounts()
- Description copied from class:
GeneralDataset
- Get the total count (over all data instances) of each feature
- Overrides:
getFeatureCounts
in class GeneralDataset
- Returns:
- an array containing the counts (indexed by index)
add
public void add(Datum d)
- Overrides:
add
in class Dataset
add
public void add(Collection features,
Object label)
- Overrides:
add
in class Dataset
add
public void add(Datum d,
float weight)
ensureSize
protected void ensureSize()
- Overrides:
ensureSize
in class Dataset
add
public void add(Collection features,
Object label,
float weight)
Stanford NLP Group