Over the last decade, China’s P2P lending industry has been seen as an important credit source but it has recently suffered from a wave of bankruptcies. Using 126,090 P2P loan deals from RenRen Dai, one of the biggest online P2P websites in China, this paper attempts to predict credit default probabilities for P2P lending by implementing machine-learning techniques. More specifically, thisstudy proposes a stacking ensemble machine-learning model to assess credit default risk for P2P lending platforms. A Max-Relevance and Min-Redundancy (MRMR) method is used for feature selection and then irrelevant features are eliminated by using k-means clustering method. Finally, the stacking ensemble model is performed to produce accurate and stable predictions in the feature subset. Experimental results show that stacking ensemble model yields high performance, not only in prediction accuracy but also in precision and recall. In comparison to single classifiers, the stacking ensemble machine-learning model has a minimum error rate and provides more accurate credit default risk prediction. The results also confirm the efficiency of the proposed stacking ensemble model through the area under the ROC curve.