|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface IFeatureVector<T>
| Field Summary | |
|---|---|
static HashMapPool |
HASH_MAP_POOL
|
| Method Summary | |
|---|---|
int |
commonDimensions(IFeatureVector<T> v)
Returns the number of common elements in this vector and the passed in vector |
double |
dot(IFeatureVector<T> v)
Calculates the dot product of this vector with another vector. |
double |
dotSimplex(IFeatureVector<T> v)
Returns the dot product of this vector and the simplex of the passed in vector. You can the average value of all the elements in this vector which are common to both by dividing this result by the commonDimensions. |
java.util.Set<T> |
elements()
The set of elements which have some value associated with them in this FeatureVector. By convention, this set is not backed by the FeatureVector so it may be modified without consequence. Other implementations should try to follow this convention as well. |
double |
get(T term)
|
java.util.Map<T,java.lang.Double> |
map()
A reference to the underlying Map backing this vector |
double |
max()
Returns the value in the vector with the largest magnitude. |
double |
norm()
Calculates the Euclidean norm/length of this vector. |
IFeatureVector<T> |
simplex()
Creates a new vector with the same elements as this vector, setting all the values to 1. |
IFeatureVector<T> |
unit()
Creates a new vector equivalent to this.clamp(1). |
java.util.Set<java.lang.Double> |
values()
The set of values which have some element associated with them in this FeatureVector. By convention, this set is not backed by the FeatureVector so it may be modified without consequence. Other implementations should try to follow this convention as well. |
| Field Detail |
|---|
static final HashMapPool HASH_MAP_POOL
| Method Detail |
|---|
double get(T term)
term -
double dot(IFeatureVector<T> v)
v - Vector to dot this Vector with.double norm()
double max()
java.util.Set<T> elements()
java.util.Set<java.lang.Double> values()
java.util.Map<T,java.lang.Double> map()
IFeatureVector<T> unit()
IFeatureVector<T> simplex()
double dotSimplex(IFeatureVector<T> v)
v - vector to simplex and dot with this vector
int commonDimensions(IFeatureVector<T> v)
v -
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||