|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object edu.cmu.minorthird.classify.DatasetIndex
public class DatasetIndex
An inverted index, mapping features to examples which contain the features.
Constructor Summary | |
---|---|
DatasetIndex()
|
|
DatasetIndex(Dataset data)
Construct an index of a dataset. |
Method Summary | |
---|---|
void |
addExample(Example e)
Add a single example to the index. |
double |
averageFeaturesPerExample()
Average number of non-zero feature values in examples. |
protected java.util.List<Example> |
classIndex(java.lang.String label)
|
protected java.util.List<Example> |
featureIndex(Feature f)
|
java.util.Iterator<Feature> |
featureIterator()
Iterate over all features indexed. |
Example |
getExample(Feature f,
int i)
Get i-th example containing feature f. |
Example |
getExample(java.lang.String label,
int i)
Get i-th example with given class label. |
java.util.Iterator<Example> |
getNeighbors(Instance instance)
Get all examples with a feature in common with the given instance. |
static void |
main(java.lang.String[] args)
|
int |
numberOfFeatures()
Number of features indexed. |
int |
size(Feature f)
Number of examples containing non-zero values for feature f. |
int |
size(java.lang.String label)
Number of examples with the given class label. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public DatasetIndex()
public DatasetIndex(Dataset data)
Method Detail |
---|
public void addExample(Example e)
public java.util.Iterator<Feature> featureIterator()
public int size(Feature f)
public int size(java.lang.String label)
public Example getExample(Feature f, int i)
public Example getExample(java.lang.String label, int i)
public java.util.Iterator<Example> getNeighbors(Instance instance)
public int numberOfFeatures()
public double averageFeaturesPerExample()
protected java.util.List<Example> featureIndex(Feature f)
protected java.util.List<Example> classIndex(java.lang.String label)
public java.lang.String toString()
toString
in class java.lang.Object
public static void main(java.lang.String[] args)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |