Skip to main content

MaxAbsScaler

Converter
DashAI.back.converters.scikit_learn.MaxAbsScaler

Scale each feature by its maximum absolute value to the range [-1, 1].

For each feature column the transformation is::

x_scaled = x / max(|x|)

where max(|x|) is the largest absolute value observed in that column during fitting. The result always lies in [-1, 1].

Because this scaler neither centers nor shifts the data, it preserves any existing zero entries, making it the preferred choice for sparse matrices (e.g. TF-IDF or count-vectorized text). It is also appropriate when the data is already known to be centered at zero and only the scale needs to be adjusted.

References​

Methods​

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

Defined on MaxAbsScaler

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
A Float type backed by pyarrow.float64().

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_credential(self, name: str)

Defined on ConfigObject

Resolve a registered credential component by name.

Parameters

name : str
Credential component class name (e.g. "HuggingFaceCredential").

Returns

BaseCredential
An instance of the requested credential component.

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.

infer_output_columns(self, inputs: 'List[StateItem]') -> 'StructureDelta'

Defined on BaseConverter

Estimate what this converter does to its scope, without any data.

Parameters

inputs : list of ColumnItem | BlockItem
The dataset state items in this converter's scope.

Returns

StructureDelta
The scope items that survive (maybe retyped) and the new items.

rows_to_keep(self, x: "'DashAIDataset'") -> 'List[int]'

Defined on BaseConverter

Positions of the rows of x that survive this converter.

Parameters

x : DashAIDataset
The converter's scope columns of one split.

Returns

list of int
0-based positions of the kept rows, in order.

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

Defined on SklearnWrapper

Transform the data using the fitted scikit-learn transformer.

Parameters

x : DashAIDataset
The input dataset to transform.
y : DashAIDataset, optional
Not used. Present for API consistency. Defaults to None.

Returns

DashAIDataset
The transformed dataset with updated DashAI column types.

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.