snowflake.ml.modeling.preprocessing.MinMaxScaler¶
- class snowflake.ml.modeling.preprocessing.MinMaxScaler(*, feature_range: Tuple[float, float] = (0, 1), clip: bool = False, input_cols: Optional[Union[str, Iterable[str]]] = None, output_cols: Optional[Union[str, Iterable[str]]] = None, drop_input_cols: Optional[bool] = False)¶
Bases:
BaseTransformer
Transforms features by scaling each feature to a given range, by default between zero and one.
Values must be of float type. Each feature is scaled and translated independently.
For more details on what this transformer does, see sklearn.preprocessing.MinMaxScaler.
- Args:
feature_range: Desired range of transformed data (default is 0 to 1). clip: Whether to clip transformed values of held-out data to the specified feature range (default is True). input_cols: The name(s) of one or more columns in a DataFrame containing a feature to be scaled. Each specified
input column is scaled independently and stored in the corresponding output column.
- output_cols: The name(s) of one or more columns in a DataFrame in which results will be stored. The number of
columns specified must match the number of input columns.
drop_input_cols: Remove input columns from output if set True. False by default.
- Attributes:
min_: dict {column_name: value} or None. Per-feature adjustment for minimum. scale_: dict {column_name: value} or None. Per-feature relative scaling factor. data_min_: dict {column_name: value} or None. Per-feature minimum seen in the data. data_max_: dict {column_name: value} or None. Per-feature maximum seen in the data. data_range_: dict {column_name: value} or None. Per-feature range seen in the data as a (min, max) tuple.
Methods
fit
(dataset)Compute min and max values of the dataset.
transform
(dataset)Scale features according to feature_range.