Gene expression data classification has been considered to be an important method for treatment and diagnoses in cancer research. In this study, basic particle swarm optimization (PSO) was proposed to make classification as both of the training and testing procedures. 38 and 34 leukemia samples that each contained 50 same genes were chosen separately as training and testing dataset. K-means clustering algorithm was used to establish a comparison procedure. Another group of 200 genes were also used for further comparison of the two algorithms. In conclusion, the performance of PSO is better than K-means, while the stability is in reverse.