Pitting is the popular failure mode of spot welding of stainless steel. The behavior of pitting could be evaluated through the eigenvalue named pitting potential,which has complicated nonlinear relations with the parameters of welding current,welding time and electrode force. The random forest is built through the specified data of the pitting behavior of stainless steel in the literature. Optimal number of decision trees are 1 000. The number of alternative variables in node is 2 by means of "five-fold cross validation". Then the parameter combination is utilized to predict the testing dataset. The results indicates that excepting a slightly higher predicted relative error of twenty-ninth sample(-14.81%),absolute value of relative error between the predicted result and the actual value of remaining samples are less than 10%,which is better than Neural Networks and support vector machine.