In order to improve the performance of the resampling algorithm in imbalanced data learning and the optimal combination of the weight coefficients of the base classifiers in the ensemble classification algorithm,a new algorithm based on particle swarm optimization(PSO)is proposed.In traditional sampling method,sampling rate is often set artificially.This would make the final classification can’t get a optimal solution.By using the particle swarm optimization algorithm,the sampling rate of the boundary samples and the safety samples are optimized to obtain the optimal over sampling rate self-adaptivly,the weekness of setting sampling rate of traditional method would be overcome.