|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.aliasi.features.FeatureExtractorFilter<E>
com.aliasi.features.LengthNormFeatureExtractor<E>
E - The type of object whose features are extractedpublic class LengthNormFeatureExtractor<E>
A LengthNormFeatureExtractor converts feature vectors
produced by a contained extractor into unit length vectors.
Length is defined as the (Euclidean or L2) distance from the origin, which is given by:
length(map) = sqrt(&Sigma{v in map.values()} v * v)
If the length is non-zero, a new map is created in which all values
are divided by the length, so that the returned value has unit
length (length = 1). If the length is zero, the feature vector
extracted by the contained feature extractor is returned as is.
Serialization
A length-norm feature extractor is serializable if its contained base extractor is serializable.
| Constructor Summary | |
|---|---|
LengthNormFeatureExtractor(FeatureExtractor<? super E> extractor)
Construct a length-normalized feature extractor from the specified extractor. |
|
| Method Summary | |
|---|---|
Map<String,? extends Number> |
features(E in)
Return a length-normalized feature version of the feature vector returned by the contained vector. |
| Methods inherited from class com.aliasi.features.FeatureExtractorFilter |
|---|
baseExtractor |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public LengthNormFeatureExtractor(FeatureExtractor<? super E> extractor)
extractor - Base feature extractor.| Method Detail |
|---|
public Map<String,? extends Number> features(E in)
features in interface FeatureExtractor<E>features in class FeatureExtractorFilter<E>in - Input to be converted to a feature vector.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||