Saltar al contenido principal

Binarizer

Converter
DashAI.back.converters.scikit_learn.Binarizer

Threshold each feature to produce binary (0/1) values.

Values greater than the threshold become 1; all others become 0. Wraps scikit-learn's Binarizer.

Parameters

threshold : number, default=0.0
Feature values below or equal to this are replaced by 0, above it by 1.

Methods

get_output_type(self, column_name: str = None) -> DashAI.back.types.dashai_data_type.DashAIDataType

Defined on Binarizer

Return the DashAI data type produced by this converter for a column.

Parameters

column_name : str, optional
Not used; all output columns share the same type. Defaults to None.

Returns

DashAIDataType
An Integer type backed by pyarrow.int64().

changes_row_count(self) -> 'bool'

Defined on BaseConverter

Indicate whether this converter changes the number of dataset rows.

Returns

bool
True if the converter may add or remove rows, False otherwise.

fit(self, x: 'DashAIDataset', y: Optional[ForwardRef('DashAIDataset')] = None) -> DashAI.back.converters.base_converter.BaseConverter

Defined on SklearnWrapper

Fit the scikit-learn transformer to the data.

Parameters

x : DashAIDataset
The input dataset to fit the transformer on.
y : DashAIDataset, optional
Target values for supervised transformers. Defaults to None.

Returns

BaseConverter
The fitted transformer instance (self).

get_metadata(cls) -> 'Dict[str, Any]'

Defined on BaseConverter

Get metadata for the converter, used by the DashAI frontend.

Parameters

cls : type
The converter class (injected automatically by Python for classmethods).

Returns

Dict[str, Any]
Dictionary containing display name, short description, image preview path, category, icon, color, and whether the converter is supervised.

get_schema(cls) -> dict

Defined on ConfigObject

Generates the component related Json Schema.

Returns

dict
Dictionary representing the Json Schema of the component.

transform(self, x: 'DashAIDataset', y: Optional[ForwardRef('DashAIDataset')] = None) -> 'DashAIDataset'

Defined on EncodingConverter

Encode x and append the result as new encoded_* columns.

Parameters

x : DashAIDataset
The dataset to transform (contains only the scope columns).
y : DashAIDataset, optional
Ignored. Defaults to None.

Returns

DashAIDataset
Dataset with the original scope columns preserved plus new encoded_* columns appended.

validate_and_transform(self, raw_data: dict) -> dict

Defined on ConfigObject

It takes the data given by the user to initialize the model and returns it with all the objects that the model needs to work.

Parameters

raw_data : dict
A dictionary with the data provided by the user to initialize the model.

Returns

dict
A validated dictionary with the necessary objects.