edu.cmu.minorthird.classify
Class BasicFeatureIndex
java.lang.Object
edu.cmu.minorthird.classify.DatasetIndex
edu.cmu.minorthird.classify.BasicFeatureIndex
- All Implemented Interfaces:
- FeatureIndex, java.io.Serializable
public class BasicFeatureIndex
- extends DatasetIndex
- implements FeatureIndex
- Author:
- Edoardo Airoldi
Date: Nov 24, 2003
- See Also:
- Serialized Form
Method Summary |
double |
getCounts(Feature f,
int i)
Get counts of feature f in i-th example containing feature f |
double |
getCounts(Feature f,
java.lang.String label)
Get counts of feature f in examples with label l |
double |
getDocCounts(Feature f,
java.lang.String label)
Get number of documents which contain feature f with label l |
static void |
main(java.lang.String[] args)
|
int |
size(Feature f,
java.lang.String label)
Number of examples with label l containing non-zero values for feature f. |
java.lang.String |
toString()
|
Methods inherited from class edu.cmu.minorthird.classify.DatasetIndex |
addExample, averageFeaturesPerExample, classIndex, featureIndex, featureIterator, getExample, getExample, getNeighbors, numberOfFeatures, size, size |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
BasicFeatureIndex
public BasicFeatureIndex()
BasicFeatureIndex
public BasicFeatureIndex(Dataset data)
size
public int size(Feature f,
java.lang.String label)
- Number of examples with label l containing non-zero values for feature f.
getCounts
public double getCounts(Feature f,
int i)
- Get counts of feature f in i-th example containing feature f
- Specified by:
getCounts
in interface FeatureIndex
getCounts
public double getCounts(Feature f,
java.lang.String label)
- Get counts of feature f in examples with label l
getDocCounts
public double getDocCounts(Feature f,
java.lang.String label)
- Get number of documents which contain feature f with label l
toString
public java.lang.String toString()
- Overrides:
toString
in class DatasetIndex
main
public static void main(java.lang.String[] args)