@@ -66,22 +66,6 @@ class BalancedRandomForestClassifier(RandomForestClassifier):
66
66
"gini" for the Gini impurity and "entropy" for the information gain.
67
67
Note: this parameter is tree-specific.
68
68
69
- max_features : int, float, string or None, optional (default="auto")
70
- The number of features to consider when looking for the best split:
71
-
72
- - If int, then consider `max_features` features at each split.
73
- - If float, then `max_features` is a percentage and
74
- `int(max_features * n_features)` features are considered at each
75
- split.
76
- - If "auto", then `max_features=sqrt(n_features)`.
77
- - If "sqrt", then `max_features=sqrt(n_features)` (same as "auto").
78
- - If "log2", then `max_features=log2(n_features)`.
79
- - If None, then `max_features=n_features`.
80
-
81
- Note: the search for a split does not stop until at least one
82
- valid partition of the node samples is found, even if it requires to
83
- effectively inspect more than ``max_features`` features.
84
-
85
69
max_depth : integer or None, optional (default=None)
86
70
The maximum depth of the tree. If None, then nodes are expanded until
87
71
all leaves are pure or until all leaves contain less than
@@ -108,10 +92,21 @@ class BalancedRandomForestClassifier(RandomForestClassifier):
108
92
the input samples) required to be at a leaf node. Samples have
109
93
equal weight when sample_weight is not provided.
110
94
111
- .. deprecated:: 0.20
112
- The parameter ``min_weight_fraction_leaf`` is deprecated in version
113
- 0.20. Its implementation, like ``min_samples_leaf``, is ineffective
114
- for regularization.
95
+ max_features : int, float, string or None, optional (default="auto")
96
+ The number of features to consider when looking for the best split:
97
+
98
+ - If int, then consider `max_features` features at each split.
99
+ - If float, then `max_features` is a percentage and
100
+ `int(max_features * n_features)` features are considered at each
101
+ split.
102
+ - If "auto", then `max_features=sqrt(n_features)`.
103
+ - If "sqrt", then `max_features=sqrt(n_features)` (same as "auto").
104
+ - If "log2", then `max_features=log2(n_features)`.
105
+ - If None, then `max_features=n_features`.
106
+
107
+ Note: the search for a split does not stop until at least one
108
+ valid partition of the node samples is found, even if it requires to
109
+ effectively inspect more than ``max_features`` features.
115
110
116
111
max_leaf_nodes : int or None, optional (default=None)
117
112
Grow trees with ``max_leaf_nodes`` in best-first fashion.
@@ -239,10 +234,10 @@ class labels (multi-output problem).
239
234
>>> clf.fit(X, y) # doctest: +ELLIPSIS
240
235
BalancedRandomForestClassifier(...)
241
236
>>> print(clf.feature_importances_)
242
- [ 0.21521153 0.01054557 0.00689419 0.17404434 0.00414734 0.00704686
243
- 0.19761999 0.01865445 0.00608294 0.00490484 0.00866699 0.0046718
244
- 0.00359038 0.01168016 0.09392572 0.04978297 0.0033278 0.01008566
245
- 0.15534173 0.01377474 ]
237
+ [ 0.21506735 0.0104961 0.00706549 0.17414694 0.00556422 0.00704686
238
+ 0.19779549 0.01865445 0.00608294 0.00490484 0.00866699 0.00251414
239
+ 0.00339721 0.01174379 0.09380596 0.05049964 0.0033278 0.01008566
240
+ 0.15534173 0.01379241 ]
246
241
>>> print(clf.predict([[0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
247
242
... 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]]))
248
243
[1]
@@ -253,8 +248,8 @@ def __init__(self,
253
248
criterion = "gini" ,
254
249
max_depth = None ,
255
250
min_samples_split = 2 ,
256
- min_samples_leaf = 'deprecated' ,
257
- min_weight_fraction_leaf = 'deprecated' ,
251
+ min_samples_leaf = 2 ,
252
+ min_weight_fraction_leaf = 0. ,
258
253
max_features = "auto" ,
259
254
max_leaf_nodes = None ,
260
255
min_impurity_decrease = 0. ,
0 commit comments