Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Expected inputs for fit and fit_transform in OneHotEncoder #12115

Closed
@albertcthomas

Description

@albertcthomas

In the docstring of the OneHotEncoder we have the following description:

The input to this transformer should be a matrix of integers, denoting
the values taken on by categorical (discrete) features. The output will be
a sparse matrix where each column corresponds to one possible value of one
feature. It is assumed that input features take on values in the range
[0, n_values).

However for fit and fit_transform the description for the input X only contains:

X : array-like, shape [n_samples, n_feature]
  Input array of type int.

I think the description of X should be clearer in fit and fit_transform to say that the integers should be positive and taking values in the range [0, n_values).

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