"1. In theory for XOR dataset it should suffice to use each feature exactly once with splits at `0`, but the decision tree learning algorithm is unable to find such a solution. Play around with `max_depth` to get a smaller but similarly performing decision tree for the XOR dataset.\n",
"1. In theory for XOR dataset it should suffice to use each feature exactly once with splits at `0`, but the decision tree learning algorithm is unable to find such a solution. Play around with `max_depth` to get a smaller but similarly performing decision tree for the XOR dataset.<br/>\n",
" Bonus question: which other hyperparameter you could have used to get the same result?\n",
"\n",
"2. Build a decision tree for the `\"data/beers.csv\"` dataset. Use maximum depth and tree pruning strategies to get a much smaller tree that performs as well as the default tree.<br/>\n",
" Note: `classifier.tree_` instance has attributes such as `max_depth`, `node_count`, or `n_leaves`, which measure size of the tree."
...
...
@@ -259985,7 +259986,9 @@
" test_features_2d=X_test,\n",
" test_labels=y_test,\n",
" plt=ax,\n",
" )"
" )\n",
"\n",
"# We could have used equivalently `min_impurity_split` early stopping criterium with any (gini) value between 0.15 and 0.4"