edu.cmu.minorthird.classify.transform
Class AugmentedInstance

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

public class AugmentedInstance
extends java.lang.Object
implements Instance

Add some features to an instance.

Author:
William Cohen

Nested Class Summary
 class AugmentedInstance.MyIterator
           
 
Constructor Summary
AugmentedInstance(Instance instance, java.lang.String[] newFeatureNames, double[] newVals)
           
 
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.
static void main(java.lang.String[] argv)
           
 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

AugmentedInstance

public AugmentedInstance(Instance instance,
                         java.lang.String[] newFeatureNames,
                         double[] newVals)
Method Detail

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

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

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

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

main

public static void main(java.lang.String[] argv)