Question: THE OUTPUT MUST BE EXACTLY THE SAME! Write a program that splits a dataset into training and test set, builds a classification tree, and outputs
THE OUTPUT MUST BE EXACTLY THE SAME!

Write a program that splits a dataset into training and test set, builds a classification tree, and outputs a confusion matrix. The program should do the following: - load the iris.csv dataset - create a dataframe, x, using the petal_length and sepal_length as features - create a dataframe, y, using species - split the data into training and test sets with 0.25 test size and random_state =0 - standardize x_train and x_test - initialize the decision tree with criterion = "gini", random_state =100, max_depth=3, min_samples_leaf=5 - run the decision tree on x test - generate the confusion matrix The output should be: [1300][0151][036]
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
