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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!