edu.cmu.minorthird.classify
Interface Instance

All Superinterfaces:
HasSubpopulationId, Visible
All Known Implementing Classes:
AbstractInstance, AugmentedInstance, Example, FeatureFactory.CompactInstance, HyperplaneInstance, InstanceFromPrediction, InstanceFromSequence, MaskedInstance, MultiExample, MutableInstance, SGMExample

public interface Instance
extends HasSubpopulationId, Visible

A single instance for a learner. This is basically a weighted set of features.

Author:
William Cohen

Method Summary
 java.util.Iterator<Feature> binaryFeatureIterator()
          Return an iterator over all binary features.
 java.util.Iterator<Feature> featureIterator()
          Return an iterator over all features
 java.lang.Object getSource()
          Get the underlying object used that this instance describes
 java.lang.String getSubpopulationId()
          Get the subpopulation from which this instance was drawn.
 double getWeight(Feature f)
          Get the weight assigned to a feature in this instance.
 java.util.Iterator<Feature> numericFeatureIterator()
          Return an iterator over all numeric features.
 int numFeatures()
          Return the number of all the features
 
Methods inherited from interface edu.cmu.minorthird.util.gui.Visible
toGUI
 

Method Detail

getWeight

double getWeight(Feature f)
Get the weight assigned to a feature in this instance.


binaryFeatureIterator

java.util.Iterator<Feature> binaryFeatureIterator()
Return an iterator over all binary features.


numericFeatureIterator

java.util.Iterator<Feature> numericFeatureIterator()
Return an iterator over all numeric features.


featureIterator

java.util.Iterator<Feature> featureIterator()
Return an iterator over all features


numFeatures

int numFeatures()
Return the number of all the features


getSource

java.lang.Object getSource()
Get the underlying object used that this instance describes


getSubpopulationId

java.lang.String getSubpopulationId()
Get the subpopulation from which this instance was drawn. A null id is considered to be a unique subpopulation---different from every other subpopulation, including other nulls. A subpopulation is a subset of the training data which is expected to contain additional regularities - for instance, pages from the same site, or spans from the same document. Testing routines may use subpopulation's to more correctly spit datasets into train/test subsets.

Specified by:
getSubpopulationId in interface HasSubpopulationId