Skip to content

Document on how to use custom bin edges in KBinsDiscretizer #18498

@rachittoshniwal

Description

@rachittoshniwal

Describe the workflow you want to enable

A parameter accepting custom bin edges as an array.

Describe your proposed solution

Use pd.cut() under the hood or any other computationally efficient method.

Describe alternatives you've considered, if relevant

pandas' cut function.

Additional context

Say if we need to bin ages as 'infant', 'kid', 'teen', 'adult', 'senior citizen' into [0, 1, 13, 20, 60, np.inf] etc.

We can't do it using KBinsDiscretizer currently.

I wonder if there is any reason behind not implementing it?

Metadata

Metadata

Assignees

No one assigned

    Labels

    DocumentationEasyWell-defined and straightforward way to resolvegood first issueEasy with clear instructions to resolve

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions