@@ -813,11 +813,23 @@ class RandomForestClassifier(ForestClassifier):
813
813
Best nodes are defined as relative reduction in impurity.
814
814
If None then unlimited number of leaf nodes.
815
815
816
- min_impurity_split : float, optional (default=1e-7 )
817
- Threshold for early stopping in tree growth. A node will split
818
- if its impurity is above the threshold, otherwise it is a leaf .
816
+ min_impurity_decrease : float, optional (default=0. )
817
+ A node will be split if this split induces a decrease of the impurity
818
+ greater than or equal to this value .
819
819
820
- .. versionadded:: 0.18
820
+ The weighted impurity decrease equation is the following::
821
+
822
+ N_t / N * (impurity - N_t_R / N_t * right_impurity
823
+ - N_t_L / N_t * left_impurity)
824
+
825
+ where ``N`` is the total number of samples, ``N_t`` is the number of
826
+ samples at the current node, ``N_t_L`` is the number of samples in the
827
+ left child, and ``N_t_R`` is the number of samples in the right child.
828
+
829
+ ``N``, ``N_t``, ``N_t_R`` and ``N_t_L`` all refer to the weighted sum,
830
+ if ``sample_weight`` is passed.
831
+
832
+ .. versionadded:: 0.19
821
833
822
834
bootstrap : boolean, optional (default=True)
823
835
Whether bootstrap samples are used when building trees.
@@ -922,7 +934,8 @@ def __init__(self,
922
934
min_weight_fraction_leaf = 0. ,
923
935
max_features = "auto" ,
924
936
max_leaf_nodes = None ,
925
- min_impurity_split = 1e-7 ,
937
+ min_impurity_decrease = 0. ,
938
+ min_impurity_split = None ,
926
939
bootstrap = True ,
927
940
oob_score = False ,
928
941
n_jobs = 1 ,
@@ -935,7 +948,8 @@ def __init__(self,
935
948
n_estimators = n_estimators ,
936
949
estimator_params = ("criterion" , "max_depth" , "min_samples_split" ,
937
950
"min_samples_leaf" , "min_weight_fraction_leaf" ,
938
- "max_features" , "max_leaf_nodes" , "min_impurity_split" ,
951
+ "max_features" , "max_leaf_nodes" ,
952
+ "min_impurity_decrease" , "min_impurity_split" ,
939
953
"random_state" ),
940
954
bootstrap = bootstrap ,
941
955
oob_score = oob_score ,
@@ -952,6 +966,7 @@ def __init__(self,
952
966
self .min_weight_fraction_leaf = min_weight_fraction_leaf
953
967
self .max_features = max_features
954
968
self .max_leaf_nodes = max_leaf_nodes
969
+ self .min_impurity_decrease = min_impurity_decrease
955
970
self .min_impurity_split = min_impurity_split
956
971
957
972
@@ -1034,11 +1049,23 @@ class RandomForestRegressor(ForestRegressor):
1034
1049
Best nodes are defined as relative reduction in impurity.
1035
1050
If None then unlimited number of leaf nodes.
1036
1051
1037
- min_impurity_split : float, optional (default=1e-7 )
1038
- Threshold for early stopping in tree growth. A node will split
1039
- if its impurity is above the threshold, otherwise it is a leaf .
1052
+ min_impurity_decrease : float, optional (default=0. )
1053
+ A node will be split if this split induces a decrease of the impurity
1054
+ greater than or equal to this value .
1040
1055
1041
- .. versionadded:: 0.18
1056
+ The weighted impurity decrease equation is the following::
1057
+
1058
+ N_t / N * (impurity - N_t_R / N_t * right_impurity
1059
+ - N_t_L / N_t * left_impurity)
1060
+
1061
+ where ``N`` is the total number of samples, ``N_t`` is the number of
1062
+ samples at the current node, ``N_t_L`` is the number of samples in the
1063
+ left child, and ``N_t_R`` is the number of samples in the right child.
1064
+
1065
+ ``N``, ``N_t``, ``N_t_R`` and ``N_t_L`` all refer to the weighted sum,
1066
+ if ``sample_weight`` is passed.
1067
+
1068
+ .. versionadded:: 0.19
1042
1069
1043
1070
bootstrap : boolean, optional (default=True)
1044
1071
Whether bootstrap samples are used when building trees.
@@ -1112,7 +1139,8 @@ def __init__(self,
1112
1139
min_weight_fraction_leaf = 0. ,
1113
1140
max_features = "auto" ,
1114
1141
max_leaf_nodes = None ,
1115
- min_impurity_split = 1e-7 ,
1142
+ min_impurity_decrease = 0. ,
1143
+ min_impurity_split = None ,
1116
1144
bootstrap = True ,
1117
1145
oob_score = False ,
1118
1146
n_jobs = 1 ,
@@ -1124,7 +1152,8 @@ def __init__(self,
1124
1152
n_estimators = n_estimators ,
1125
1153
estimator_params = ("criterion" , "max_depth" , "min_samples_split" ,
1126
1154
"min_samples_leaf" , "min_weight_fraction_leaf" ,
1127
- "max_features" , "max_leaf_nodes" , "min_impurity_split" ,
1155
+ "max_features" , "max_leaf_nodes" ,
1156
+ "min_impurity_decrease" , "min_impurity_split" ,
1128
1157
"random_state" ),
1129
1158
bootstrap = bootstrap ,
1130
1159
oob_score = oob_score ,
@@ -1140,6 +1169,7 @@ def __init__(self,
1140
1169
self .min_weight_fraction_leaf = min_weight_fraction_leaf
1141
1170
self .max_features = max_features
1142
1171
self .max_leaf_nodes = max_leaf_nodes
1172
+ self .min_impurity_decrease = min_impurity_decrease
1143
1173
self .min_impurity_split = min_impurity_split
1144
1174
1145
1175
@@ -1215,11 +1245,23 @@ class ExtraTreesClassifier(ForestClassifier):
1215
1245
Best nodes are defined as relative reduction in impurity.
1216
1246
If None then unlimited number of leaf nodes.
1217
1247
1218
- min_impurity_split : float, optional (default=1e-7 )
1219
- Threshold for early stopping in tree growth. A node will split
1220
- if its impurity is above the threshold, otherwise it is a leaf .
1248
+ min_impurity_decrease : float, optional (default=0. )
1249
+ A node will be split if this split induces a decrease of the impurity
1250
+ greater than or equal to this value .
1221
1251
1222
- .. versionadded:: 0.18
1252
+ The weighted impurity decrease equation is the following::
1253
+
1254
+ N_t / N * (impurity - N_t_R / N_t * right_impurity
1255
+ - N_t_L / N_t * left_impurity)
1256
+
1257
+ where ``N`` is the total number of samples, ``N_t`` is the number of
1258
+ samples at the current node, ``N_t_L`` is the number of samples in the
1259
+ left child, and ``N_t_R`` is the number of samples in the right child.
1260
+
1261
+ ``N``, ``N_t``, ``N_t_R`` and ``N_t_L`` all refer to the weighted sum,
1262
+ if ``sample_weight`` is passed.
1263
+
1264
+ .. versionadded:: 0.19
1223
1265
1224
1266
bootstrap : boolean, optional (default=False)
1225
1267
Whether bootstrap samples are used when building trees.
@@ -1316,7 +1358,8 @@ def __init__(self,
1316
1358
min_weight_fraction_leaf = 0. ,
1317
1359
max_features = "auto" ,
1318
1360
max_leaf_nodes = None ,
1319
- min_impurity_split = 1e-7 ,
1361
+ min_impurity_decrease = 0. ,
1362
+ min_impurity_split = None ,
1320
1363
bootstrap = False ,
1321
1364
oob_score = False ,
1322
1365
n_jobs = 1 ,
@@ -1329,7 +1372,8 @@ def __init__(self,
1329
1372
n_estimators = n_estimators ,
1330
1373
estimator_params = ("criterion" , "max_depth" , "min_samples_split" ,
1331
1374
"min_samples_leaf" , "min_weight_fraction_leaf" ,
1332
- "max_features" , "max_leaf_nodes" , "min_impurity_split" ,
1375
+ "max_features" , "max_leaf_nodes" ,
1376
+ "min_impurity_decrease" , "min_impurity_split" ,
1333
1377
"random_state" ),
1334
1378
bootstrap = bootstrap ,
1335
1379
oob_score = oob_score ,
@@ -1346,6 +1390,7 @@ def __init__(self,
1346
1390
self .min_weight_fraction_leaf = min_weight_fraction_leaf
1347
1391
self .max_features = max_features
1348
1392
self .max_leaf_nodes = max_leaf_nodes
1393
+ self .min_impurity_decrease = min_impurity_decrease
1349
1394
self .min_impurity_split = min_impurity_split
1350
1395
1351
1396
@@ -1426,11 +1471,23 @@ class ExtraTreesRegressor(ForestRegressor):
1426
1471
Best nodes are defined as relative reduction in impurity.
1427
1472
If None then unlimited number of leaf nodes.
1428
1473
1429
- min_impurity_split : float, optional (default=1e-7 )
1430
- Threshold for early stopping in tree growth. A node will split
1431
- if its impurity is above the threshold, otherwise it is a leaf .
1474
+ min_impurity_decrease : float, optional (default=0. )
1475
+ A node will be split if this split induces a decrease of the impurity
1476
+ greater than or equal to this value .
1432
1477
1433
- .. versionadded:: 0.18
1478
+ The weighted impurity decrease equation is the following::
1479
+
1480
+ N_t / N * (impurity - N_t_R / N_t * right_impurity
1481
+ - N_t_L / N_t * left_impurity)
1482
+
1483
+ where ``N`` is the total number of samples, ``N_t`` is the number of
1484
+ samples at the current node, ``N_t_L`` is the number of samples in the
1485
+ left child, and ``N_t_R`` is the number of samples in the right child.
1486
+
1487
+ ``N``, ``N_t``, ``N_t_R`` and ``N_t_L`` all refer to the weighted sum,
1488
+ if ``sample_weight`` is passed.
1489
+
1490
+ .. versionadded:: 0.19
1434
1491
1435
1492
bootstrap : boolean, optional (default=False)
1436
1493
Whether bootstrap samples are used when building trees.
@@ -1496,7 +1553,8 @@ def __init__(self,
1496
1553
min_weight_fraction_leaf = 0. ,
1497
1554
max_features = "auto" ,
1498
1555
max_leaf_nodes = None ,
1499
- min_impurity_split = 1e-7 ,
1556
+ min_impurity_decrease = 0. ,
1557
+ min_impurity_split = None ,
1500
1558
bootstrap = False ,
1501
1559
oob_score = False ,
1502
1560
n_jobs = 1 ,
@@ -1508,7 +1566,8 @@ def __init__(self,
1508
1566
n_estimators = n_estimators ,
1509
1567
estimator_params = ("criterion" , "max_depth" , "min_samples_split" ,
1510
1568
"min_samples_leaf" , "min_weight_fraction_leaf" ,
1511
- "max_features" , "max_leaf_nodes" , "min_impurity_split" ,
1569
+ "max_features" , "max_leaf_nodes" ,
1570
+ "min_impurity_decrease" , "min_impurity_split" ,
1512
1571
"random_state" ),
1513
1572
bootstrap = bootstrap ,
1514
1573
oob_score = oob_score ,
@@ -1524,6 +1583,7 @@ def __init__(self,
1524
1583
self .min_weight_fraction_leaf = min_weight_fraction_leaf
1525
1584
self .max_features = max_features
1526
1585
self .max_leaf_nodes = max_leaf_nodes
1586
+ self .min_impurity_decrease = min_impurity_decrease
1527
1587
self .min_impurity_split = min_impurity_split
1528
1588
1529
1589
@@ -1584,11 +1644,26 @@ class RandomTreesEmbedding(BaseForest):
1584
1644
Best nodes are defined as relative reduction in impurity.
1585
1645
If None then unlimited number of leaf nodes.
1586
1646
1587
- min_impurity_split : float, optional (default=1e-7 )
1588
- Threshold for early stopping in tree growth. A node will split
1589
- if its impurity is above the threshold, otherwise it is a leaf .
1647
+ min_impurity_decrease : float, optional (default=0. )
1648
+ A node will be split if this split induces a decrease of the impurity
1649
+ greater than or equal to this value .
1590
1650
1591
- .. versionadded:: 0.18
1651
+ The weighted impurity decrease equation is the following::
1652
+
1653
+ N_t / N * (impurity - N_t_R / N_t * right_impurity
1654
+ - N_t_L / N_t * left_impurity)
1655
+
1656
+ where ``N`` is the total number of samples, ``N_t`` is the number of
1657
+ samples at the current node, ``N_t_L`` is the number of samples in the
1658
+ left child, and ``N_t_R`` is the number of samples in the right child.
1659
+
1660
+ ``N``, ``N_t``, ``N_t_R`` and ``N_t_L`` all refer to the weighted sum,
1661
+ if ``sample_weight`` is passed.
1662
+
1663
+ .. versionadded:: 0.19
1664
+
1665
+ bootstrap : boolean, optional (default=True)
1666
+ Whether bootstrap samples are used when building trees.
1592
1667
1593
1668
sparse_output : bool, optional (default=True)
1594
1669
Whether or not to return a sparse CSR matrix, as default behavior,
@@ -1634,7 +1709,8 @@ def __init__(self,
1634
1709
min_samples_leaf = 1 ,
1635
1710
min_weight_fraction_leaf = 0. ,
1636
1711
max_leaf_nodes = None ,
1637
- min_impurity_split = 1e-7 ,
1712
+ min_impurity_decrease = 0. ,
1713
+ min_impurity_split = None ,
1638
1714
sparse_output = True ,
1639
1715
n_jobs = 1 ,
1640
1716
random_state = None ,
@@ -1645,7 +1721,8 @@ def __init__(self,
1645
1721
n_estimators = n_estimators ,
1646
1722
estimator_params = ("criterion" , "max_depth" , "min_samples_split" ,
1647
1723
"min_samples_leaf" , "min_weight_fraction_leaf" ,
1648
- "max_features" , "max_leaf_nodes" , "min_impurity_split" ,
1724
+ "max_features" , "max_leaf_nodes" ,
1725
+ "min_impurity_decrease" , "min_impurity_split" ,
1649
1726
"random_state" ),
1650
1727
bootstrap = False ,
1651
1728
oob_score = False ,
@@ -1661,6 +1738,7 @@ def __init__(self,
1661
1738
self .min_weight_fraction_leaf = min_weight_fraction_leaf
1662
1739
self .max_features = 1
1663
1740
self .max_leaf_nodes = max_leaf_nodes
1741
+ self .min_impurity_decrease = min_impurity_decrease
1664
1742
self .min_impurity_split = min_impurity_split
1665
1743
self .sparse_output = sparse_output
1666
1744
0 commit comments