Statinfer

203.3.8 Practice : Validating the Tree

Finding the tree accuracy.

Tree Validation

In previous section, we studied about Building a Decision Tree in R

  • Accuracy=(TP+TN)/(TP+FP+FN+TN)
  • Misclassification Rate=(FP+FN)/(TP+FP+FN+TN)

LAB: Tree Validation

  • Find the accuracy of the classification for the Ecom_Cust_Survey model
predicted_values<-predict(Ecom_Tree,type="class")
actual_values<-Ecom_Cust_Survey$Overall_Satisfaction

conf_matrix<-table(predicted_values,actual_values)
conf_matrix
##                 actual_values
## predicted_values Dis Satisfied Satisfied
##    Dis Satisfied          6373       652
##    Satisfied                38      4749
accuracy<-(conf_matrix[1,1]+conf_matrix[2,2])/(sum(conf_matrix))
accuracy
## [1] 0.9415848

The next post is about The Problem of Over Fitting the Decision Tree.

0 responses on "203.3.8 Practice : Validating the Tree"

Leave a Message

Blog Posts

Hurry up!!!

"use coupon code for FLAT 30% discount"  datascientistoffer        ___________________________________      Subscribe to our youtube channel. Get access to video tutorials.                

Contact Us

Statinfer Software Solutions#647 2nd floor 1st Main, Indira Nagar 1st Stage, 100 feet road,Indranagar Bangalore,Karnataka, Pin code:-560038 Landmarks: Opp. Namma Metro Pillar 48.

Connect with us

linkin fn twitter g

How to become a Data Scientist.?

top