public class WeightedDataset<L,F> extends Dataset<L,F>
| Modifier and Type | Field and Description |
|---|---|
protected float[] |
weights |
data, featureIndex, labelIndex, labels, size| Constructor and Description |
|---|
WeightedDataset() |
WeightedDataset(Index<L> labelIndex,
int[] labels,
Index<F> featureIndex,
int[][] data,
int size,
float[] weights) |
WeightedDataset(int initSize) |
| Modifier and Type | Method and Description |
|---|---|
void |
add(java.util.Collection<F> features,
L label) |
void |
add(java.util.Collection<F> features,
L label,
float weight) |
void |
add(Datum<L,F> d) |
void |
add(Datum<L,F> d,
float weight) |
protected void |
ensureSize() |
float[] |
getFeatureCounts()
Get the total count (over all data instances) of each feature
|
float[] |
getWeights() |
void |
randomize(int randomSeed)
Randomizes the data array in place
Needs to be redefined here because we need to randomize the weights as well
|
add, add, addFeatureIndices, addFeatures, addFeatures, addLabel, addLabelIndex, applyFeatureCountThreshold, changeFeatureIndex, changeLabelIndex, getDatum, getFeatureCounter, getInformationGains, getL1NormalizedTFIDFDataset, getL1NormalizedTFIDFDatum, getRandomSubDataset, getRVFDatum, getValuesArray, initialize, printFullFeatureMatrix, printSparseFeatureMatrix, printSparseFeatureMatrix, printSVMLightFormat, readSVMLightFormat, readSVMLightFormat, readSVMLightFormat, readSVMLightFormat, selectFeatures, selectFeaturesBinaryInformationGain, split, split, summaryStatistics, svmLightLineToDatum, toString, toSummaryStatistics, toSummaryString, updateLabelsaddAll, applyFeatureCountThreshold, applyFeatureMaxCountThreshold, clear, clear, featureIndex, getDataArray, getLabelsArray, iterator, labelIndex, labelIterator, makeSvmLabelMap, mapDataset, mapDataset, mapDatum, numClasses, numDatumsPerLabel, numFeatures, numFeatureTokens, numFeatureTypes, printSVMLightFormat, printSVMLightFormat, sampleDataset, size, splitOutFold, trimData, trimLabels, trimToSize, trimToSize, trimToSizepublic WeightedDataset(Index<L> labelIndex, int[] labels, Index<F> featureIndex, int[][] data, int size, float[] weights)
public WeightedDataset()
public WeightedDataset(int initSize)
public float[] getWeights()
public float[] getFeatureCounts()
GeneralDatasetgetFeatureCounts in class GeneralDataset<L,F>protected void ensureSize()
ensureSize in class Dataset<L,F>public void randomize(int randomSeed)
randomize in class GeneralDataset<L,F>