Uploaded by tareq abudahab

solutions-class

advertisement
Corrected
Uppsala University
Department of Information Technology
Data Mining - exam questions
These questions have been prepared as material for the Data Mining course at Uppsala University. Please do not share them with people not enrolled in the course. The written exam will
contain a selection of these (or similar) questions.
4
Classification
Question 1
Consider the following confusion matrix:
True 0 True 1
Predicted 0 35
30
Predicted 1 10
30
What is the accuracy of the classifier?
A .35
B .78
C .62
D .54
E None of the previous answers
Question 2
Consider the following confusion matrix:
True 0 True 1
Predicted 0 35
30
Predicted 1 10
25
What is the accuracy of the classifier?
A .78
B .35
C .6
D .54
E None of the previous answers
Question 3
Consider the following confusion matrix:
True 0 True 1
Predicted 0 35
20
Predicted 1 20
25
What is the accuracy of the classifier?
A .6
B .78
C .54
D .35
E None of the previous answers
Corrected
Question 4
Consider the following confusion matrix:
True 0 True 1
Predicted 0 35
20
Predicted 1 20
30
What is the accuracy of the classifier?
A .78
B .54
C .62
D .35
E None of the previous answers
Question 5
Consider the following confusion matrix:
True 0 True 1
Predicted 0 35
30
Predicted 1 20
25
where 0 is the positive class. What is the recall of the classifier?
A .35
B .54
C .64
D .78
E None of the previous answers
Question 6
Consider the following confusion matrix:
True 0 True 1
Predicted 0 35
30
Predicted 1 20
25
where 0 is the positive class. What is the recall of the classifier?
A .78
B .44
C .35
D .74
E None of the previous answers
Question 7
Consider the following confusion matrix:
True 0 True 1
Predicted 0 35
20
Predicted 1 20
25
where 0 is the positive class. What is the recall of the classifier?
A .52
B .33
C .64
D .78
E None of the previous answers
Corrected
Question 8
Consider the following confusion matrix:
True 0 True 1
Predicted 0 35
30
Predicted 1 10
25
where 0 is the positive class. What is the recall of the classifier?
A .6
B .54
C .78
D .35
E None of the previous answers
Question 9
Consider the following confusion matrix:
True 0 True 1
Predicted 0 35
30
Predicted 1 10
25
where 0 is the positive class. What is the precision of the classifier?
A .6
B .54
C .35
D .78
E None of the previous answers
Question 10
Which of the following is the definition of precision?
A
TP
T P +F P +T N +F N
B
TP
F P +T N
C
TP
T P +F N
D
TP
F P +F N
E
TP
T P +T N
F None of the previous answers
Question 11
Predicted 0
Predicted 1
Consider
True 0
35
10
the following confusion matrix:
True 1
25
30
where 0 is the positive class. What is the precision of the classifier?
A .25
B .78
C .35
D .68
E None of the previous answers
Corrected
Question 12
Which of the following is the definition of precision?
A
TP
T P +F P
B
TP
F P +F N
C
TP
T P +T N
D
TP
T P +F P +T N +F N
E
TP
F P +T N
F None of the previous answers
Question 13
Predicted 0
Predicted 1
Consider
True 0
35
10
the following confusion matrix:
True 1
30
30
where 0 is the positive class. What is the precision of the classifier?
A .78
B .6
C .54
D .35
E None of the previous answers
Question 14
Predicted 0
Predicted 1
Consider
True 0
35
10
the following confusion matrix:
True 1
25
30
where 0 is the positive class. What is the precision of the classifier?
A .58
B .78
C .6
D .35
E None of the previous answers
Question 15
How is the entropy of a node t defined, as used in the C4.5 algorithm? (in the
following definitions C is the set of all classes and p(c|t) is the frequency of class c at node t)
P
A
c∈C 1 − max(p(c|t))
P
B
c∈C p(c|t) log p(c|t)
P
C
c∈C log p(c|t)
P
D
c∈C 1 − min(p(c|t))
P
E − c∈C p(c|t) log p(c|t)
P
F
c∈C max(p(c|t))
P
G
c∈C p(c|t)
H None of the previous answers
Corrected
Question 16
How is the entropy of a node t defined, as used in the C4.5 algorithm? (in the
following definitions C is the set of all classes and p(c|t) is the frequency of class c at node t)
P
A
c∈C p(c|t)
P
B
c∈C 1 − max(p(c|t))
P
C
c∈C log p(c|t)
P
D
c∈C max(p(c|t))
P
E
c∈C p(c|t) log p(c|t)
P
F
c∈C 1 − min(p(c|t))
P
G − c∈C min(p(c|t))
H None of the previous answers
Question 17
Consider a decision tree where a node has been split into two leaves. The first
leaf contains 5 records, 2 of class c0 and 3 of class c1. The second leaf contains 5 records, 4 of class
c0 and 1 of class c1. What is the classification error of this split?
A .25
B .55
C .15
D .30
E .40
F None of the previous answers
Question 18
Consider a decision tree where a node has been split into two leaves. The first
leaf contains 5 records, 3 of class c0 and 2 of class c1. The second leaf contains 5 records, 5 of class
c0 and 0 of class c1. What is the classification error of this split?
A .3
B .2
C .1
D .4
E .5
F None of the previous answers
Question 19
Consider a decision tree where a node has been split into two leaves. The first
leaf contains 4 records, 2 of class c0 and 2 of class c1. The second leaf contains 4 records, 4 of class
c0 and 0 of class c1. What is the classification error of this split?
A .25
B .30
C .15
D .40
E .55
F None of the previous answers
Corrected
Question 20 Which of the following methods partitions the dataset into a training and a test
set (that is, each record is used only once and is included either in the training or in the test set)?
A k-fold validation
B Boosting
C Bagging
D Leave one out
E Bootstrap
F None of the previous answers
Question 21 Which of the following methods partitions the dataset into a training and a test
set (that is, each record is used only once and is included either in the training or in the test set)?
A Leave one out
B Bootstrap
C Cross validation
D Holdout
E k-fold validation
F None of the previous answers
Question 22
In boosting, records that are wrongly classified in previous rounds
A do not change their probability of being included in the test set.
B do not change their probability of being included in the training set.
C always have their weights increased.
D always have their weights decreased.
E None of the previous answers
Question 23
In bagging, records that are wrongly classified in previous rounds
A always have their weights decreased.
B always have their weights increased.
C may have their weights increased.
D do not change their probability of being included in the training set.
E None of the previous answers
Question 24
Assume to have an ordinal attribute (which is not the class label) in your dataset,
and that you decide to transform it into a numerical attribute, preserving the order. How will this
affect the construction of a decision tree using the C4.5 algorithm?
A Decision trees are only defined for nominal and numerical attributes, so the transformation
is necessary to build the tree.
B The resulting tree will be the same, but it will be much faster to produce it because with
numerical attributes we do not have to check all combinations of values.
C This transformation has no effect on decision trees
D The resulting tree will be the same, but it will take a significantly longer time to produce it
because numerical attributes have a larger number of possible splitting values.
E None of the previous answers
Corrected
Question 25
Which of the following does not have an impact on the complexity of the k-NN
algorithm during a classification process?
A The number of records in the training data
B The parameter k
C The number of attributes
D None of the other answers
Consider the following training set TRAIN:
a1
13
5
10
14
9
a2
1
5
3
4
2
a3
19
1
9
13
20
Class
C1
C1
C1
C2
C2
Question 26
What are the distinct GINI impurities for all possible binary splits of attribute
a1? (of course, do not consider splits generating empty nodes)
A .3, .4
B .27, .4
C .27, .3, .4, .47
D .4, .47
E .3, .4, .47
F None of the previous answers
Question 27
Which attribute would be chosen for the first split in a decision tree learning
algorithm, using GINI and binary splits?
A a1
B a1 or a2
C a2 or a3
D a1 or a3
E a2
F a3
G None of the previous answers
Question 28
What are the distinct GINI impurities for all possible binary splits of attribute
a3? (of course, do not consider splits generating empty nodes)
A .27, .4
B .4, .47
C .27, .3, .4, .47
D .3, .4
E .3, .4, .47
F None of the previous answers
Corrected
Question 29
What are the distinct GINI impurities for all possible binary splits of attribute
a2? (of course, do not consider splits generating empty nodes)
A .27, .4
B .4, .47
C .3, .4, .47
D .27, .3, .4, .47
E .3, .4
F None of the previous answers
Question 30
What are the distinct classification errors for all possible binary splits of attribute
a3? (of course, do not consider splits generating empty nodes)
A .2, .4
B 0, .2, .4
C 0, .2
D 0, .4
E .2, .4, .6
F None of the previous answers
Question 31
What are the distinct classification errors for all possible binary splits of attribute
a1? (of course, do not consider splits generating empty nodes)
A 0, .2
B .4
C 0, .4
D .2, .4, .6
E 0, .2, .4
F None of the previous answers
Question 32
What are the distinct classification errors for all possible binary splits of attribute
a2? (of course, do not consider splits generating empty nodes)
A 0, .4
B 0, .2
C 0, .2, .4
D .2, .4, .6
E .4
F None of the previous answers
Question 33
Which attribute would be chosen for the first split in a decision tree learning
algorithm, using classification errors and binary splits?
A a1
B a2 or a3
C a3
D a1 or a2
E a1 or a3
F a2
G None of the previous answers
Corrected
Now consider the following training set TEST:
a1
7
11
a2
2
4
a3
10
6
Class
C1
C1
Question 34
What is the classification error of a 3-NN classifier with distance-based weighting
trained on TRAIN and tested on TEST? (use Manhattan distance)
A 3/6
B 2/6
C 5/6
D 4/6
E 6/6
F 0
G 1/6
H None of the other answers
Question 35
What is the classification error of a 1-NN classifier trained on TRAIN and tested
on TEST? (use Manhattan distance)
A 6/6
B 5/6
C 1/6
D 4/6
E 0
F 2/6
G 3/6
H None of the other answers
Question 36
What is the classification error of a 3-NN classifier with majority voting trained
on TRAIN and tested on TEST? (use Manhattan distance)
A 1/6
B 2/6
C 4/6
D 0
E 6/6
F 5/6
G 3/6
H None of the other answers
Consider the following training set TRAIN:
a1
13
10
5
14
9
a2
1
2
3
4
5
a3
19
10
9
13
8
Class
C1
C1
C1
C2
C2
Corrected
Question 37
Which attribute would be chosen for the first split in a decision tree learning
algorithm, using GINI and binary splits?
A a1
B a2
C a1 or a3
D a1 or a2
E a2 or a3
F a3
G None of the previous answers
Question 38
What are the distinct GINI impurities for all possible binary splits of attribute
a2? (of course, do not consider splits generating empty nodes)
A .27, .4
B .4, .47
C .3, .4, .47
D .3, .4
E .27, .3, .4, .47
F None of the previous answers
Question 39
What are the distinct GINI impurities for all possible binary splits of attribute
a3? (of course, do not consider splits generating empty nodes)
A .3, .4
B .3, .4, .47
C .27, .3, .4, .47
D .27, .4
E .4, .47
F None of the previous answers
Question 40
What are the distinct GINI impurities for all possible binary splits of attribute
a1? (of course, do not consider splits generating empty nodes)
A .3, .4, .47
B .27, .4
C .3, .4
D .27, .3, .4, .47
E .4, .47
F None of the previous answers
Question 41
What are the distinct classification errors for all possible binary splits of attribute
a3? (of course, do not consider splits generating empty nodes)
A 0, .4
B .2, .4
C .2, .4, .6
D 0, .2
E 0, .2, .4
F None of the previous answers
Corrected
Question 42
Which attribute would be chosen for the first split in a decision tree learning
algorithm, using classification errors and binary splits?
A a1
B a2 or a3
C a2
D a3
E a1 or a3
F a1 or a2
G None of the previous answers
Question 43
What are the distinct classification errors for all possible binary splits of attribute
a2? (of course, do not consider splits generating empty nodes)
A 0, .2
B 0, .4
C .2, .4, .6
D .2
E 0, .2, .4
F None of the previous answers
Question 44
What are the distinct classification errors for all possible binary splits of attribute
a1? (of course, do not consider splits generating empty nodes)
A 0, .4
B 0, .2
C 0, .2, .4
D .2, .4, .6
E .2, .4
F None of the previous answers
Now consider the following training set TEST:
a1
7
12
a2
2
4
a3
10
8
Class
C1
C1
Question 45
What is the classification error of a 3-NN classifier with distance-based weighting
trained on TRAIN and tested on TEST? (use Manhattan distance)
A 3/6
B 2/6
C 0
D 5/6
E 6/6
F 1/6
G 4/6
H None of the other answers
Corrected
Question 46
What is the classification error of a 3-NN classifier with majority voting trained
on TRAIN and tested on TEST? (use Manhattan distance)
A 0
B 1/6
C 2/6
D 4/6
E 6/6
F 3/6
G 5/6
H None of the other answers
Question 47
What is the classification error of a 1-NN classifier trained on TRAIN and tested
on TEST? (use Manhattan distance)
A 6/6
B 3/6
C 2/6
D 0
E 1/6
F 4/6
G 5/6
H None of the other answers
Consider the following training set TRAIN:
a1
13
10
5
14
9
a2
1
2
3
4
5
a3
19
10
9
13
8
Class
C1
C1
C1
C2
C2
Question 48
What are the distinct GINI impurities for all possible binary splits of attribute
a2? (of course, do not consider splits generating empty nodes)
A .27, .4
B .3, .47
C .3, .4
D .4, .47
E 0, .27, .3, .4
F None of the previous answers
Corrected
Question 49
What are the distinct GINI impurities for all possible binary splits of attribute
a3? (of course, do not consider splits generating empty nodes)
A .4, .47
B .3, .4, .47
C 0, .27, .3, .4
D .27, .4
E .3, .4
F None of the previous answers
Question 50
Which attribute would be chosen for the first split in a decision tree learning
algorithm, using GINI and binary splits?
A a1 or a3
B a1
C a2
D a1 or a2
E a2 or a3
F a3
G None of the previous answers
Question 51
What are the distinct classification errors for all possible binary splits of attribute
a1? (of course, do not consider splits generating empty nodes)
A 0, .2
B 0, .2, .4
C .2, .4, .6
D 0, .4
E .2, .4
F None of the previous answers
Question 52
What are the distinct classification errors for all possible binary splits of attribute
a2? (of course, do not consider splits generating empty nodes)
A 0, .4
B .2, .4
C .2, .4, .6
D 0, .2
E 0, .2, .4
F None of the previous answers
Question 53
What are the distinct classification errors for all possible binary splits of attribute
a3? (of course, do not consider splits generating empty nodes)
A .2, .6
B 0, .2, .4
C 0, .4
D 0, .2
E .2, .4, .6
F None of the previous answers
Corrected
Question 54
Which attribute would be chosen for the first split in a decision tree learning
algorithm, using classification errors and binary splits?
A a1 or a2
B a1
C a3
D a2 or a3
E a1 or a3
F a2
G None of the previous answers
Now consider the following training set TEST:
a1
11
12
a2
4
5
a3
11
12
Class
C1
C1
Question 55
What is the classification error of a 1-NN classifier trained on TRAIN and tested
on TEST? (use Manhattan distance)
A 1/6
B 5/6
C 0
D 2/6
E 4/6
F 3/6
G 6/6
H None of the other answers
Question 56
What is the classification error of a 3-NN classifier with distance-based weighting
trained on TRAIN and tested on TEST? (use Manhattan distance)
A 6/6
B 1/6
C 0
D 5/6
E 2/6
F 4/6
G 3/6
H None of the other answers
Corrected
Question 57
What is the classification error of a 3-NN classifier with majority voting trained
on TRAIN and tested on TEST? (use Manhattan distance)
A 1/6
B 2/6
C 4/6
D 5/6
E 0
F 3/6
G 6/6
H None of the other answers
Download