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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started