You were given a data set “zoo.csv” that includes 101 animals and a list of characteristics of the animals
Need help with this assignment?Get an original answer from a qualified tutor — from $10/page.
Get it written →You were given a data set “zoo.csv” that includes 101 animals and a list of characteristics of the animals
e.g. do they have feather, do they lay eggs or not etc. Build a CART model to classify if an animal is
mammal or not.
(1) Calculate the overall entropy of of the target variable “ismammal”, using the definition H = p1log(p1)+
(1 −p1)log(1 −p1)
(2) To build a classification tree, you need to decide the splitter for each nodes of a binary tree. Using
the criterion that hair > 0.5 and split the dataset in to two branches. Calculate the entropy at each
branch and the average entropy change.
(3) Check the entropy changes for all the following features i.e. ’feathers’, ’eggs’, ’airborne’, ’aquatic’ and
’backbone’. Which one would you use to make the first split?
(4) Build a CART model using the sklearn package and compare the model with your calculation. Is the
first split the same as yours? You may use the python code provided in “CARTmammals.py”
Get a plagiarism-free answer to this question
Send us your instructions and we’ll match you with the best writer in your subject.
- 100% human-written, zero AI
- Turnitin report included
- Confidential — we never share your data
- Free revisions & refunds