Documentation of 'smile.feature.Normalizer' Java class
Normalizer
smile.feature

Class Normalizer



  • public class Normalizer
    extends FeatureTransform
    Normalize samples individually to unit norm. Each sample (i.e. each row of the data matrix) with at least one non zero component is rescaled independently of other samples so that its norm (L1 or L2) equals one.

    Scaling inputs to unit norms is a common operation for text classification or clustering for instance.

    • Constructor Detail

      • Normalizer

        public Normalizer()
        Default constructor with L2 norm.
      • Normalizer

        public Normalizer(boolean copy)
        Constructor with L2 norm.
        Parameters:
        copy - If false, try to avoid a copy and do inplace scaling instead.
      • Normalizer

        public Normalizer(Normalizer.Norm norm)
        Constructor.
        Parameters:
        norm - The norm to use to normalize each non zero sample.
      • Normalizer

        public Normalizer(Normalizer.Norm norm,
                          boolean copy)
        Constructor.
        Parameters:
        norm - The norm to use to normalize each non zero sample.
        copy - If false, try to avoid a copy and do inplace scaling instead.
    • Method Detail

      • learn

        public void learn(Attribute[] attributes,
                          double[][] data)
        Description copied from class: FeatureTransform
        Learns transformation parameters from a dataset.
        Specified by:
        learn in class FeatureTransform
        Parameters:
        attributes - The variable attributes. Of which, numeric variables will be standardized.
        data - The training data to learn scaling parameters. The data will not be modified.
      • transform

        public double[] transform(double[] x)
        Description copied from class: FeatureTransform
        Transform a feature vector.
        Specified by:
        transform in class FeatureTransform
        Parameters:
        x - a feature vector.
        Returns:
        the transformed feature value.
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object

DataMelt 3.0 © DataMelt by jWork.ORG

Ads help maintain this website.