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
Decision Tree (total 14 samples) District House Type Income Previous Outcome Customer Suburban Detached High No Not resp
-
answerhappygod
- Site Admin
- Posts: 899604
- Joined: Mon Aug 02, 2021 8:13 am
Decision Tree (total 14 samples) District House Type Income Previous Outcome Customer Suburban Detached High No Not resp
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!