Question: Code a decision tree using the ID3 algorithm . It should run the following way: python decision.py train_file.csv will have some number of lines with

Code a decision tree using the ID3 algorithm . It should run the following way:

python decision.py

train_file.csv will have some number of lines with some number feature values seperated by commas, followed by a label. So for example [1, 1] with label 0 and [2,3] with label 1 would look like this:

1,1,0

2,3,1

This is your training set. The test_file.csv will simply have one line, the feature vector to be predicted. A file with the vector [1,2] will look like this:

1,2

Your program should print out the classification for the vector in test_file.csv.

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!