Canonical docs
In the research projects
The Python project calibrates an ordinary fitted classifier and chooses a threshold before Sensor construction. The Compiled project declares the same four calibration/threshold choices in its Manifest. Both calibration scenarios disclose reuse of validation observations.
What this package owns
Owns probability calibration, threshold optimization, and the runtime pipeline that applies those steps to model outputs. Does not own target construction, scaler fitting, model training, or downstream trade decisioning.
Key entry points
| Entry point | Use case | Notes |
|---|---|---|
CalibratorProtocol, ThresholdOptimizerProtocol |
Callable contracts for custom calibration or threshold functions | Used by manifest calibration wiring and pipeline helpers. |
fit_calibrator |
Fit the configured calibrator and threshold on validation data | Returns the fitted predictor, selected threshold, and validation score. |
apply_calibrated_predict |
Apply calibration and thresholding to test predictions | Returns _preds, _probs, optimal_threshold, and val_score. |
sklearn_probability_calibrator |
Scikit-learn probability calibration | Supports isotonic and sigmoid calibration. |
grid_threshold_optimizer |
Threshold optimizer over calibrated or raw probabilities | Produces the decision cutoff used for binary predictions. |
Adjacent modules
limen.experiment.manifest_corewires calibration into manifest execution.limen.sfd.reference_architectureconsumes calibrated probabilities during evaluation.limen.targetscreates the supervised labels that calibration evaluates against.
Quick orientation
| Module or family | Responsibility |
|---|---|
pipeline.py |
protocol types, fit step, and calibrated prediction helper |
probability.py |
scikit-learn probability calibrator wrapper |
threshold.py |
grid threshold optimizer |
calibration/├── README.md├── __init__.py├── _objective_threshold.py├── pipeline.py├── probability.py└── threshold.pyMerged source PR · 87894eb8Package layout · Limen 6.0.1 · current package validation · package source
Things to know
- Python callers use the fitting and prediction helpers directly; YAML declares the same choices for each native round.
- Probability calibration and threshold optimization can be enabled independently.
- Validation data is the fitting surface for calibrators and threshold choice.
predict()andevaluate()have different result-schema guarantees; see the canonical Calibration page before changing output fields.