Introduction
In machine learning, imbalanced datasets—where one class significantly outnumbers another—pose a significant challenge for traditional classification algorithms. Standard approaches like K-Nearest Neighbor (KNN) often suffer from "majority bias." Since KNN relies on a majority vote within a local neighborhood, it tends to favor the majority class, even when a minority class instance is spatially closer and more relevant to the test point. This paper introduces the Balanced Neighborhood Classifier (BNEC) to address this limitation by shifting the focus from neighbor counts to local proximity.
Methodology: The Balanced Neighborhood Classifier (BNEC)
The BNEC algorithm moves away from the "counting heads" approach of standard neighborhood classifiers (NEC). Instead of using a single global threshold, BNEC employs class-specific thresholds and evaluates local mean distances.
Class-Specific Neighborhoods
For any given test point, BNEC calculates a unique distance threshold ($\delta^i$) for each class $i$. This threshold is dynamically determined based on the local distribution of that specific class, typically considering the minimum and maximum distances to its members.
Local Mean Distance and Decision Rule
Rather than a simple headcount, BNEC calculates the average distance to the neighbors of each class within their respective thresholds. The decision rule assigns the test point to the class with the minimum local mean distance. By prioritizing proximity over popularity, BNEC prevents the majority class from overwhelming the minority class through sheer volume.
Experimental Setup
The performance of BNEC was evaluated using both synthetic and real-world datasets:
- Synthetic Datasets: These allowed for precise control over dimensionality and the degree of class separation (denoted by $\theta$).
- UCI Benchmark Datasets: Four highly imbalanced real-world datasets were selected: Movement_libras (7.14% minority), Hayes_Roth (8.4%), Hepatitis (26%), and Spectrometer (9.26%).
Key Results
The primary evaluation metric was the Area Under the ROC Curve (AUC), which effectively measures performance on imbalanced data without rewarding simple majority-class guessing.
Performance Across Dimensionality
Experimental results on synthetic data demonstrate that BNEC consistently maintains higher AUC scores compared to KNN and standard NEC as dimensionality increases. As shown in the comparative plots, while all neighborhood-based methods experience performance degradation in higher dimensions, BNEC's "balanced" design provides a more robust baseline across various levels of class separation ($\theta$).
Real-World Benchmarks
On the Movement_libras dataset using 1-norm distance, BNEC achieved an AUC of 0.8021, significantly outperforming KNN's 0.3013. Across all tested real-world datasets and distance metrics (1-norm, 2-norm, and infinite-norm), BNEC consistently surpassed both KNN and NEC. Furthermore, BNEC often outperformed complex ensemble methods like AdaBoost and AdaCost, highlighting the effectiveness of a well-designed neighborhood approach.
Conclusion and Future Work
BNEC offers a robust solution for imbalanced classification by leveraging local spatial distributions. However, some areas for future research remain:
- Parameter Tuning: The neighborhood radius parameter $w$ typically performs best when $w < 0.1$, but may require cross-validation for optimal results.
- Scalability: Like other neighborhood methods, the computational cost of distance calculations can be high for very large datasets.
- Multi-class Extension: Future work could explore extending BNEC's logic to handle datasets with multiple minority classes.
Summary updated