Decision Tree (total 14 samples) District House Type Income Previous Outcome Customer Suburban Detached High No Not resp
Posted: Sat May 14, 2022 6:53 pm
Write a Python program for building a decision tree, using
information gain for selecting a node.
You may use Numpy and Pandas (but no other ML libraries).
Use the dataset on page 60 to test your program.
Be sure to comment the program (particularly about the node
split decision, computations of entropy and information gain)
**NEVER USE Sklearn or something, only use NumPy and
Pandas**
Decision Tree (total 14 samples) District House Type Income Previous Outcome Customer Suburban Detached High No Not responded Suburban Detached High Yes Not responded Rural Detached High No Responded Urban Semi-detached High No Responded Urban Low No Responded Semi-detached Semi-detached Urban Low Yes Not responded Rural Semi-detached Low Yes Responded Suburban Terrace High No Not responded Suburban Semi-detached Low No Responded Urban Terrace Low No Responded Suburban Terrace Low Yes Responded Rural Terrace High Yes Responded Rural Detached Low No Responded Urban Terrace High Yes Not responded
information gain for selecting a node.
You may use Numpy and Pandas (but no other ML libraries).
Use the dataset on page 60 to test your program.
Be sure to comment the program (particularly about the node
split decision, computations of entropy and information gain)
**NEVER USE Sklearn or something, only use NumPy and
Pandas**
Decision Tree (total 14 samples) District House Type Income Previous Outcome Customer Suburban Detached High No Not responded Suburban Detached High Yes Not responded Rural Detached High No Responded Urban Semi-detached High No Responded Urban Low No Responded Semi-detached Semi-detached Urban Low Yes Not responded Rural Semi-detached Low Yes Responded Suburban Terrace High No Not responded Suburban Semi-detached Low No Responded Urban Terrace Low No Responded Suburban Terrace Low Yes Responded Rural Terrace High Yes Responded Rural Detached Low No Responded Urban Terrace High Yes Not responded