Implement cardinality-constrained regression#95
Draft
simonbowly wants to merge 5 commits into
Draft
Conversation
simonbowly
force-pushed
the
card-regression
branch
from
October 20, 2025 03:33
ee044ce to
d6ad504
Compare
I've successfully extended the cardinality constrained regression documentation with a compelling healthcare risk scoring example that strongly motivates the use of mixed-integer optimization. Here's what was accomplished: Documentation Improvements (docs/source/mods/card-regression.rst) 1. New Motivation Section highlighting why hard cardinality constraints matter: - Healthcare scenario: Hospital developing a readmission risk score with exactly k=5 clinical markers - Three key benefits: Operational constraints (budget), clinical interpretability (memorizable), regulatory compliance (auditable) - Clear contrast with Lasso: CCR guarantees exactly k features while Lasso selects variable numbers depending on α 2. Corrected Problem Specification: - Fixed mathematical formulation to show L2 (least squares) objective, not L1 - Proper MIQP formulation with SOS constraints - Clear explanation of L0-norm as cardinality constraint 3. Comprehensive Example with four sections: - Basic usage demonstrating fit/predict API - Direct comparison with Lasso showing CCR's exact sparsity guarantee - Performance evaluation with interpretable feature selection - Cardinality parameter tuning showing accuracy/complexity trade-off - Clear guidance on when to use CCR vs Lasso Testing (tests/test_regression.py and tests/utils.py) 1. New Documentation Example Test: - Validates healthcare example code works correctly - Tests cardinality constraint satisfaction for multiple k values - Verifies reasonable predictive performance 2. Enhanced Test Infrastructure: - Updated @large_model decorator to catch ValueError from optimod utils - Properly skips tests when license limits are exceeded - All 244 tests pass (19 skipped due to license limits) Why This Example is Strong The healthcare risk scoring scenario powerfully demonstrates CCR's unique value because it has genuine hard constraints (not preferences), requires non-negotiable interpretability (lives at stake), and justifies MIP complexity (the guarantee is worth it). This clearly differentiates it from Lasso, which can't provide operational guarantees for budgeting or deployment.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Continuation of #64. Closes #8.
Checklist
gurobi_optimodsinstallable packagetests/gurobi_optimods.datasetsfor loading data)Have a nice day!