Question: Implement a decision tree classifier You are an incredibly talented gardner, but you really need to work on your ability to identify different plants. Three

Implement a decision tree classifier

You are an incredibly talented gardner, but you really need to work on your ability to identify different plants. Three flowers in your garden look incredibly similar: Iris-setosa, Iris-virginica, and Iris-versicolor. They look so similar that you decide to use your computer science knowledge to write a classifier that tells you which flower is which. You will be implementing a decision tree classifier for flower classification data.

The dataset required (name Iris.data) is here:

https://pastebin.com/raw/Km7cHCR2

The first four values in each line of this dataset are the values of each of the following four attributes repectively: sepal length, sepal width, petal length, petal width. The last value is the class label: "Iris-setosa", "Iris-viriginica", or "Iris-versicolor."

--------------

Using the provided starter code, implement a decision tree classifier. You should implement the train() function before the classify() function. These two functions are required as written in order to test your code. You are free to implement a decision tree however you wish, as long as you write the algorithm from scratch. Do not use premade packages such as scikit-learn.

I've pasted the starter code here (already formatted).

https://pastebin.com/raw/4bgdnJgW

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!