Question: Question 2 ( 5 0 ) 1 . Write a Python code to implement a Decision tree method. 2 . Create a decision tree for
Question
Write a Python code to implement a Decision tree method.
Create a decision tree for the following datasets with your code
a Iris data set
from sklearn.datasets import loadiris
iris loadiris
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
colnames pregnant 'glucose', bp 'skin', 'insulin', 'bmi', 'pedigree', 'age', 'label'
# load dataset
pima pdreadcsvdiabetescsv headerNone, namescolnames
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
