aisquared.config.preprocessing.tabular package

Submodules

aisquared.config.preprocessing.tabular.Steps module

class aisquared.config.preprocessing.tabular.Steps.DropColumn(column: int)[source]

Bases: BaseObject

Drop a column from tabular data

Example usage:

>>> import aisquared
>>> preprocesser = aisquared.config.preprocessing.tabular.TabularPreprocesser()
>>> preprocesser.add_step(
    aisquared.config.preprocessing.tabular.DropColumn(
        3
    )
)
property column
to_dict() dict[source]

Get the configuration object as a dictionary

class aisquared.config.preprocessing.tabular.Steps.MinMax(mins: list, maxs: list, columns: list | None = None)[source]

Bases: BaseObject

Min-Max Scaling preprocessing step

Min-Max Scaling takes all associated columns and maps values relative to the minimum and maximum values of the training data.

Example usage:

>>> import aisquared
>>> preprocesser = aisquared.config.preprocessing.tabular.TabularPreprocesser()
>>> preprocesser.add_step(
    aisquared.config.preprocessing.tabular.MinMax(
        [0, 1.1, 2],
        [0.2, 14, 18.3]
    )
)
property columns
property maxs
property mins
to_dict() dict[source]

Get the configuration object as a dictionary

class aisquared.config.preprocessing.tabular.Steps.OneHot(column: int, values: list)[source]

Bases: BaseObject

One Hot encoding preprocessing step

Example usage:

>>> import aisquared
>>> preprocesser = aisquared.config.preprocessing.tabular.TabularPreprocesser()
>>> preprocesser.add_step(
    aisquared.config.preprocessing.tabular.OneHot(
        6,
        ['one', 'two', 'three']
    )
)
property column
to_dict() dict[source]

Get the configuration object as a dictionary

property values
class aisquared.config.preprocessing.tabular.Steps.ZScore(means: list, stds: list, columns: int | list | None = None)[source]

Bases: BaseObject

Z-Score normalization preprocessing step

Z-Score normalization takes each supplied column value, subtracts that column’s provided mean, and divides by the provided standard deviation.

Example usage:

>>> import aisquared
>>> preprocesser = aisquared.config.preprocessing.tabular.TabularPreprocesser()
>>> preprocesser.add_step(
    aisquared.config.preprocessing.tabular.ZScore(
        [0, 1, 2],
        [0.2, 0.4, 0.6]
    )
)
property columns
property means
property stds
to_dict() dict[source]

Get the configuration object as a dictionary

aisquared.config.preprocessing.tabular.TabularPreprocessing module

class aisquared.config.preprocessing.tabular.TabularPreprocessing.TabularPreprocesser(steps: list | None = None)[source]

Bases: BaseObject

Preprocesser object for tabular data

Example usage:

Example usage:

>>> import aisquared
>>> preprocesser = aisquared.config.preprocessing.tabular.TabularPreprocesser()
>>> preprocesser.add_step(
    aisquared.config.preprocessing.tabular.ZScore(
        [0, 1, 2],
        [0.2, 0.4, 0.6]
    )
)
add_step(step)[source]

Add a step to the preprocesser object

to_dict()[source]

Get the configuration object as a dictionary

Module contents

The aisquared.config.preprocessing.tabular subpackage contains objects for preprocessing tabular data.