SetOutputMixin#

class pybear.base.SetOutputMixin#

Bases: object

This mixin provides the set_output method to pybear transformers.

Use set_output to set the container of the output for transform and fit_transform (when the FitTransformMixin is used.) Use the _set_output_for_transform method to decorate transform in the child class. This rendition of set_output does not require that the get_feature_names_out method exist. If there is no get_feature_names_out method, range(X.shape[1]) is passed to pandas/polars for column names.

Methods

set_output([transform])

Set the output container when the transform and fit_transform methods of the transformer are called.

set_output(transform=None)#

Set the output container when the transform and fit_transform methods of the transformer are called.

Parameters:
transformLiteral[‘default’, ‘pandas’, ‘polars’] | None,

The default value for the transform parameter is None.

Configure the output of transform and fit_transform.

‘default’: Default output format (numpy array)

‘pandas’: pandas dataframe output

‘polars’: polars dataframe output

None: The output container is the same as the given container.

Returns:
selfobject

The transformer instance.