The Project
classbound: Unified Decision Boundary Visualization
Motivation
Different R classification packages use different commands for making predictions and extracting probabilities. A data scientist must write custom code for every model type to compare decision boundaries.
Generating dense grids over multiple dimensions also requires large amounts of memory. This makes boundary computation for models with many features difficult.
Objectives
- Unified Interface: Create a single pipeline that works across many classification families.
- Extensibility: Design an adapter pattern using S3 dispatch. This allows adding new models without editing the core logic.
- Visualization: Provide clear decision boundary plots that show training data.
- Comparison Workflows: Allow side-by-side comparison of boundaries from different models trained on the same data.
Implementation Status (June 2026)
The core pipeline works. It supports:
rpart(Decision Trees)randomForest(Random Forests)PPtreeExt(Projection Pursuit Trees)PPforest(Projection Pursuit Forests)PPtreeViz(Projection Pursuit Tree Visualizer)
We moved the architecture to S3 dispatch. This change separates the model code from the pipeline code. The pipeline centralizes data processing. It tracks factor levels to ensure consistent colors across boundary comparisons.
Future Directions
The next phase covers high-dimensional support. The current code generates grids using dense combinations in two dimensions. We plan to compute boundaries within a projected space for models with more than two dimensions. This avoids generating large multi-dimensional grids.
We also plan to add a data simulation engine. This will generate linearly separable, non-linear, noisy, and imbalanced datasets for testing.