Abstract
We propose an optimization of Dr. Ross Quinlan’s C4.5 decision tree algorithm, used for data mining and classification. We will show that by discretizing and binning a data set’s continuous attributes into four groups using our novel technique called MSD-Splitting, we can significantly improve both the algorithm’s accuracy and efficiency, especially when applied to large data sets. We applied both the standard C4.5 algorithm and our optimized C4.5 algorithm to two data sets obtained from UC Irvine’s Machine Learning Repository: Census Income and Heart Disease. In our initial model, we discretized continuous attributes by splitting them into two groups at the point with the minimum expected information requirement, in accordance with the standard C4.5 algorithm. Using five-fold cross-validation, we calculated the average accuracy of our initial model for each data set. Our initial model yielded a 75.72% average accuracy across both data sets. The average execution time of our initial model was 1,541.57 s for the Census Income data set and 50.54 s for the Heart Disease data set. We then optimized our model by applying MSD-Splitting, which discretizes continuous attributes by splitting them into four groups using the mean and the two values one standard deviation away from the mean as split points. The accuracy of our model improved by an average of 5.11% across both data sets, while the average execution time reduced by an average of 96.72% for the larger Census Income data set and 46.38% for the Heart Disease data set.
Introduction: The C4.5 Bottleneck
The C4.5 algorithm is a cornerstone of machine learning, prized for its ability to generate human-readable decision trees. However, it faces a significant performance bottleneck when processing continuous data (such as age or income).
Standard C4.5 handles continuous attributes by attempting to find an "ideal" binary split point. This requires sorting the data and calculating the information gain for every possible midpoint between adjacent values. This brute-force approach results in a quadratic time complexity ($O(n^2)$), which makes the algorithm increasingly slow as datasets grow. Furthermore, these binary splits do not always capture the underlying distribution of the data, which can lead to lower accuracy or overfitting.
Methodology: MSD-Splitting
To address these limitations, we introduce MSD-Splitting (Mean and Standard Deviation Splitting). Instead of searching for a single optimal split point through exhaustive iteration, this method discretizes continuous attributes into four distinct bins based on the data's statistical properties:
- Group 1: $x < \mu - \sigma$ (Below mean, high deviation)
- Group 2: $\mu - \sigma \le x < \mu$ (Below mean, low deviation)
- Group 3: $\mu \le x < \mu + \sigma$ (Above/at mean, low deviation)
- Group 4: $x \ge \mu + \sigma$ (Above mean, high deviation)
By using $\mu$ (mean) and $\sigma$ (standard deviation) as fixed split points, the algorithm avoids the exhaustive $O(n^2)$ search entirely, reducing the complexity of finding split points to a linear $O(n)$ operation. Once the data is binned, the algorithm proceeds with standard decision tree induction using the Gain Ratio to select attributes.
Datasets
We evaluated the optimization using two benchmarks from the UC Irvine Machine Learning Repository:
- Census Income: A large dataset containing 48,842 records and 14 attributes, used to predict whether an individual's income exceeds $50,000/year.
- Heart Disease (Cleveland subset): A smaller dataset with 303 records and 14 attributes, used to predict the presence of heart disease.
Evaluation was performed using five-fold cross-validation to ensure robust results.
Key Results
The optimized model outperformed the standard C4.5 in every metric tested. The most significant gains were observed in computational efficiency, particularly as the dataset size increased.
- Accuracy Boost: The overall average accuracy improved from 75.72% to 79.59%, representing a 5.11% relative increase. By splitting into four groups instead of two, the model creates more descriptive branches that capture more information per split.
- Massive Speedups:
- On the large Census Income dataset, execution time dropped from 1,541.57 seconds to just 50.54 seconds—a 96.72% reduction.
- On the smaller Heart Disease dataset, execution time was reduced by 46.38%.
Conclusion
MSD-Splitting provides a reliable, general-purpose enhancement for the C4.5 algorithm. By leveraging statistical markers ($\mu, \sigma$) as proxies for natural boundaries in the data, we can achieve higher granularity and accuracy while drastically reducing the "time tax" associated with processing continuous variables. Future work may investigate the performance of this method on non-Gaussian data distributions or explore dynamic binning counts for even larger datasets.
Summary updated