csli.util.classify.berkeley
Class FeatureSet

java.lang.Object
  extended by csli.util.classify.berkeley.FeatureSet
All Implemented Interfaces:
Serializable

public class FeatureSet
extends Object
implements Serializable

A data structure for storing feature/value pairs for an example.

Version:
$Id: FeatureSet.java,v 1.3 2006/10/25 22:19:01 niekrasz Exp $
Author:
Heloise Hse (hwawen@eecs.berkeley.edu)
See Also:
Serialized Form

Constructor Summary
FeatureSet()
           
 
Method Summary
 void addFeature(long i, double val)
          Adds a feature/value pair to the set.
 long[] getIds()
           
 double[] getValues()
           
 long maxFeatureId()
           
 int numFeatures()
          Gets the number of features in the set
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FeatureSet

public FeatureSet()
Method Detail

getIds

public long[] getIds()
Returns:
An array of feature ID numbers.

getValues

public double[] getValues()
Returns:
An array of feature values.

addFeature

public void addFeature(long i,
                       double val)
Adds a feature/value pair to the set.

Parameters:
i - The feature ID.
val - The feature value.

numFeatures

public int numFeatures()
Gets the number of features in the set

Returns:
The number of features in the set.

maxFeatureId

public long maxFeatureId()
Returns:
The maximum feature ID number in the set.