Class Standardizer
source code
base.pymlObject.PyMLobject --+
|
Standardizer
class for performing feature normalization
For each feature the Standardizer subtracts the feature's mean and
divides by its standard deviation
this rescaling is composed of two operations:
-
``centering`` -- subtract from a feature its mean value; this is
referred to as 'translation'; the translation attribute gives the
value with which to translate each feature
-
``scaling`` -- divide a feature by a scale, e.g. its standard
deviation; the 'scale' attribute gives the value with which to scale
each feature
the 'train' method of the class computes the translation and scaling
factors, and performs normalization of the training data the 'test'
method uses values computed on the training data to normalize the test
data.
**caveat:** Beware of performing training multiple times on the same
dataset: if a dataset has already been standardized, re-standardization
will recompute mean and standard deviation, which will be approximately 0
and 1 for each feature; subsequent application on test data will have no
effect. Because of this an exception is raised if the user attempts to
re-train an already trained Rescale object.
|
attributes = {'translate': True, 'rescale': True, 'translation...
|
attributes
- Value:
{'translate': True, 'rescale': True, 'translation': None, 'scale': Non
e}
|
|