Package ai.sklearn4j.preprocessing.data
Class MinimumMaximumScaler
- java.lang.Object
-
- ai.sklearn4j.base.TransformerMixin<NumpyArray<Double>,NumpyArray<Double>>
-
- ai.sklearn4j.preprocessing.data.MinimumMaximumScaler
-
public class MinimumMaximumScaler extends TransformerMixin<NumpyArray<Double>,NumpyArray<Double>>
Transform features by scaling each feature to a given range. This estimator scales and translates each feature individually such that it is in the given range on the training set, e.g. between zero and one. The transformation is given by:: X_std = (X - X.min(axis=0)) / (X.max(axis=0) - X.min(axis=0)) X_scaled = X_std * (max - min) + min where min, max = feature_range. This transformation is often used as an alternative to zero mean, unit variance scaling.
-
-
Constructor Summary
Constructors Constructor Description MinimumMaximumScaler()Instantiate a new object of MinimumMaximumScaler.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleangetClip()Gets the value of ClipNumpyArraygetDataMax()Gets the Per feature maximum seen in the dataNumpyArraygetDataMin()Gets the Per feature minimum seen in the dataNumpyArraygetDataRange()Gets the Per feature range `(data_max_ - data_min_)` seen in the dataString[]getFeatureNamesIn()Gets the Names of features seen during `fit`.double[]getFeatureRange()Gets the value of FeatureRangeNumpyArraygetMin()Gets the Per feature adjustment for minimum.longgetNFeaturesIn()Gets the Number of features seen during `fit`.longgetNSamplesSeen()Gets the The number of samples processed by the estimator.NumpyArraygetScale()Gets the Per feature relative scaling of the data.NumpyArray<Double>inverseTransform(NumpyArray<Double> array)Takes a transformed array and reveres the transformation.voidsetClip(boolean value)Sets the value of ClipvoidsetDataMax(NumpyArray value)Sets the Per feature maximum seen in the datavoidsetDataMin(NumpyArray value)Sets the Per feature minimum seen in the datavoidsetDataRange(NumpyArray value)Sets the Per feature range `(data_max_ - data_min_)` seen in the datavoidsetFeatureNamesIn(String[] value)Sets the Names of features seen during `fit`.voidsetFeatureRange(double[] value)Sets the value of FeatureRangevoidsetMin(NumpyArray value)Sets the Per feature adjustment for minimum.voidsetNFeaturesIn(long value)Sets the Number of features seen during `fit`.voidsetNSamplesSeen(long value)Sets the The number of samples processed by the estimator.voidsetScale(NumpyArray value)Sets the Per feature relative scaling of the data.NumpyArray<Double>transform(NumpyArray<Double> array)Takes the input array and transforms it.
-
-
-
Method Detail
-
setMin
public void setMin(NumpyArray value)
Sets the Per feature adjustment for minimum. Equivalent to `min - X.min(axis=0) * self.scale_`- Parameters:
value- The new value for min.
-
getMin
public NumpyArray getMin()
Gets the Per feature adjustment for minimum. Equivalent to `min - X.min(axis=0) * self.scale_`
-
setScale
public void setScale(NumpyArray value)
Sets the Per feature relative scaling of the data. Equivalent to `(max - min) / (X.max(axis=0) - X.min(axis=0))`- Parameters:
value- The new value for scale.
-
getScale
public NumpyArray getScale()
Gets the Per feature relative scaling of the data. Equivalent to `(max - min) / (X.max(axis=0) - X.min(axis=0))`
-
setDataMin
public void setDataMin(NumpyArray value)
Sets the Per feature minimum seen in the data- Parameters:
value- The new value for dataMin.
-
getDataMin
public NumpyArray getDataMin()
Gets the Per feature minimum seen in the data
-
setDataMax
public void setDataMax(NumpyArray value)
Sets the Per feature maximum seen in the data- Parameters:
value- The new value for dataMax.
-
getDataMax
public NumpyArray getDataMax()
Gets the Per feature maximum seen in the data
-
setDataRange
public void setDataRange(NumpyArray value)
Sets the Per feature range `(data_max_ - data_min_)` seen in the data- Parameters:
value- The new value for dataRange.
-
getDataRange
public NumpyArray getDataRange()
Gets the Per feature range `(data_max_ - data_min_)` seen in the data
-
setNFeaturesIn
public void setNFeaturesIn(long value)
Sets the Number of features seen during `fit`.- Parameters:
value- The new value for nFeaturesIn.
-
getNFeaturesIn
public long getNFeaturesIn()
Gets the Number of features seen during `fit`.
-
setNSamplesSeen
public void setNSamplesSeen(long value)
Sets the The number of samples processed by the estimator. It will be reset on new calls to fit, but increments across `partial_fit` calls.- Parameters:
value- The new value for nSamplesSeen.
-
getNSamplesSeen
public long getNSamplesSeen()
Gets the The number of samples processed by the estimator. It will be reset on new calls to fit, but increments across `partial_fit` calls.
-
setFeatureNamesIn
public void setFeatureNamesIn(String[] value)
Sets the Names of features seen during `fit`. Defined only when `X` has feature names that are all strings.- Parameters:
value- The new value for featureNamesIn.
-
getFeatureNamesIn
public String[] getFeatureNamesIn()
Gets the Names of features seen during `fit`. Defined only when `X` has feature names that are all strings.
-
setClip
public void setClip(boolean value)
Sets the value of Clip- Parameters:
value- The new value for Clip.
-
getClip
public boolean getClip()
Gets the value of Clip
-
setFeatureRange
public void setFeatureRange(double[] value)
Sets the value of FeatureRange- Parameters:
value- The new value for FeatureRange.
-
getFeatureRange
public double[] getFeatureRange()
Gets the value of FeatureRange
-
transform
public NumpyArray<Double> transform(NumpyArray<Double> array)
Takes the input array and transforms it.- Specified by:
transformin classTransformerMixin<NumpyArray<Double>,NumpyArray<Double>>- Parameters:
array- The array to transform.- Returns:
- The transformed array.
-
inverseTransform
public NumpyArray<Double> inverseTransform(NumpyArray<Double> array)
Takes a transformed array and reveres the transformation.- Specified by:
inverseTransformin classTransformerMixin<NumpyArray<Double>,NumpyArray<Double>>- Parameters:
array- The array to apply reveres transform.- Returns:
- The inversed transform of array.
-
-