$30
I. Pen-and-paper [13v]
Four positive observations, {(π΄
0) , (π΅
1) , (π΄1) , (π΄
0)}, and four negative observations, {(π΅
0) , (π΅
0) , (π΄1) , (π΅
1)},
were collected. Consider the problem of classifying observations as positive or negative.
1) [4v] Compute the recall of a distance-weighted πNN with π = 5 and distance π(π±1, π±2) =
π»ππππππ(π±1, π±2)+
1
2
using leave-one-out evaluation schema (i.e., when classifying one
observation, use all remaining ones).
An additional positive observation was acquired, (π΅
0), and
a
third
variable
π¦
3
was
independently
monitored, yielding estimates π¦3|π = {1.2, 0.8, 0.5, 0.9,0.8
}
and
π¦
3|π = {
1
,
0
.9, 1
.
2, 0.8}.
2) [4v] Considering the nine training observations, learn a Bayesian classifier assuming:
i) π¦1 and π¦2 are dependent, ii) {π¦1, π¦2} and {π¦3} variable sets are independent and equally
important, and ii) π¦3 is normally distributed. Show all parameters.
Considering three testing observations, {((0π΄1
.8) , Positive
) ,(
(
π΅
1
1
)
,
Positive
)
,
(
(
π΅
0
0
.9
)
,
Negative
)}.
3) [3v] Under a MAP assumption, compute
π
(Positive
|π±
)
of
each
testing
observation.
4) [2v] Given a binary class variable, the default
decision
threshold
of
π
=
0
.5
,
π(π±|π) = {
Positive π(Positive
|π±) >
π
Negative
otherwise
can be adjusted. Which decision threshold
– 0.3, 0.5 or
0.7 – optimizes
testing accuracy?
II. Programming and critical analysis [7v]
Considering the pd_speech.arff dataset available at the course webpage.
5) [3v] Using sklearn, considering
a
10
-fold
stratified
cross
validation
(random=0
), plot
the
cumulative
testing confusion matrices of
πNN
(uniform
weights,
π =
5, Euclidean
distance)
and
Naïve
Bayes
(Gaussian assumption). Use all
remaining
classifier
parameters
as default.
6) [2v] Using scipy, test the hypothesis “πNN is statistically superior to Naïve Bayes regarding
accuracy”, asserting whether is true.
7) [2v] Enumerate three
possible
reasons
that
could underlie the observed differences in predictive
accuracy between
πNN
and Naïve
Bayes.
END