Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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!

image text in transcribed

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Demystifying Databases A Hands On Guide For Database Management

Authors: Shiva Sukula

1st Edition

8170005345, 978-8170005346

More Books

Students also viewed these Databases questions

Question

Identify four applications of HRM to healthcare organizations.

Answered: 1 week ago