1The following decision tree has been created to predict if someone will buy a c
ID: 3683221 • Letter: 1
Question
1The following decision tree has been created to predict if someone will buy a computer.
a.Convert this tree to if then rules
b:Using the following testing data:
i. Predict the class of each record
ii. Calculate the accuracy of this model.
age
income
Student
credit_rating
buys_computer
Prediction
1
<=30
high
No
Fair
no
2
<=30
high
No
Excellent
yes
3
31…40
high
No
Fair
yes
4
>40
medium
No
Fair
no
5
>40
low
Yes
Fair
yes
6
>40
low
Yes
Excellent
no
7
31…40
low
Yes
Excellent
no
8
<=30
medium
No
Fair
no
9
<=30
low
Yes
Fair
yes
10
>40
medium
Yes
Fair
no
age?Explanation / Answer
a.Convert this tree to if then rules
Ans) Rules :
B1. Predict the class of each record:
Ans)
age
income
Student
credit_rating
buys_computer
Prediction
1
<=30
high
No
Fair
no
no
2
<=30
high
No
Excellent
yes
no
3
31…40
high
No
Fair
yes
yes
4
>40
medium
No
Fair
no
yes
5
>40
low
Yes
Fair
yes
yes
6
>40
low
Yes
Excellent
no
no
7
31…40
low
Yes
Excellent
no
yes
8
<=30
medium
No
Fair
no
no
9
<=30
low
Yes
Fair
yes
yes
10
>40
medium
Yes
Fair
No
yes
b2. Calculate the accuracy of this model.:
Accuracy = Number of correct predictions
Total number of predictions
Accuracy=6/10 =0.6
age
income
Student
credit_rating
buys_computer
Prediction
1
<=30
high
No
Fair
no
no
2
<=30
high
No
Excellent
yes
no
3
31…40
high
No
Fair
yes
yes
4
>40
medium
No
Fair
no
yes
5
>40
low
Yes
Fair
yes
yes
6
>40
low
Yes
Excellent
no
no
7
31…40
low
Yes
Excellent
no
yes
8
<=30
medium
No
Fair
no
no
9
<=30
low
Yes
Fair
yes
yes
10
>40
medium
Yes
Fair
No
yes
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.