Abstract
We introduce an instance-weighting method to induce cost-sensitive trees in this paper. It is a generalization of the standard tree induction process where only the initial instance weights determine the type of tree to be induced—minimum error trees or minimum high-cost error trees. We demonstrate that it can be easily adapted to an existing tree learning algorithm. Previous research gave insufficient evidence to support the fact that the greedy divide-and-conquer algorithm can effectively induce a truly cost-sensitive tree directly from the training data. We provide this empirical evidence in this paper. The algorithm incorporating the instance-weighting method is found to be better than the original algorithm in terms of total misclassification costs, the number of high-cost errors, and tree size in two-class datasets. The instance-weighting method is simpler and more effective in implementation than a previous method based on altered priors.
Introduction
Most machine learning classifiers are "cost-blind," operating under the assumption that all misclassification errors are equally detrimental. However, in real-world applications like medical diagnosis or fraud detection, the consequences of a false negative (e.g., missing a disease) are often far more severe than those of a false positive. This paper addresses the challenge of building decision trees that are inherently sensitive to these varying costs during the training phase, rather than relying on post-hoc adjustments.
Methodology
The Instance-Weighting Approach
The core of our proposal is an instance-weighting method. Instead of treating every training example as a single unit, the algorithm assigns a weight $w(j)$ to each instance proportional to the cost of misclassifying its class.
- Weight Calculation: Weights are assigned such that classes with higher misclassification costs receive higher weights, while the total sum of weights across the dataset remains equal to the original number of instances ($N$).
- Algorithm Integration (C4.5CS): We modified the standard C4.5 algorithm to utilize these weights during both the Tree Growing (attribute selection) and Tree Pruning phases. This consistency is vital; using costs only for growth while pruning based on standard error counts often results in a "cost-blind" final model.
- Cost Matrix Conversion: To handle complex scenarios where costs depend on both the actual and predicted class, we convert the cost matrix into a cost vector by summing potential costs for each actual class.
Empirical Evaluation
We evaluated the C4.5CS algorithm across 22 datasets: 20 from the UCI repository and 2 from the Statlog project. The collection included 12 two-class datasets and 10 multi-class datasets to test the method's scalability and effectiveness across different levels of complexity.
Key Results
Two-Class Performance
The instance-weighting method showed significant improvements in two-class problems:
- Cost Reduction: C4.5CS achieved a mean reduction in total misclassification costs of 38% (mean ratio of 0.62) compared to standard C4.5.
- High-Cost Error Reduction: The number of expensive errors dropped by 65% (mean ratio of 0.35).
- Model Efficiency: Interestingly, weighting instances often leads to smaller trees. On average, C4.5CS trees were 34% smaller (mean ratio of 0.66), as the skewed distribution allowed the algorithm to find decisive splits more rapidly.
The Multi-class Bottleneck
While highly effective for two-class problems, the performance gain in multi-class datasets was marginal, with only a 2% cost reduction (mean ratio of 0.98). This is largely attributed to the "information sink" created when collapsing a multi-dimensional cost matrix into a single cost vector, which loses directional information about specific class confusions.
Discussion and Limitations
A critical insight from this research is that for cost-sensitivity to be effective, weights must be applied consistently throughout the induction and pruning process. However, the method faces challenges with highly skewed data, where additional cost-based weighting can increase the total error rate so significantly that the total cost actually rises.
Future work suggests that addressing the multi-class and skewness issues may require more advanced techniques, such as cost-sensitive Boosting, to better preserve the nuances of complex cost structures.
Summary updated