Skip to content

Downcasting integer columns after encoding #62

Description

@fabien-vavrand

NumericalEncoder currently encodes categories to integers, without considering the integer type. Downcasting integers to int8 or int16 when possible could sometimes significantly reduce memory and avoid some memory overhead.

import pandas as pd
from aikit.transformers import NumericalEncoder
df = pd.DataFrame(data={'a': ['a', 'b', 'c'] * 1000})
x = NumericalEncoder().fit_transform(df)
x.dtypes

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions