<s>
Large	B-Algorithm
margin	I-Algorithm
nearest	I-Algorithm
neighbor	I-Algorithm
(	O
LMNN	B-Algorithm
)	O
classification	O
is	O
a	O
statistical	O
machine	O
learning	O
algorithm	O
for	O
metric	B-General_Concept
learning	I-General_Concept
.	O
</s>
<s>
It	O
learns	O
a	O
pseudometric	O
designed	O
for	O
k-nearest	B-General_Concept
neighbor	I-General_Concept
classification	O
.	O
</s>
<s>
The	O
goal	O
of	O
supervised	B-General_Concept
learning	I-General_Concept
(	O
more	O
specifically	O
classification	O
)	O
is	O
to	O
learn	O
a	O
decision	O
rule	O
that	O
can	O
categorize	O
data	O
instances	O
into	O
pre-defined	O
classes	O
.	O
</s>
<s>
The	O
k-nearest	B-General_Concept
neighbor	I-General_Concept
rule	O
assumes	O
a	O
training	O
data	O
set	O
of	O
labeled	O
instances	O
(	O
i.e.	O
</s>
<s>
Large	B-Algorithm
margin	I-Algorithm
nearest	I-Algorithm
neighbors	I-Algorithm
is	O
an	O
algorithm	O
that	O
learns	O
this	O
global	O
(	O
pseudo	O
-	O
)	O
metric	O
in	O
a	O
supervised	O
fashion	O
to	O
improve	O
the	O
classification	O
accuracy	O
of	O
the	O
k-nearest	B-General_Concept
neighbor	I-General_Concept
rule	O
.	O
</s>
<s>
The	O
main	O
intuition	O
behind	O
LMNN	B-Algorithm
is	O
to	O
learn	O
a	O
pseudometric	O
under	O
which	O
all	O
data	O
instances	O
in	O
the	O
training	O
set	O
are	O
surrounded	O
by	O
at	O
least	O
k	O
instances	O
that	O
share	O
the	O
same	O
class	O
label	O
.	O
</s>
<s>
If	O
this	O
is	O
achieved	O
,	O
the	O
leave-one-out	B-General_Concept
error	I-General_Concept
(	O
a	O
special	O
case	O
of	O
cross	B-Application
validation	I-Application
)	O
is	O
minimized	O
.	O
</s>
<s>
For	O
to	O
be	O
well	O
defined	O
,	O
the	O
matrix	O
needs	O
to	O
be	O
positive	B-Algorithm
semi-definite	I-Algorithm
.	O
</s>
<s>
The	O
target	O
neighbors	O
are	O
the	O
data	O
points	O
that	O
should	O
become	O
nearest	B-General_Concept
neighbors	I-General_Concept
under	O
the	O
learned	O
metric	O
.	O
</s>
<s>
which	O
is	O
one	O
of	O
the	O
nearest	B-General_Concept
neighbors	I-General_Concept
of	O
.	O
</s>
<s>
Large	B-Algorithm
margin	I-Algorithm
nearest	I-Algorithm
neighbors	I-Algorithm
optimizes	O
the	O
matrix	O
with	O
the	O
help	O
of	O
semidefinite	O
programming	O
.	O
</s>
<s>
If	O
it	O
was	O
a	O
test	O
point	O
,	O
it	O
would	O
be	O
classified	O
correctly	O
under	O
the	O
nearest	B-General_Concept
neighbor	I-General_Concept
rule	O
.	O
</s>
<s>
With	O
a	O
hinge	B-Algorithm
loss	I-Algorithm
function	O
,	O
which	O
ensures	O
that	O
impostor	O
proximity	O
is	O
not	O
penalized	O
when	O
outside	O
the	O
margin	O
.	O
</s>
<s>
The	O
hyperparameter	O
is	O
some	O
positive	O
constant	O
(	O
typically	O
set	O
through	O
cross-validation	B-Application
)	O
.	O
</s>
<s>
They	O
play	O
a	O
role	O
similar	O
to	O
slack	B-Algorithm
variables	I-Algorithm
to	O
absorb	O
the	O
extent	O
of	O
violations	O
of	O
the	O
impostor	O
constraints	O
.	O
</s>
<s>
The	O
last	O
constraint	O
ensures	O
that	O
is	O
positive	B-Algorithm
semi-definite	I-Algorithm
.	O
</s>
<s>
A	O
particularly	O
well	O
suited	O
solver	O
technique	O
is	O
the	O
working	B-General_Concept
set	I-General_Concept
method	O
,	O
which	O
keeps	O
a	O
small	O
set	O
of	O
constraints	O
that	O
are	O
actively	O
enforced	O
and	O
monitors	O
the	O
remaining	O
(	O
likely	O
satisfied	O
)	O
constraints	O
only	O
occasionally	O
to	O
ensure	O
correctness	O
.	O
</s>
<s>
LMNN	B-Algorithm
was	O
extended	O
to	O
multiple	O
local	O
metrics	O
in	O
the	O
2008	O
paper	O
.	O
</s>
<s>
An	O
open	B-Application
source	I-Application
Matlab	B-Language
implementation	O
is	O
freely	O
available	O
at	O
the	O
.	O
</s>
