You are viewing documentation about an older version (1.0.9). View latest version

snowflake.ml.modeling.preprocessing.MaxAbsScaler

class snowflake.ml.modeling.preprocessing.MaxAbsScaler(*, input_cols: Optional[Union[str, Iterable[str]]] = None, output_cols: Optional[Union[str, Iterable[str]]] = None, drop_input_cols: Optional[bool] = False)

Bases: BaseTransformer

Scale each feature by its maximum absolute value.

This transformer scales and translates each feature individually such that the maximal absolute value of each feature in the training set will be 1.0. It does not shift/center the data, and thus does not destroy any sparsity.

Values must be of float type. Each feature is scaled and transformed individually such that the maximal absolute value of each feature in the dataset is 1.0. This scaler does not shift or center the data, preserving sparsity.

For more details on what this transformer does, see sklearn.preprocessing.MaxAbsScaler.

Args:

input_cols: The name(s) of one or more columns in a DataFrame containing a feature to be scaled. 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:

scale_: dict {column_name: value} or None. Per-feature relative scaling factor. max_abs_: dict {column_name: value} or None. Per-feature maximum absolute value.

Methods

fit(dataset)

Compute the maximum absolute value to be used for later scaling.

transform(dataset)

Scale the data.