Skip to main content

Python library for fitting linear-spline based logistic regression for calibration.

Project description

Splinator 📈

Probablistic Calibration with Regression Splines

scikit-learn compatible

uv Documentation Status Build

Installation

pip install splinator

Algorithm

Supported models:

  • Linear Spline Logistic Regression

Supported metrics:

  • Spiegelhalter’s z statistic
  • Expected Calibration Error (ECE)

[1] You can find more information in the Linear Spline Logistic Regression.

[2] Additional readings

Examples

comparison notebook
scikit-learn's sigmoid and isotonic regression colab1
pyGAM’s spline model colab2

Development

The dependencies are managed by uv.

# Install uv (if not already installed)
curl -LsSf https://astral.sh/uv/install.sh | sh

# Create virtual environment and install dependencies
uv sync --dev

# Run tests
uv run pytest tests -v

# Run type checking
uv run mypy src/splinator

Example Usage

from splinator.estimators import LinearSplineLogisticRegression
import numpy as np

# random synthetic dataset
n_samples = 100
rng = np.random.RandomState(0)
X = rng.normal(loc=100, size=(n_samples, 2))
y = np.random.randint(2, size=n_samples)

lslr = LinearSplineLogisticRegression(n_knots=10)
lslr.fit(X, y)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

splinator-0.3.0.tar.gz (398.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

splinator-0.3.0-py3-none-any.whl (10.8 kB view details)

Uploaded Python 3

File details

Details for the file splinator-0.3.0.tar.gz.

File metadata

  • Download URL: splinator-0.3.0.tar.gz
  • Upload date:
  • Size: 398.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for splinator-0.3.0.tar.gz
Algorithm Hash digest
SHA256 9c0641b0d3279ef4ad696f3ef62d9d30c907d7cfb3d4b6b15ac246d997669d04
MD5 65bf2abe397e377c19a4ea6d39d060da
BLAKE2b-256 e006352e3e3130e9136da7558f8092b40ded47e94d385695e0a9ba830a2261d2

See more details on using hashes here.

Provenance

The following attestation bundles were made for splinator-0.3.0.tar.gz:

Publisher: publish.yml on Affirm/splinator

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file splinator-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: splinator-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 10.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for splinator-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 dc80c05981cc6d6e3f8f0ce8b61ae43a9b679e64a256624f2e2222552f9daeaf
MD5 ccd15f76c638313adb0715fb3773729c
BLAKE2b-256 0a16c559c0e7a7e8c2e8bf73644358804b0be12a45c3fe6ed457658d019f1b7a

See more details on using hashes here.

Provenance

The following attestation bundles were made for splinator-0.3.0-py3-none-any.whl:

Publisher: publish.yml on Affirm/splinator

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page