8000 Revert "DOC Remove outdated doc in KBinsDiscretizer (#13047)" · xhluca/scikit-learn@adf6895 · GitHub
[go: up one dir, main page]

Skip to content

Commit adf6895

Browse files
author
Xing
committed
Revert "DOC Remove outdated doc in KBinsDiscretizer (scikit-learn#13047)"
This reverts commit 5d7fcf3.
1 parent 8165799 commit adf6895

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

sklearn/preprocessing/_discretization.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,12 @@ class KBinsDiscretizer(BaseEstimator, TransformerMixin):
2727
Parameters
2828
----------
2929
n_bins : int or array-like, shape (n_features,) (default=5)
30-
The number of bins to produce. Raises ValueError if ``n_bins < 2``.
30+
The number of bins to produce. The intervals for the bins are
31+
determined by the minimum and maximum of the input data.
32+
Raises ValueError if ``n_bins < 2``.
33+
34+
If ``n_bins`` is an array, and there is an ignored feature at
35+
index ``i``, ``n_bins[i]`` will be ignored.
3136
3237
encode : {'onehot', 'onehot-dense', 'ordinal'}, (default='onehot')
3338
Method used to encode the transformed result.
@@ -57,7 +62,8 @@ class KBinsDiscretizer(BaseEstimator, TransformerMixin):
5762
Attributes
5863
----------
5964
n_bins_ : int array, shape (n_features,)
60-
Number of bins per feature.
65+
Number of bins per feature. An ignored feature at index ``i``
66+
will have ``n_bins_[i] == 0``.
6167
6268
bin_edges_ : array of arrays, shape (n_features, )
6369
The edges of each bin. Contain arrays of varying shapes ``(n_bins_, )``

0 commit comments

Comments
 (0)
0