{'fraction_non_alphanumeric': 0.017743979721166033, 'fraction_numerical': 0.0012674271229404308, 'mean_word_length': 5.392712550607287, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
A Kernel Density Estimation-Based Variation Sampling for Class Imbalance in Defect Prediction

In software engineering, software defect prediction can help to discover the defect modules and improve the quality of software products. However, class imbalance makes the recognition of minority defective class difficult. Resampling on the datasets is a widely used approach to solve this problem and its objective is to balance the numbers of different classes without too much changes on their original distributions. A novel resampling approach called kernel density estimation-based variation sampling (DVS) is proposed to achieve this goal by generating new minority defective samples. The “variation” means that: For each new sample, more than half eigenvalues are directly inherited from the existing defective samples, but others will be varied. The varied eigenvalues can be obtained by sampling from their corresponding probability distribution models based on the kernel density estimation. Finally, the new defective samples different from those in training datasets but consistent with their overall distribution can be generated, which can help the prediction models to recognize various defective modules better. The DVS was compared with K-Means SMOTE, MAHAKIL, RUS and the No sampling approach using total 23 releases of defect datasets from the PROMISE, NASA and Eclipse repositories, and CART was adopted as the classifier. The experiment results indicate that the DVS can obviously improve the Recall and G-means of SDP model without too much loss on Precision.