Question
Train and fine-tune a Decision Tree for the moons dataset by following these steps: 1.Use make_moons(n_samples=10000, noise=0.4) to generate a moons dataset. 2.Use train_test_split() to
Train and fine-tune a Decision Tree for the moons dataset by following these steps:
1.Use make_moons(n_samples=10000, noise=0.4) to generate a moons dataset.
2.Use train_test_split() to split the dataset into a training set and a test set.
3.Use grid search with cross-validation (with the help of the GridSearchCV class) to find good hyperparameter values for a DecisionTreeClassifier. Hint: try various values for max_leaf_nodes.
4.Train it on the full training set using these hyperparameters, and measure your models performance on the test set. You should get roughly 85% to 87% accuracy.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started