Research Article

A Constructive Data Classification Version of the Particle Swarm Optimization Algorithm

Pseudocode 3

Particle Swarm Classifier (PSClass).
1. procedure X, PLABELS = PSClass (Y, max, , , CLABELS)
2. Y//dataset
3. CLABELS//correct_labels
4. X, V, P, g, , PLABELS = PSC (Y, max, , , CLABELS)
5. while stopping criterion is not met
6.  for to //for each object
7.   for to //for each particle
8.     dist ( ) = distance ( )
9.   end for
10.   I = index (min (dist))
11.   if distance ( ) < distance ( )
12.      =
13.   end if
14.   if distance ( ) < distance ( )
15.      =
16.   end if
17.    = + φ 1 ( ) + ( ) + ( )
18.    max, max
19.   if (PLABELS ( ) == CLABELS ( ))
20.      ( ) = ( ) + ( )
21.   else
22.      ( ) = ( ) −  ( )
23.   end if
24.  end for
25.  
26.  Test the stopping criterion
27. end while
28. end procedure