Question: Please solve this it in Python and make the Calculations shown as much as possible. make it readable by Google Collaboratory Decision Tree: A sample
Please solve this it in Python and make the Calculations shown as much as possible. make it readable by Google Collaboratory
Decision Tree:
A sample training dataset for decision trees is given as follows.
a Using this data set, create the most appropriate Decision Tree by making Information
Gain and entropy calculations. Show all steps and calculations
b Draw this decision tree.
c When you consider the following Test Data set
Show the Confusion Matrix?
Calculate the Recall Value?
Calculate the Precision Value
its give me this error:
ValueError Traceback most recent call last
in
tree buildtreedf df dfcolumns:
clf DecisionTreeClassifiercriterion"entropy"
clffitdfdropClass axis dfClass
predictions clfpredicttestdf
frames
usrlocallibpythondistpackagespandascoregenericpy in arrayself dtype
def arrayself dtype: nptDTypeLike None None npndarray:
values self.values
arr npasarrayvalues dtypedtype
if
astypeisviewvaluesdtype, arr.dtype
ValueError: could not convert string to float: 'Small'
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
