feature_normalization¶
Module: missions.nodes.postprocessing.feature_normalization
¶
Normalize FeatureVector
Inheritance diagram for pySPACE.missions.nodes.postprocessing.feature_normalization
:
Class Summary¶
InconsistentFeatureVectorsException |
|
FeatureNormalizationNode ([load_path]) |
General node for Feature Normalization |
OutlierFeatureNormalizationNode ([...]) |
Map the feature vectors of the training set to the range [0,1]^n |
GaussianFeatureNormalizationNode (\*\*kwargs) |
Transform the features, such that they have zero mean and variance one |
HistogramFeatureNormalizationNode ([load_path]) |
Transform the features, such that they have zero mean in the main bit in the histogram and variance one on that bit. |
EuclideanFeatureNormalizationNode ([...]) |
Normalize feature vectors to Euclidean norm with respect to dimensions |
InfinityNormFeatureNormalizationNode (\*\*kwargs) |
Normalize feature vectors with infinity norm to [-1,1] |
Classes¶
FeatureNormalizationNode
¶
-
class
pySPACE.missions.nodes.postprocessing.feature_normalization.
FeatureNormalizationNode
(load_path=None, **kwargs)[source]¶ Bases:
pySPACE.missions.nodes.base_node.BaseNode
General node for Feature Normalization
The node should simply shift the data with the translation variable and afterwards scale it with the mult variable.
This transformation can be loaded and stored and given to visualization tools.
When used as a standalone node, loading a transformation is mandatory because the translation and mult variables are otherwise not available.
- Parameter
load_path: An absolute path from which the normalization vectors are loaded. If not specified, these vectors are learned from the training data.
(optional, default: None)
Exemplary Call
- node : FeatureNormalizationNode parameters : load_path: "/Users/mustermann/proj/examples/FN.pickle"
Warning
This base node only works alone, when load_path is specified.
Input: FeatureVector
Output: FeatureVector
Author: Mario Krell (mario.krell@dfki.de)
Created: 2012/03/28
POSSIBLE NODE NAMES: - FeatureNormalizationNode
- FeatureNormalization
POSSIBLE INPUT TYPES: - FeatureVector
Class Components Summary
_execute
(data)Normalizes the feature vector data. _train
(data)Collects the values each feature takes on in the training set. collect_data
(data)extract_feature_names
(data)get_own_transformation
([sample])input_types
is_trainable
()store_state
(result_dir[, index])Stores transformation and feature names in the given directory result_dir -
store_state
(result_dir, index=None)[source]¶ Stores transformation and feature names in the given directory result_dir
-
_execute
(data)[source]¶ Normalizes the feature vector data.
Normalizes the feature vector data by subtracting the translation variable and scaling it with mult.
-
input_types
= ['FeatureVector']¶
OutlierFeatureNormalizationNode
¶
-
class
pySPACE.missions.nodes.postprocessing.feature_normalization.
OutlierFeatureNormalizationNode
(outlier_percentage=0, **kwargs)[source]¶ Bases:
pySPACE.missions.nodes.postprocessing.feature_normalization.FeatureNormalizationNode
Map the feature vectors of the training set to the range [0,1]^n
A class that normalizes each dimension of the feature vector so that an upper boundary value (learned from in the training set) is mapped to 1, and a lower boundary value to 0. All other values are linearly interpolated. Optionally, one can specify an outlier_percentage that determines which ratio of the training data is considered to be a potential outlier. outlier_percentage/2 samples are allowed to be larger than the determined upper boundary, and outlier_percentage/2 samples are allowed to be smaller than the determined lower boundary.
- Parameters
outlier_percentage: The percentage of training instances that are potential outliers.
(optional, default: 0)
Exemplary Call
- node : OutlierFeatureNormalization parameters : outlier_percentage : 10
Author: Jan Hendrik Metzen (jhm@informatik.uni-bremen.de)
Created: ??
Revised (1): 2009/07/16
Revised (2): 2009/09/03
POSSIBLE NODE NAMES: - FN
- Outlier_Feature_Normalization
- Feature_Normalization
- OutlierFeatureNormalizationNode
- O_FN
- OutlierFeatureNormalization
POSSIBLE INPUT TYPES: - FeatureVector
Class Components Summary
__hyperparameters
_stop_training
()Computes the upper and lower boundary for normalization. collect_data
(data)-
_stop_training
()[source]¶ Computes the upper and lower boundary for normalization.
For this computation, the largest and smallest outlier_percentage/2 examples for each feature dimension are ignored. The smallest and largest remaining example are used as lower and upper boundary.
-
__hyperparameters
= set([NoOptimizationParameter<kwargs_warning>, NoOptimizationParameter<dtype>, NoOptimizationParameter<output_dim>, UniformParameter<outlier_percentage>, NoOptimizationParameter<retrain>, NoOptimizationParameter<input_dim>, NoOptimizationParameter<store>])¶
GaussianFeatureNormalizationNode
¶
-
class
pySPACE.missions.nodes.postprocessing.feature_normalization.
GaussianFeatureNormalizationNode
(**kwargs)[source]¶ Bases:
pySPACE.missions.nodes.postprocessing.feature_normalization.FeatureNormalizationNode
Transform the features, such that they have zero mean and variance one
A class that normalizes each dimension of the feature vector so that it has zero mean and variance one. The relevant values are learned from the training set.
Exemplary Call
- node : Gaussian_Feature_Normalization
Author: Mario Krell (Mario.Krell@dfki.de)
Created: 2011/04/15
POSSIBLE NODE NAMES: - GaussianFeatureNormalizationNode
- GaussianFeatureNormalization
- G_FN
- Gaussian_Feature_Normalization
POSSIBLE INPUT TYPES: - FeatureVector
Class Components Summary
_inc_train
(data[, class_label])_stop_training
()Computes mean and std deviation of each feature _train
(data)
HistogramFeatureNormalizationNode
¶
-
class
pySPACE.missions.nodes.postprocessing.feature_normalization.
HistogramFeatureNormalizationNode
(load_path=None, **kwargs)[source]¶ Bases:
pySPACE.missions.nodes.postprocessing.feature_normalization.FeatureNormalizationNode
Transform the features, such that they have zero mean in the main bit in the histogram and variance one on that bit.
The relevant values are learned from the training set.
Exemplary Call
- node : Histogram_Feature_Normalization
Author: Mario Krell (Mario.Krell@dfki.de)
Created: 2011/04/15
POSSIBLE NODE NAMES: - HistogramFeatureNormalization
- HistogramFeatureNormalizationNode
- H_FN
- Histogram_Feature_Normalization
POSSIBLE INPUT TYPES: - FeatureVector
Class Components Summary
_stop_training
()Computes mean and std deviation of each feature
EuclideanFeatureNormalizationNode
¶
-
class
pySPACE.missions.nodes.postprocessing.feature_normalization.
EuclideanFeatureNormalizationNode
(dimension_scale=False, **kwargs)[source]¶ Bases:
pySPACE.missions.nodes.base_node.BaseNode
Normalize feature vectors to Euclidean norm with respect to dimensions
Parameters
dimension_scale: Scale the output to ||x|| * dim(x) (to get bigger values)
(optional, default: False)
Exemplary Call
- node : Euclidean_Feature_Normalization parameters : dimension_scale : True
Author: Mario Krell (Mario.Krell@dfki.de)
Created: 2011/04/15
POSSIBLE NODE NAMES: - Euclidean_Feature_Normalization
- EuclideanFeatureNormalizationNode
- EuclideanFeatureNormalization
- E_FN
POSSIBLE INPUT TYPES: - FeatureVector
Class Components Summary
__hyperparameters
_execute
(data)Normalizes the samples vector to norm one input_types
store_state
(result_dir[, index])Stores this node in the given directory result_dir -
__hyperparameters
= set([BooleanParameter<dimension_scale>, NoOptimizationParameter<kwargs_warning>, NoOptimizationParameter<dtype>, NoOptimizationParameter<output_dim>, NoOptimizationParameter<retrain>, NoOptimizationParameter<input_dim>, NoOptimizationParameter<store>])¶
-
input_types
= ['FeatureVector']¶
InfinityNormFeatureNormalizationNode
¶
-
class
pySPACE.missions.nodes.postprocessing.feature_normalization.
InfinityNormFeatureNormalizationNode
(**kwargs)[source]¶ Bases:
pySPACE.missions.nodes.base_node.BaseNode
Normalize feature vectors with infinity norm to [-1,1]
Parameters
Exemplary Call
- node : I_FN
Author: Mario Krell and Marc Tabie (Mario.Krell and Marc.Tabie@dfki.de)
Created: 2012/07/16
POSSIBLE NODE NAMES: - InfinityNormFeatureNormalizationNode
- I_FN
- InfinityNormFeatureNormalization
POSSIBLE INPUT TYPES: - FeatureVector
Class Components Summary
_execute
(data)Normalizes the samples vector to inf norm one input_types
-
input_types
= ['FeatureVector']¶