edu.cmu.minorthird.classify.sequential
Class HyperplaneInstance

java.lang.Object
  extended by edu.cmu.minorthird.classify.sequential.HyperplaneInstance
All Implemented Interfaces:
HasSubpopulationId, Instance, Visible

public class HyperplaneInstance
extends java.lang.Object
implements Instance

Wrap a hyperplane to that it supports the Instance interface.


Constructor Summary
HyperplaneInstance(Hyperplane hyperplane, java.lang.String subpopulationId, java.lang.Object source)
           
 
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()
           
 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
 Viewer toGUI()
          Create a view of this object
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HyperplaneInstance

public HyperplaneInstance(Hyperplane hyperplane,
                          java.lang.String subpopulationId,
                          java.lang.Object source)
Method Detail

toGUI

public Viewer toGUI()
Description copied from interface: Visible
Create a view of this object

Specified by:
toGUI in interface Visible

getWeight

public double getWeight(Feature f)
Description copied from interface: Instance
Get the weight assigned to a feature in this instance.

Specified by:
getWeight in interface Instance

binaryFeatureIterator

public java.util.Iterator<Feature> binaryFeatureIterator()
Description copied from interface: Instance
Return an iterator over all binary features.

Specified by:
binaryFeatureIterator in interface Instance

numericFeatureIterator

public java.util.Iterator<Feature> numericFeatureIterator()
Description copied from interface: Instance
Return an iterator over all numeric features.

Specified by:
numericFeatureIterator in interface Instance

featureIterator

public java.util.Iterator<Feature> featureIterator()
Description copied from interface: Instance
Return an iterator over all features

Specified by:
featureIterator in interface Instance

numFeatures

public int numFeatures()
Description copied from interface: Instance
Return the number of all the features

Specified by:
numFeatures in interface Instance

getWeight

public double getWeight()

getSource

public java.lang.Object getSource()
Description copied from interface: Instance
Get the underlying object used that this instance describes

Specified by:
getSource in interface Instance

getSubpopulationId

public java.lang.String getSubpopulationId()
Description copied from interface: Instance
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
Specified by:
getSubpopulationId in interface Instance