public class SparseFeatureVector extends FeatureVector
FeatureVector.Entry| Constructor and Description |
|---|
SparseFeatureVector() |
SparseFeatureVector(FeatureVector fv) |
| Modifier and Type | Method and Description |
|---|---|
double |
get(int index)
Return the value at index.
|
double |
innerProduct(FeatureVector other) |
Iterator<FeatureVector.Entry> |
iterator()
Gives an iterator over the non-zero features.
|
void |
set(int index,
double value)
Set the feature at index to value.
|
public SparseFeatureVector()
public SparseFeatureVector(FeatureVector fv) throws InvalidFeatureVectorValueException
public double get(int index)
FeatureVectorget in class FeatureVectorindex - The indexpublic double innerProduct(FeatureVector other)
innerProduct in class FeatureVectorpublic Iterator<FeatureVector.Entry> iterator()
FeatureVectoriterator in interface Iterable<FeatureVector.Entry>iterator in class FeatureVectorpublic void set(int index, double value) throws InvalidFeatureVectorValueException
FeatureVectorset in class FeatureVectorInvalidFeatureVectorValueExceptionCopyright © 2014. All rights reserved.