snowflake.ml.modeling.preprocessing.BinarizerΒΆ
- class snowflake.ml.modeling.preprocessing.Binarizer(*, threshold: float = 0.0, input_cols: Optional[Union[str, Iterable[str]]] = None, output_cols: Optional[Union[str, Iterable[str]]] = None, drop_input_cols: Optional[bool] = False)ΒΆ
Bases:
BaseTransformer
Binarizes data (sets feature values to 0 or 1) according to the given threshold.
Values must be of float type. Values greater than the threshold map to 1, while values less than or equal to the threshold map to 0. The default threshold of 0.0 maps only positive values to 1.
For more details on what this transformer does, see sklearn.preprocessing.Binarizer.
- Args:
threshold: Feature values below or equal to this are replaced by 0, above it by 1. Default values is 0.0. input_cols: The name(s) of one or more columns in a DataFrame containing a feature to be binarized. 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.
Methods
fit
(dataset)This is a stateless transformer, so there is nothing to fit.
transform
(dataset)Binarize the data.