Imbalanced datasets exist commonly in the real world, which leads to poor performance of general machine learning models because of skewed class distribution. To address the data‐imbalance problem, a novel oversampling method based on classification contribution degree, called OS‐CCD is presented. First a new concept, classification contribution degree, is established based on micro and macro information extracted from raw datasets. With the classification contribution degree, OS‐CCD enables positive samples near the class boundary and located in an area with high density of positive samples to generate more synthetic samples than others. Furthermore, the neighbor selection for oversampling is no longer random but in the light of a selected probability. Experimental results on 12 benchmark datasets substantiate that four commonly used classifiers with the oversampling method outperform those with six popular oversampling methods in terms of accuracy, F1‐score and AUC.