Question: Part B [ 5 points ] : Build a decision tree classifier using the sklearn toolbox. Then compute metrics for performance like precision and recall.
Part B points : Build a decision tree classifier using the sklearn toolbox. Then compute metrics for performance like precision and recall. This is a binary classification problem, therefore we can label all points as either positive SPAM or negative NOT SPAM
In : def builddtdataX datay maxdepth None, maxleafnodes None:
This function does the following:
Builds the decision tree classifier using sklearn
Fits it to the provided data.
Arguments
dataX a npndarray
datay npndarray
maxdepth None if unrestricted, otherwise an integer for the maximum depth the tree can reach.
Returns:
A trained DecisionTreeClassifier
# your code here
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
