Skip to contents

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.

Super classes

rgudhi::PythonClass -> rgudhi::SKLearnClass -> rgudhi::BaseScaler -> MinMaxScaler

Methods

Inherited methods


Method new()

The MinMaxScaler class constructor.

Usage

MinMaxScaler$new(feature_range = c(0, 1), copy = TRUE, clip = FALSE)

Arguments

feature_range

A length-2 numeric vector specifying the desired range of transformed data. Defaults to c(0, 1).

copy

A boolean value specifying whether to perform in-place scaling and avoid a copy (if the input is already a numpy array). Defaults to TRUE.

clip

A boolean value specifying whether to clip transformed values of held-out data to provided feature_range. Defaults to FALSE.

Returns

An object of class MinMaxScaler.


Method clone()

The objects of this class are cloneable with this method.

Usage

MinMaxScaler$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.

Examples

if (FALSE) { # reticulate::py_module_available("sklearn.preprocessing")
mms <- MinMaxScaler$new()
}