Algorithm 1 Learning Vector Quantization |
Input: |
Sample set ; Suppose that, is the number of prototype vectors, is the initial category of each prototype vector, and is the learning rate. |
Ouput: |
prototype vector
|
1: |
Initialize the prototype vector . |
2: |
Loop |
3: |
Select samples from sample set randomly. |
4: |
Calculate the distance between and :
|
5: |
Find the prototype vector closest to ,
|
6: |
If
|
7: |
|
8: |
Else
|
9: |
|
10: |
End if
|
11: |
Update to
|
12: |
Until the stop criterian is reached |