Transforms features by scaling each feature to a given range
Source:R/sklearn-scalers.R
MinMaxScaler.RdThis 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) + minwhere min, max = feature_range.
This transformation is often used as an alternative to zero mean, unit variance scaling.
Super classes
rgudhi::PythonClass -> rgudhi::SKLearnClass -> rgudhi::BaseScaler -> MinMaxScaler
Methods
Method new()
The MinMaxScaler class constructor.
Usage
MinMaxScaler$new(feature_range = c(0, 1), copy = TRUE, clip = FALSE)Arguments
feature_rangeA length-2 numeric vector specifying the desired range of transformed data. Defaults to
c(0, 1).copyA boolean value specifying whether to perform in-place scaling and avoid a copy (if the input is already a numpy array). Defaults to
TRUE.clipA boolean value specifying whether to clip transformed values of held-out data to provided
feature_range. Defaults toFALSE.