Shape-aware calibration
Choose increasing, decreasing, or unconstrained curves. Linear constraints keep probability mappings sensible while preserving local flexibility.
Fit smooth, interpretable calibration curves with linear spline logistic regression—without leaving the scikit-learn workflow.
pip install splinator
Reliability curve
Sigmoid calibration can be too rigid. Isotonic calibration can be too jagged. Splinator gives you a smooth middle path.
Choose increasing, decreasing, or unconstrained curves. Linear constraints keep probability mappings sensible while preserving local flexibility.
Familiar fit, predict, and
transform methods make calibration easy to add to existing
pipelines.
Set the knot count or pass exact knot locations. Tune regularization and choose SLSQP or trust-constr optimization.
Pass a score column, choose your knot count, and fit. Additional columns can travel alongside the calibrated score as unconstrained features.
from splinator.estimators import (
LinearSplineLogisticRegression,
)
calibrator = LinearSplineLogisticRegression(
n_knots=10,
monotonicity="increasing",
C=100,
)
calibrator.fit(scores, outcomes)
probabilities = calibrator.predict(scores)
array([0.071, 0.284, 0.813, 0.946])
Splinator is maintained by contributors at Affirm and released under the BSD 3-Clause license.