MinMaxScaler | R Documentation |
A class for transforming features by scaling each feature to a given range.
minmax(x, .min = NULL, .max = NULL, .range = c(0, 1))
inverse_minmax(x, .min, .max, .range = c(0, 1))
deepANN::Scaler
-> MinMaxScaler
data_min
('NULL' | numeric vector)
Per feature minimum seen in the data.
data_max
('NULL' | numeric vector)
Per feature maximum seen in the data
feature_range
('integerish vector')
Desired range of transformed data.
new()
Creates a new instance of this R6 class.
MinMaxScaler$new(feature_range = c(0, 1))
feature_range
Desired range of transformed data.
fit()
Compute the minimum and maximum to be used for later scaling.
MinMaxScaler$fit(X, axis = 1)
X
The data used to compute the per-feature minimum and maximum used for later scaling along the features axis.
axis
The axis along computation is applied.
The instance self
itself.
transform()
Scale features according to feature_range.
MinMaxScaler$transform(X, axis = 1, order = c("C", "F"))
X
The data that will be transformed.
axis
The axis along scaling is applied.
order
The order in which elements of data should be read during scaling. By default, the order is equivalent to the C-style ordering and means elements should be read in row-major order. In opposite, the Fortran-style ordering means elements should be read in column-major order.
The transformed X
.
fit_transform()
Run fit()
and transform()
.
MinMaxScaler$fit_transform(X, axis = 1, order = c("C", "F"))
X
The data that will be transformed.
axis
The axis along scaling is applied.
order
The order in which elements of data should be read during scaling. By default, the order is equivalent to the C-style ordering and means elements should be read in row-major order. In opposite, the Fortran-style ordering means elements should be read in column-major order.
The transformed X
.
inverse_transform()
Undo the scaling of X
according to feature_range.
MinMaxScaler$inverse_transform(X, axis = 1, order = c("C", "F"))
X
The data that will be transformed.
axis
The axis along scaling is applied.
order
The order in which elements of data should be read during scaling. By default, the order is equivalent to the C-style ordering and means elements should be read in row-major order. In opposite, the Fortran-style ordering means elements should be read in column-major order.
The transformed X
.
clone()
The objects of this class are cloneable with this method.
MinMaxScaler$clone(deep = FALSE)
deep
Whether to make a deep clone.
a <- random_int(dim = c(6, 4), min = 1, max = 30)
scaler <- MinMaxScaler$new()
xt <- scaler$fit_transform(a)
scaler$inverse_transform(xt)
a <- random_int(dim = c(4, 3, 2), min = 1, max = 30)
scaler <- MinMaxScaler$new()
xt <- scaler$fit_transform(a, axis = c(1, 2))
scaler$inverse_transform(xt, axis = c(1, 2))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.