bach.DataFrame.minmax_scale
minmax_scale
(feature_range=(0, 1))Scales all numeric series based on a given range.
Parameters
feature_range
(Tuple[int, int]) – tuple(min, max)
desired range to use for scaling.
Returns
DataFrame
Return type
Each transformation per feature is performed as follows:
In:
range_min, range_max = (0, 1)
feature_std = (feature - min_feature) / (max_feature - min_feature)
scaled_feature = feature_std * (range_max - range_min) + range_min
scaled_feature.to_pandas()
Out:
index
a 0.000000
b 0.333333
c 0.666667
d 1.000000
Name: feature, dtype: float64
Where:
feature
is the series to be scaledfeature_min
is the minimum value offeature
feature_max
is the maximum value offeature
range_min, range_max
=feature_range