E - The type of object whose features are extractedpublic class LengthNormFeatureExtractor<E> extends FeatureExtractorFilter<E> implements Serializable
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 and Description |
|---|
LengthNormFeatureExtractor(FeatureExtractor<? super E> extractor)
Construct a length-normalized feature extractor from the
specified extractor.
|
| Modifier and Type | Method and Description |
|---|---|
Map<String,? extends Number> |
features(E in)
Return a length-normalized feature version of the
feature vector returned by the contained vector.
|
baseExtractorpublic LengthNormFeatureExtractor(FeatureExtractor<? super E> extractor)
extractor - Base feature extractor.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.Copyright © 2016 Alias-i, Inc.. All rights reserved.