Write a program that splits a dataset into training


Problem

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:

1) load the iris.csv dataset
2) create a dataframe, x, using the petal_length and sepal_length as features
3) create a dataframe, y, using species
4) split the data into training and test sets with 0.25 test size and random_state = 0
5) standardize x_train and x_test
6) initialize the decision tree with criterion = "gini", random_state = 100, max_depth=3, min_samples_leaf=5
7) run the decision tree on x_test
8) generate the confusion matrix

Request for Solution File

Ask an Expert for Answer!!
Python Programming: Write a program that splits a dataset into training
Reference No:- TGS03345627

Expected delivery within 24 Hours