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, passthrough_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: Tuple[float, float], default=(0, 1)

Desired range of transformed data (default is 0 to 1).

clip: bool, default=False

Whether to clip transformed values of held-out data to the specified feature range (default is True).

input_cols: Optional[Union[str, List[str]]], default=None

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: Optional[Union[str, List[str]]], default=None

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.

passthrough_cols: Optional[Union[str, List[str]]], default=None

A string or a list of strings indicating column names to be excluded from any operations (such as train, transform, or inference). These specified column(s) will remain untouched throughout the process. This option is helpful in scenarios requiring automatic input_cols inference, but need to avoid using specific columns, like index columns, during training or inference.

drop_input_cols: Optional[bool], default=False

Remove input columns from output if set True. False by default.

Attributes:
min_: Dict[str, float]

dict {column_name: value} or None. Per-feature adjustment for minimum.

scale_: Dict[str, float]

dict {column_name: value} or None. Per-feature relative scaling factor.

data_min_: Dict[str, float]

dict {column_name: value} or None. Per-feature minimum seen in the data.

data_max_: Dict[str, float]

dict {column_name: value} or None. Per-feature maximum seen in the data.

data_range_: Dict[str, float]

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.

get_input_cols()

Input columns getter.

get_label_cols()

Label column getter.

get_output_cols()

Output columns getter.

get_params([deep])

Get parameters for this transformer.

get_passthrough_cols()

Passthrough columns getter.

get_sample_weight_col()

Sample weight column getter.

get_sklearn_args([default_sklearn_obj, ...])

Get sklearn keyword arguments.

set_drop_input_cols([drop_input_cols])

set_input_cols(input_cols)

Input columns setter.

set_label_cols(label_cols)

Label column setter.

set_output_cols(output_cols)

Output columns setter.

set_params(**params)

Set the parameters of this transformer.

set_passthrough_cols(passthrough_cols)

Passthrough columns setter.

set_sample_weight_col(sample_weight_col)

Sample weight column setter.

to_lightgbm()

to_sklearn()

to_xgboost()

transform(dataset)

Scale features according to feature_range.