hhreco.classification
Class FeatureSet

java.lang.Object
  extended byhhreco.classification.FeatureSet

public class FeatureSet
extends java.lang.Object

A data structure for storing features of an example; it is basically a typesafe array of doubles with appropriate accessor methods. It is up to the client to maintain consistency between different instances of feature sets, i.e. that they have the same number of elements and that the features at specific indices are referencing the same feature component.


Constructor Summary
FeatureSet(double[] features)
          Create a feature vector with the given vector.
FeatureSet(int num)
          Create a feature vector of size 'num'.
 
Method Summary
 double getFeature(int i)
          Return the i'th feature.
 int getFeatureCount()
          Return the number of features in the vector.
 double[] getFeatures()
          Return the feature vector.
 void setFeature(int i, double val)
          Set the i'th feature to the specified value.
 java.lang.String toString()
          Text representation of the feature vector.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

FeatureSet

public FeatureSet(int num)
Create a feature vector of size 'num'.


FeatureSet

public FeatureSet(double[] features)
Create a feature vector with the given vector.

Method Detail

getFeature

public final double getFeature(int i)
Return the i'th feature.


getFeatureCount

public final int getFeatureCount()
Return the number of features in the vector.


getFeatures

public double[] getFeatures()
Return the feature vector.


setFeature

public final void setFeature(int i,
                             double val)
Set the i'th feature to the specified value.


toString

public java.lang.String toString()
Text representation of the feature vector.