Set max_features="sqrt" in Decision Tree rather than BaggingClassifier
parent
33f9ff10b4
commit
e10a807907
|
@ -327,11 +327,9 @@
|
||||||
"metadata": {},
|
"metadata": {},
|
||||||
"outputs": [],
|
"outputs": [],
|
||||||
"source": [
|
"source": [
|
||||||
"from math import ceil, sqrt\n",
|
|
||||||
"\n",
|
|
||||||
"bag_clf = BaggingClassifier(\n",
|
"bag_clf = BaggingClassifier(\n",
|
||||||
" DecisionTreeClassifier(max_leaf_nodes=16),\n",
|
" DecisionTreeClassifier(max_features=\"sqrt\", max_leaf_nodes=16),\n",
|
||||||
" n_estimators=500, max_features=ceil(sqrt(X_train.shape[1])), random_state=42)"
|
" n_estimators=500, random_state=42)"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue