public abstract class FeatureVector extends Object implements Iterable<FeatureVector.Entry>
| Modifier and Type | Class and Description |
|---|---|
static class |
FeatureVector.Entry |
| Constructor and Description |
|---|
FeatureVector() |
| Modifier and Type | Method and Description |
|---|---|
void |
add(FeatureVector other) |
boolean |
equals(Object o) |
abstract double |
get(int index)
Return the value at index.
|
int |
hashCode() |
double |
innerProduct(FeatureVector other) |
abstract Iterator<FeatureVector.Entry> |
iterator()
Gives an iterator over the non-zero features.
|
double |
l2Norm() |
void |
multiply(double factor) |
abstract void |
set(int index,
double value)
Set the feature at index to value.
|
public FeatureVector()
public void add(FeatureVector other) throws InvalidFeatureVectorValueException
public abstract double get(int index)
index - The indexpublic double innerProduct(FeatureVector other)
public abstract Iterator<FeatureVector.Entry> iterator()
iterator in interface Iterable<FeatureVector.Entry>public double l2Norm()
public void multiply(double factor) throws InvalidFeatureVectorValueException
public abstract void set(int index, double value) throws InvalidFeatureVectorValueException
Copyright © 2014. All rights reserved.