edu.stanford.nlp.classify
Class WeightedDataset

java.lang.Object
  extended by edu.stanford.nlp.classify.GeneralDataset
      extended by edu.stanford.nlp.classify.Dataset
          extended by edu.stanford.nlp.classify.WeightedDataset

public class WeightedDataset
extends Dataset

Author:
Galen Andrew

Field Summary
protected  float[] weights
           
 
Fields inherited from class edu.stanford.nlp.classify.GeneralDataset
data, featureIndex, labelIndex, labels, size
 
Constructor Summary
WeightedDataset()
           
WeightedDataset(Index labelIndex, int[] labels, Index featureIndex, int[][] data, int size, float[] weights)
           
WeightedDataset(int initSize)
           
 
Method Summary
 void add(Collection features, Object label)
           
 void add(Collection features, Object label, float weight)
           
 void add(Datum d)
           
 void add(Datum d, float weight)
           
protected  void ensureSize()
           
protected  float[] getFeatureCounts()
          Get the total count (over all data instances) of each feature
 float[] getWeights()
           
 
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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

weights

protected float[] weights
Constructor Detail

WeightedDataset

public WeightedDataset(Index labelIndex,
                       int[] labels,
                       Index featureIndex,
                       int[][] data,
                       int size,
                       float[] weights)

WeightedDataset

public WeightedDataset()

WeightedDataset

public WeightedDataset(int initSize)
Method Detail

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