  We combine K-Nearest Neighbors (KNN) with genetic algorithm (GA) for
photometric redshift estimation of quasars, short for GeneticKNN, which is a
weighted KNN approach supported by GA. This approach has two improvements
compared to KNN: one is the feature weighted by GA; another is that the
predicted redshift is not the redshift average of K neighbors but the weighted
average of median and mean of redshifts for K neighbors, i.e. $p\times
z_{median} + (1-p)\times z_{mean}$. Based on the SDSS and SDSS-WISE quasar
samples, we explore the performance of GeneticKNN for photometric redshift
estimation, comparing with the other six traditional machine learning methods,
i.e. Least absolute shrinkage and selection operator (LASSO), support vector
regression (SVR), Multi Layer Perceptrons (MLP), XGBoost, KNN and random
forest. KNN and random forest show their superiority. Considering the easy
implementation of KNN, we make improvement on KNN as GeneticKNN and apply
GeneticKNN on photometric redshift estimation of quasars. Finally the
performance of GeneticKNN is better than that of LASSO, SVR, MLP, XGBoost, KNN
and random forest for all cases. Moreover the accuracy is better with the
additional WISE magnitudes for the same method.
