<s>
In	O
the	O
field	O
of	O
machine	O
learning	O
and	O
specifically	O
the	O
problem	O
of	O
statistical	B-General_Concept
classification	I-General_Concept
,	O
a	O
confusion	B-General_Concept
matrix	I-General_Concept
,	O
also	O
known	O
as	O
error	O
matrix	B-Architecture
,	O
is	O
a	O
specific	O
table	B-Application
layout	O
that	O
allows	O
visualization	O
of	O
the	O
performance	O
of	O
an	O
algorithm	O
,	O
typically	O
a	O
supervised	B-General_Concept
learning	I-General_Concept
one	O
;	O
in	O
unsupervised	B-General_Concept
learning	I-General_Concept
it	O
is	O
usually	O
called	O
a	O
matching	B-General_Concept
matrix	I-General_Concept
.	O
</s>
<s>
Each	O
row	O
of	O
the	O
matrix	B-Architecture
represents	O
the	O
instances	O
in	O
an	O
actual	O
class	O
while	O
each	O
column	O
represents	O
the	O
instances	O
in	O
a	O
predicted	O
class	O
,	O
or	O
vice	O
versa	O
both	O
variants	O
are	O
found	O
in	O
the	O
literature	O
.	O
</s>
<s>
It	O
is	O
a	O
special	O
kind	O
of	O
contingency	B-Application
table	I-Application
,	O
with	O
two	O
dimensions	O
(	O
"	O
actual	O
"	O
and	O
"	O
predicted	O
"	O
)	O
,	O
and	O
identical	O
sets	O
of	O
"	O
classes	O
"	O
in	O
both	O
dimensions	O
(	O
each	O
combination	O
of	O
dimension	O
and	O
class	O
is	O
a	O
variable	O
in	O
the	O
contingency	B-Application
table	I-Application
)	O
.	O
</s>
<s>
Assume	O
that	O
we	O
have	O
a	O
classifier	B-General_Concept
that	O
distinguishes	O
between	O
individuals	O
with	O
and	O
without	O
cancer	O
in	O
some	O
way	O
,	O
we	O
can	O
take	O
the	O
12	O
individuals	O
and	O
run	O
them	O
through	O
the	O
classifier	B-General_Concept
.	O
</s>
<s>
The	O
classifier	B-General_Concept
then	O
makes	O
9	O
accurate	O
predictions	O
and	O
misses	O
3	O
:	O
2	O
individuals	O
with	O
cancer	O
wrongly	O
predicted	O
as	O
being	O
cancer-free	O
(	O
sample	O
1	O
and	O
2	O
)	O
,	O
and	O
1	O
person	O
without	O
cancer	O
that	O
is	O
wrongly	O
predicted	O
to	O
have	O
cancer	O
(	O
sample	O
9	O
)	O
.	O
</s>
<s>
One	O
,	O
if	O
the	O
actual	O
classification	O
is	O
positive	O
and	O
the	O
predicted	O
classification	O
is	O
positive	O
(	O
1	O
,	O
1	O
)	O
,	O
this	O
is	O
called	O
a	O
true	O
positive	O
result	O
because	O
the	O
positive	O
sample	O
was	O
correctly	O
identified	O
by	O
the	O
classifier	B-General_Concept
.	O
</s>
<s>
Two	O
,	O
if	O
the	O
actual	O
classification	O
is	O
positive	O
and	O
the	O
predicted	O
classification	O
is	O
negative	O
(	O
1	O
,	O
0	O
)	O
,	O
this	O
is	O
called	O
a	O
false	O
negative	O
result	O
because	O
the	O
positive	O
sample	O
is	O
incorrectly	O
identified	O
by	O
the	O
classifier	B-General_Concept
as	O
being	O
negative	O
.	O
</s>
<s>
Third	O
,	O
if	O
the	O
actual	O
classification	O
is	O
negative	O
and	O
the	O
predicted	O
classification	O
is	O
positive	O
(	O
0	O
,	O
1	O
)	O
,	O
this	O
is	O
called	O
a	O
false	O
positive	O
result	O
because	O
the	O
negative	O
sample	O
is	O
incorrectly	O
identified	O
by	O
the	O
classifier	B-General_Concept
as	O
being	O
positive	O
.	O
</s>
<s>
Fourth	O
,	O
if	O
the	O
actual	O
classification	O
is	O
negative	O
and	O
the	O
predicted	O
classification	O
is	O
negative	O
(	O
0	O
,	O
0	O
)	O
,	O
this	O
is	O
called	O
a	O
true	O
negative	O
result	O
because	O
the	O
negative	O
sample	O
gets	O
correctly	O
identified	O
by	O
the	O
classifier	B-General_Concept
.	O
</s>
<s>
We	O
can	O
then	O
perform	O
the	O
comparison	O
between	O
actual	O
and	O
predicted	O
classifications	O
and	O
add	O
this	O
information	O
to	O
the	O
table	B-Application
,	O
making	O
correct	O
results	O
appear	O
in	O
green	O
so	O
they	O
are	O
more	O
easily	O
identifiable	O
.	O
</s>
<s>
The	O
template	O
for	O
any	O
binary	O
confusion	B-General_Concept
matrix	I-General_Concept
uses	O
the	O
four	O
kinds	O
of	O
results	O
discussed	O
above	O
(	O
true	O
positives	O
,	O
false	O
negatives	O
,	O
false	O
positives	O
,	O
and	O
true	O
negatives	O
)	O
along	O
with	O
the	O
positive	O
and	O
negative	O
classifications	O
.	O
</s>
<s>
The	O
four	O
outcomes	O
can	O
be	O
formulated	O
in	O
a	O
2×2	O
confusion	B-General_Concept
matrix	I-General_Concept
,	O
as	O
follows	O
:	O
</s>
<s>
The	O
color	O
convention	O
of	O
the	O
three	O
data	B-Application
tables	I-Application
above	O
were	O
picked	O
to	O
match	O
this	O
confusion	B-General_Concept
matrix	I-General_Concept
,	O
in	O
order	O
to	O
easily	O
differentiate	O
the	O
data	O
.	O
</s>
<s>
Now	O
,	O
we	O
can	O
simply	O
total	O
up	O
each	O
type	O
of	O
result	O
,	O
substitute	O
into	O
the	O
template	O
,	O
and	O
create	O
a	O
confusion	B-General_Concept
matrix	I-General_Concept
that	O
will	O
concisely	O
summarize	O
the	O
results	O
of	O
testing	O
the	O
classifier	B-General_Concept
:	O
</s>
<s>
In	O
this	O
confusion	B-General_Concept
matrix	I-General_Concept
,	O
of	O
the	O
8	O
samples	O
with	O
cancer	O
,	O
the	O
system	O
judged	O
that	O
2	O
were	O
cancer-free	O
,	O
and	O
of	O
the	O
4	O
samples	O
without	O
cancer	O
,	O
it	O
predicted	O
that	O
1	O
did	O
have	O
cancer	O
.	O
</s>
<s>
All	O
correct	O
predictions	O
are	O
located	O
in	O
the	O
diagonal	O
of	O
the	O
table	B-Application
(	O
highlighted	O
in	O
green	O
)	O
,	O
so	O
it	O
is	O
easy	O
to	O
visually	O
inspect	O
the	O
table	B-Application
for	O
prediction	O
errors	O
,	O
as	O
values	O
outside	O
the	O
diagonal	O
will	O
represent	O
them	O
.	O
</s>
<s>
By	O
summing	O
up	O
the	O
2	O
rows	O
of	O
the	O
confusion	B-General_Concept
matrix	I-General_Concept
,	O
one	O
can	O
also	O
deduce	O
the	O
total	O
number	O
of	O
positive	O
(	O
P	O
)	O
and	O
negative	O
(	O
N	O
)	O
samples	O
in	O
the	O
original	O
dataset	O
,	O
i.e.	O
</s>
<s>
In	O
predictive	B-General_Concept
analytics	I-General_Concept
,	O
a	O
table	B-Application
of	O
confusion	O
(	O
sometimes	O
also	O
called	O
a	O
confusion	B-General_Concept
matrix	I-General_Concept
)	O
is	O
a	O
table	B-Application
with	O
two	O
rows	O
and	O
two	O
columns	O
that	O
reports	O
the	O
number	O
of	O
true	O
positives	O
,	O
false	O
negatives	O
,	O
false	O
positives	O
,	O
and	O
true	O
negatives	O
.	O
</s>
<s>
For	O
example	O
,	O
if	O
there	O
were	O
95	O
cancer	O
samples	O
and	O
only	O
5	O
non-cancer	O
samples	O
in	O
the	O
data	O
,	O
a	O
particular	O
classifier	B-General_Concept
might	O
classify	O
all	O
the	O
observations	O
as	O
having	O
cancer	O
.	O
</s>
<s>
The	O
overall	O
accuracy	O
would	O
be	O
95%	O
,	O
but	O
in	O
more	O
detail	O
the	O
classifier	B-General_Concept
would	O
have	O
a	O
100%	O
recognition	O
rate	O
(	O
sensitivity	O
)	O
for	O
the	O
cancer	O
class	O
but	O
a	O
0%	O
recognition	O
rate	O
for	O
the	O
non-cancer	O
class	O
.	O
</s>
<s>
F1	B-General_Concept
score	I-General_Concept
is	O
even	O
more	O
unreliable	O
in	O
such	O
cases	O
,	O
and	O
here	O
would	O
yield	O
over	O
97.4	O
%	O
,	O
whereas	O
informedness	B-General_Concept
removes	O
such	O
bias	O
and	O
yields	O
0	O
as	O
the	O
probability	O
of	O
an	O
informed	O
decision	O
for	O
any	O
form	O
of	O
guessing	O
(	O
here	O
always	O
guessing	O
cancer	O
)	O
.	O
</s>
<s>
According	O
to	O
Davide	O
Chicco	O
and	O
Giuseppe	O
Jurman	O
,	O
the	O
most	O
informative	O
metric	O
to	O
evaluate	O
a	O
confusion	B-General_Concept
matrix	I-General_Concept
is	O
the	O
Matthews	B-General_Concept
correlation	I-General_Concept
coefficient	I-General_Concept
(	O
MCC	O
)	O
.	O
</s>
<s>
Other	O
metrics	O
can	O
be	O
included	O
in	O
a	O
confusion	B-General_Concept
matrix	I-General_Concept
,	O
each	O
of	O
them	O
having	O
their	O
significance	O
and	O
use	O
.	O
</s>
<s>
Confusion	B-General_Concept
matrix	I-General_Concept
is	O
not	O
limited	O
to	O
binary	O
classification	O
and	O
can	O
be	O
used	O
in	O
multi-class	O
classifiers	B-General_Concept
as	O
well	O
.	O
</s>
<s>
For	O
example	O
,	O
the	O
table	B-Application
below	O
summarizes	O
communication	O
of	O
a	O
whistled	O
language	O
between	O
two	O
speakers	O
,	O
zero	O
values	O
omitted	O
for	O
clarity	O
.	O
</s>
