# Learning vector quantization

In computer science, learning vector quantization (LVQ), is a prototype-based supervised classification algorithm. LVQ is the supervised counterpart of vector quantization systems.

## Overview

LVQ can be understood as a special case of an artificial neural network, more precisely, it applies a winner-take-all Hebbian learning-based approach. It is a precursor to self-organizing maps (SOM) and related to neural gas, and to the k-nearest neighbor algorithm (k-NN). LVQ was invented by Teuvo Kohonen.[1]

An LVQ system is represented by prototypes ${\displaystyle W=(w(i),...,w(n))}$ which are defined in the feature space of observed data. In winner-take-all training algorithms one determines, for each data point, the prototype which is closest to the input according to a given distance measure. The position of this so-called winner prototype is then adapted, i.e. the winner is moved closer if it correctly classifies the data point or moved away if it classifies the data point incorrectly.

An advantage of LVQ is that it creates prototypes that are easy to interpret for experts in the respective application domain.[2] LVQ systems can be applied to multi-class classification problems in a natural way. It is used in a variety of practical applications. See http://liinwww.ira.uka.de/bibliography/Neural/SOM.LVQ.html for an extensive bibliography.

A key issue in LVQ is the choice of an appropriate measure of distance or similarity for training and classification. Recently, techniques have been developed which adapt a parameterized distance measure in the course of training the system, see e.g. (Schneider, Biehl, and Hammer, 2009)[3] and references therein.

LVQ can be a source of great help in classifying text documents.[4]

## Algorithm

Below follows an informal description.
The algorithm consists of 3 basic steps. The algorithm's input is:

• how many neurons the system will have ${\displaystyle M}$ (in the simplest case it is equal to the number of classes)
• what weight each neuron has ${\displaystyle {\vec {w_{i}}}}$ for ${\displaystyle i=0,1,...,M-1}$
• the corresponding label ${\displaystyle c_{i}}$ to each neuron ${\displaystyle {\vec {w_{i}}}}$
• how fast the neurons are learning ${\displaystyle \eta }$
• and an input list ${\displaystyle L}$ containing all the vectors of which the labels are known already (training set).

The algorithm's flow is:

1. For next input ${\displaystyle {\vec {x}}}$ in ${\displaystyle L}$ find the closest neuron ${\displaystyle {\vec {w_{m}}}}$,
i.e. ${\displaystyle d({\vec {x}},{\vec {w_{m}}})=\min \limits _{i}{d({\vec {x}},{\vec {w_{i}}})}}$, where ${\displaystyle \,d}$ is the metric used ( Euclidean, etc. ).
2. Update ${\displaystyle {\vec {w_{m}}}}$. A better explanation is get ${\displaystyle {\vec {w_{m}}}}$ closer to the input ${\displaystyle {\vec {x}}}$, if ${\displaystyle {\vec {x}}}$ and ${\displaystyle {\vec {w_{m}}}}$ belong to the same label and get them further apart if they don't.
${\displaystyle {\vec {w_{m}}}\gets {\vec {w_{m}}}+\eta \cdot \left({\vec {x}}-{\vec {w_{m}}}\right)}$ (closer together)
or ${\displaystyle {\vec {w_{m}}}\gets {\vec {w_{m}}}-\eta \cdot \left({\vec {x}}-{\vec {w_{m}}}\right)}$ (further apart).
3. While there are vectors left in ${\displaystyle L}$ go to step 1, else terminate.

Note: ${\displaystyle {\vec {w_{i}}}}$ and ${\displaystyle {\vec {x}}}$ are vectors in feature space.
A more formal description can be found here: http://jsalatas.ictpro.gr/implementation-of-competitive-learning-networks-for-weka/

## References

1. ^ T. Kohonen. Self-Organizing Maps. Springer, Berlin, 1997.
2. ^ T. Kohonen (1995), "Learning vector quantization", in M.A. Arbib, The Handbook of Brain Theory and Neural Networks, Cambridge, MA: MIT Press, pp. 537–540
3. ^ P. Schneider, B. Hammer, and M. Biehl (2009). "Adaptive Relevance Matrices in Learning Vector Quantization". Neural Computation. 21 (10): 3532–3561. CiteSeerX 10.1.1.216.1183. doi:10.1162/neco.2009.10-08-892. PMID 19635012.CS1 maint: Uses authors parameter (link)
4. ^ Fahad and Sikander (2007). "Classification of textual documents using learning vector quantization" (PDF). Information Technology Journal. 6 (1): 154–159. doi:10.3923/itj.2007.154.159. Archived from the original (PDF) on 2014-08-09.CS1 maint: Uses authors parameter (link)