Question: Question 2 ( 5 0 ) 1 . Write a Python code to implement a Decision tree method. 2 . Create a decision tree for

Question 2(50)
1. Write a Python code to implement a Decision tree method.
2. Create a decision tree for the following datasets with your code
a. Iris data set
from sklearn.datasets import load_iris
iris = load_iris()
b. Diabetes Dataset
Download the dataset and load it with the following code
*I took out the website name that had the downloadable csv file so can you please just put a place holder for that in the python code, thank you*
import pandas as pd
col_names =['pregnant', 'glucose', 'bp', 'skin', 'insulin', 'bmi', 'pedigree', 'age', 'label']
# load dataset
pima = pd.read_csv("diabetes.csv", header=None, names=col_names)

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!