Aiming at improving localization accuracy in Wireless Sensor Networks (WSN) based on Least Square Support Vector Regression (LSSVR), making LSSVR localization method more practicable, the mechanism of effects of the kernel function for target localization based on LSSVR is discussed based on the mathematical solution process of LSSVR localization method. A novel method of modeling parameters optimization for LSSVR model using particle swarm optimization is proposed. Construction method of fitness function for modeling parameters optimization is researched. In addition, the characteristics of particle swarm parameters optimization are analyzed. The computational complexity of parameters optimization is taken into consideration comprehensively. Experiments of target localization based on CC2430 show that localization accuracy using LSSVR method with modeling parameters optimization increased by 23%~36% in compare with the maximum likelihood method(MLE) and the localization error is close to the minimum with different LSSVR modeling parameters. Experimental results show that adapting a reasonable fitness function for modeling parameters optimization using particle swarm optimization could enhance the anti-noise ability significantly and improve the LSSVR localization performance.