You were given a data set “zoo.csv” that includes 101 animals and a list of characteristics of the animals
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”
Collepals.com Plagiarism Free Papers
Are you looking for custom essay writing service or even dissertation writing services? Just request for our write my paper service, and we'll match you with the best essay writer in your subject! With an exceptional team of professional academic experts in a wide range of subjects, we can guarantee you an unrivaled quality of custom-written papers.
Get ZERO PLAGIARISM, HUMAN WRITTEN ESSAYS
Why Hire Collepals.com writers to do your paper?
Quality- We are experienced and have access to ample research materials.
We write plagiarism Free Content
Confidential- We never share or sell your personal information to third parties.
Support-Chat with us today! We are always waiting to answer all your questions.
