edu.cmu.minorthird.classify.multi
Class InstanceFromPrediction

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

public class InstanceFromPrediction
extends java.lang.Object
implements Instance

An instance that has predicted values from each dimension added as features

Author:
Cameron Williams

Constructor Summary
InstanceFromPrediction(Instance instance, java.lang.String[] previousLabels)
           
 
Method Summary
 Instance asPlainInstance()
          Return the wrapped instance.
 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
 Viewer toGUI()
          Create a view of this object
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

InstanceFromPrediction

public InstanceFromPrediction(Instance instance,
                              java.lang.String[] previousLabels)
Parameters:
instance - - the instance to extend
previousLabels - - element k is the classLabel of the example (k+1) positions before this instance in the sequence.
Method Detail

asPlainInstance

public Instance asPlainInstance()
Return the wrapped instance.


getSource

public final 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 final 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

numericFeatureIterator

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

Specified by:
numericFeatureIterator in interface Instance

binaryFeatureIterator

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

Specified by:
binaryFeatureIterator in interface Instance

featureIterator

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

Specified by:
featureIterator in interface Instance

numFeatures

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

Specified by:
numFeatures in interface Instance

getWeight

public final 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

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

toGUI

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

Specified by:
toGUI in interface Visible