Skip to content

DOC Update hgbt docstrings on categorical_features default value #28485

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions sklearn/ensemble/_hist_gradient_boosting/gradient_boosting.py
Original file line number Diff line number Diff line change
Expand Up @@ -1498,7 +1498,7 @@ class HistGradientBoostingRegressor(RegressorMixin, BaseHistGradientBoosting):
``max_bins`` bins. In addition to the ``max_bins`` bins, one more bin
is always reserved for missing values. Must be no larger than 255.
categorical_features : array-like of {bool, int, str} of shape (n_features) \
or shape (n_categorical_features,), default=None
or shape (n_categorical_features,), default="warn"
Indicates the categorical features.

- None : no feature will be considered categorical.
Expand All @@ -1511,6 +1511,8 @@ class HistGradientBoostingRegressor(RegressorMixin, BaseHistGradientBoosting):
considered to be categorical features. The input must be an object
exposing a ``__dataframe__`` method such as pandas or polars
DataFrames to use this feature.
- `"warn"`: issue a warning when the input dataframe has undeclared
categorical columns.

For each categorical feature, there must be at most `max_bins` unique
categories. Negative values for categorical features encoded as numeric
Expand Down Expand Up @@ -1874,7 +1876,7 @@ class HistGradientBoostingClassifier(ClassifierMixin, BaseHistGradientBoosting):
``max_bins`` bins. In addition to the ``max_bins`` bins, one more bin
is always reserved for missing values. Must be no larger than 255.
categorical_features : array-like of {bool, int, str} of shape (n_features) \
or shape (n_categorical_features,), default=None
or shape (n_categorical_features,), default="warn"
Indicates the categorical features.

- None : no feature will be considered categorical.
Expand All @@ -1887,6 +1889,8 @@ class HistGradientBoostingClassifier(ClassifierMixin, BaseHistGradientBoosting):
considered to be categorical features. The input must be an object
exposing a ``__dataframe__`` method such as pandas or polars
DataFrames to use this feature.
- `"warn"`: issue a warning when the input dataframe has undeclared
categorical columns.

For each categorical feature, there must be at most `max_bins` unique
categories. Negative values for categorical features encoded as numeric
Expand Down