Hi, I am taking a course on Coursera and came into this question. My answer is 1-(4048+3456)/8124=0.076. However, the answer is 0.067. Anybody can help me to solve this? Thank you!!
Accuracy: The number of correct predictions made divided by the total number of predictions made. We're going to predict the majority class associated with a particular node as True. i.e. use the larger value attribute from each node.
You are getting 100% accuracy because you are using a part of training data for testing. At the time of training, decision tree gained the knowledge about that data, and now if you give same data to predict it will give exactly same value. That's why decision tree producing correct results every time.
Accuracy is a metric used in classification problems used to tell the percentage of accurate predictions. We calculate it by dividing the number of correct predictions by the total number of predictions. This formula provides an easy-to-understand definition that assumes a binary classification problem.
Predicting and accuracy check We can check the accuracy of predicted data by using MSE and RMSE metrics. Finally, we'll visualize the original and predicted data in a plot. Running the above code provides a plot that shows the the original and predicted test data.
Accuracy: The number of correct predictions made divided by the total number of predictions made.
We're going to predict the majority class associated with a particular node as True. i.e. use the larger value attribute from each node.
So the accuracy for:
Depth_2 - Depth_1 = 0.06745
First We will draw confusion metrics for both cases and then find accuracy.
Confusion metrics:
Accuracy= (TP + TN) / (Total number of observation)
Accuracy calculation:
Depth 1: (3796 + 3408) / 8124
Depth 2: (3760 + 512 + 3408 + 72) / 8124
Depth_2 - Depth_1 = 0.06745
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With