@@ -805,6 +805,10 @@ class RandomForestClassifier(ForestClassifier):
805
805
If None then unlimited number of leaf nodes.
806
806
If not None then ``max_depth`` will be ignored.
807
807
808
+ min_impurity_split : float, optional (default=1e-7)
809
+ Threshold for early stopping in tree growth. A node will split
810
+ if its impurity is above the threshold, otherwise it is a leaf.
811
+
808
812
bootstrap : boolean, optional (default=True)
809
813
Whether bootstrap samples are used when building trees.
810
814
@@ -899,6 +903,7 @@ def __init__(self,
899
903
min_weight_fraction_leaf = 0. ,
900
904
max_features = "auto" ,
901
905
max_leaf_nodes = None ,
906
+ min_impurity_split = 1e-7 ,
902
907
bootstrap = True ,
903
908
oob_score = False ,
904
909
n_jobs = 1 ,
@@ -911,7 +916,7 @@ def __init__(self,
911
916
n_estimators = n_estimators ,
912
917
estimator_params = ("criterion" , "max_depth" , "min_samples_split" ,
913
918
"min_samples_leaf" , "min_weight_fraction_leaf" ,
914
- "max_features" , "max_leaf_nodes" ,
919
+ "max_features" , "max_leaf_nodes" , "min_impurity_split" ,
915
920
"random_state" ),
916
921
bootstrap = bootstrap ,
917
922
oob_score = oob_score ,
@@ -928,6 +933,7 @@ def __init__(self,
928
933
self .min_weight_fraction_leaf = min_weight_fraction_leaf
929
934
self .max_features = max_features
930
935
self .max_leaf_nodes = max_leaf_nodes
936
+ self .min_impurity_split = min_impurity_split
931
937
932
938
933
939
class RandomForestRegressor (ForestRegressor ):
@@ -1001,6 +1007,10 @@ class RandomForestRegressor(ForestRegressor):
1001
1007
If None then unlimited number of leaf nodes.
1002
1008
If not None then ``max_depth`` will be ignored.
1003
1009
1010
+ min_impurity_split : float, optional (default=1e-7)
1011
+ Threshold for early stopping in tree growth. A node will split
1012
+ if its impurity is above the threshold, otherwise it is a leaf.
1013
+
1004
1014
bootstrap : boolean, optional (default=True)
1005
1015
Whether bootstrap samples are used when building trees.
1006
1016
@@ -1064,6 +1074,7 @@ def __init__(self,
1064
1074
min_weight_fraction_leaf = 0. ,
1065
1075
max_features = "auto" ,
1066
1076
max_leaf_nodes = None ,
1077
+ min_impurity_split = 1e-7 ,
1067
1078
bootstrap = True ,
1068
1079
oob_score = False ,
1069
1080
n_jobs = 1 ,
@@ -1075,7 +1086,7 @@ def __init__(self,
1075
1086
n_estimators = n_estimators ,
1076
1087
estimator_params = ("criterion" , "max_depth" , "min_samples_split" ,
1077
1088
"min_samples_leaf" , "min_weight_fraction_leaf" ,
1078
- "max_features" , "max_leaf_nodes" ,
1089
+ "max_features" , "max_leaf_nodes" , "min_impurity_split" ,
1079
1090
"random_state" ),
1080
1091
bootstrap = bootstrap ,
1081
1092
oob_score = oob_score ,
@@ -1091,6 +1102,7 @@ def __init__(self,
1091
1102
self .min_weight_fraction_leaf = min_weight_fraction_leaf
1092
1103
self .max_features = max_features
1093
1104
self .max_leaf_nodes = max_leaf_nodes
1105
+ self .min_impurity_split = min_impurity_split
1094
1106
1095
1107
1096
1108
class ExtraTreesClassifier (ForestClassifier ):
@@ -1160,6 +1172,10 @@ class ExtraTreesClassifier(ForestClassifier):
1160
1172
If None then unlimited number of leaf nodes.
1161
1173
If not None then ``max_depth`` will be ignored.
1162
1174
1175
+ min_impurity_split : float, optional (default=1e-7)
1176
+ Threshold for early stopping in tree growth. A node will split
1177
+ if its impurity is above the threshold, otherwise it is a leaf.
1178
+
1163
1179
bootstrap : boolean, optional (default=False)
1164
1180
Whether bootstrap samples are used when building trees.
1165
1181
@@ -1255,6 +1271,7 @@ def __init__(self,
1255
1271
min_weight_fraction_leaf = 0. ,
1256
1272
max_features = "auto" ,
1257
1273
max_leaf_nodes = None ,
1274
+ min_impurity_split = 1e-7 ,
1258
1275
bootstrap = False ,
1259
1276
oob_score = False ,
1260
1277
n_jobs = 1 ,
@@ -1267,7 +1284,7 @@ def __init__(self,
1267
1284
n_estimators = n_estimators ,
1268
1285
estimator_params = ("criterion" , "max_depth" , "min_samples_split" ,
1269
1286
"min_samples_leaf" , "min_weight_fraction_leaf" ,
1270
- "max_features" , "max_leaf_nodes" ,
1287
+ "max_features" , "max_leaf_nodes" , "min_impurity_split" ,
1271
1288
"random_state" ),
1272
1289
bootstrap = bootstrap ,
1273
1290
oob_score = oob_score ,
@@ -1284,6 +1301,7 @@ def __init__(self,
1284
1301
self .min_weight_fraction_leaf = min_weight_fraction_leaf
1285
1302
self .max_features = max_features
1286
1303
self .max_leaf_nodes = max_leaf_nodes
1304
+ self .min_impurity_split = min_impurity_split
1287
1305
1288
1306
1289
1307
class ExtraTreesRegressor (ForestRegressor ):
@@ -1355,6 +1373,10 @@ class ExtraTreesRegressor(ForestRegressor):
1355
1373
If None then unlimited number of leaf nodes.
1356
1374
If not None then ``max_depth`` will be ignored.
1357
1375
1376
+ min_impurity_split : float, optional (default=1e-7)
1377
+ Threshold for early stopping in tree growth. A node will split
1378
+ if its impurity is above the threshold, otherwise it is a leaf.
1379
+
1358
1380
bootstrap : boolean, optional (default=False)
1359
1381
Whether bootstrap samples are used when building trees.
1360
1382
@@ -1419,6 +1441,7 @@ def __init__(self,
1419
1441
min_weight_fraction_leaf = 0. ,
1420
1442
max_features = "auto" ,
1421
1443
max_leaf_nodes = None ,
1444
+ min_impurity_split = 1e-7 ,
1422
1445
bootstrap = False ,
1423
1446
oob_score = False ,
1424
1447
n_jobs = 1 ,
@@ -1430,7 +1453,7 @@ def __init__(self,
1430
1453
n_estimators = n_estimators ,
1431
1454
estimator_params = ("criterion" , "max_depth" , "min_samples_split" ,
1432
1455
"min_samples_leaf" , "min_weight_fraction_leaf" ,
1433
- "max_features" , "max_leaf_nodes" ,
1456
+ "max_features" , "max_leaf_nodes" , "min_impurity_split" ,
1434
1457
"random_state" ),
1435
1458
bootstrap = bootstrap ,
1436
1459
oob_score = oob_score ,
@@ -1446,6 +1469,7 @@ def __init__(self,
1446
1469
self .min_weight_fraction_leaf = min_weight_fraction_leaf
1447
1470
self .max_features = max_features
1448
1471
self .max_leaf_nodes = max_leaf_nodes
1472
+ self .min_impurity_split = min_impurity_split
1449
1473
1450
1474
1451
1475
class RandomTreesEmbedding (BaseForest ):
@@ -1500,6 +1524,10 @@ class RandomTreesEmbedding(BaseForest):
1500
1524
If None then unlimited number of leaf nodes.
1501
1525
If not None then ``max_depth`` will be ignored.
1502
1526
1527
+ min_impurity_split : float, optional (default=1e-7)
1528
+ Threshold for early stopping in tree growth. A node will split
1529
+ if its impurity is above the threshold, otherwise it is a leaf.
1530
+
1503
1531
sparse_output : bool, optional (default=True)
1504
1532
Whether or not to return a sparse CSR matrix, as default behavior,
1505
1533
or to return a dense array compatible with dense pipeline operators.
@@ -1544,6 +1572,7 @@ def __init__(self,
1544
1572
min_samples_leaf = 1 ,
1545
1573
min_weight_fraction_leaf = 0. ,
1546
1574
max_leaf_nodes = None ,
1575
+ min_impurity_split = 1e-7 ,
1547
1576
sparse_output = True ,
1548
1577
n_jobs = 1 ,
1549
1578
random_state = None ,
@@ -1554,7 +1583,7 @@ def __init__(self,
1554
1583
n_estimators = n_estimators ,
1555
1584
estimator_params = ("criterion" , "max_depth" , "min_samples_split" ,
1556
1585
"min_samples_leaf" , "min_weight_fraction_leaf" ,
1557
- "max_features" , "max_leaf_nodes" ,
1586
+ "max_features" , "max_leaf_nodes" , "min_impurity_split" ,
1558
1587
"random_state" ),
1559
1588
bootstrap = False ,
1560
1589
oob_score = False ,
@@ -1570,6 +1599,7 @@ def __init__(self,
1570
1599
self .min_weight_fraction_leaf = min_weight_fraction_leaf
1571
1600
self .max_features = 1
1572
1601
self .max_leaf_nodes = max_leaf_nodes
1602
+ self .min_impurity_split = min_impurity_split
1573
1603
self .sparse_output = sparse_output
1574
1604
1575
1605
def _set_oob_score (self , X , y ):
0 commit comments