Registry / data / scoringrules

scoringrules

JSON →
library0.11.0pypypi✓ verified 85d ago

Scoringrules is a Python library for evaluating probabilistic forecasts using various scoring rules. It provides implementations of Continuous Ranked Probability Score (CRPS), Log Score, Brier Score, Dawid-Sebastiani Score, and more for various distributions and ensembles. The current version is 0.9.0, and the library maintains an active development pace with frequent minor releases and occasional breaking changes.

pip install scoringrules
INSTALL
IMPORT
SIG · SCORINGRULES
S
scoringrules
datapythonv0.11.0
Install
25.7s avg
Import
1343ms
Disk
541MB
Pass rate
5/ 10
Env Coverage5 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.9.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
glibc
py 3.10
2/6 runs
✓ 31.38s
py 3.11
2/6 runs
✓ 29.97s
py 3.12
2/6 runs
✓ 29.2s
py 3.13
2/6 runs
✓ 29.43s
py 3.9
✕ build_error
✓ 8.4s
541MB installed
● package 541MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

scoringrules
import scoringrules as sr
crps
import scoringrules.crps as sr_crps
from scoringrules import crps
While `from scoringrules import crps` works, it's generally recommended to import the top-level package or specific modules with aliases to avoid name clashes and for clearer structure.
gaussian
sr.crps.gaussian(observations, mean, std)

This quickstart calculates the Continuous Ranked Probability Score (CRPS) for a set of Gaussian probabilistic forecasts against corresponding observations. It demonstrates the basic usage pattern with `numpy` arrays and the `crps.gaussian` function, highlighting the argument order requirement.

import numpy as np import scoringrules as sr # Generate some synthetic data forecast_mean = np.array([0.1, 0.2, 0.3, 0.4]) forecast_std = np.array([0.5, 0.5, 0.5, 0.5]) observations = np.array([0.1, 0.1, 0.3, 0.5]) # Calculate CRPS for a Gaussian distribution # Observations must be the first argument since v0.5.0 crps_scores = sr.crps.gaussian(observations, forecast_mean, forecast_std) print(f"CRPS scores: {crps_scores}") print(f"Mean CRPS: {np.mean(crps_scores)}")
Debug
Known issues
breakingThe order of positional arguments for all scoring functions changed. Observations must now always be the first positional argument.
fix
Ensure that `observations` are passed as the first argument to all scoring functions (e.g., `sr.crps.gaussian(observations, mean, std)`).
affects: >=0.5.0
breakingSome function arguments were renamed, potentially breaking code that relied on specific keyword argument names or positional arguments that were affected by renaming.
fix
Consult the official documentation or release notes for v0.8.0 to identify renamed arguments and update your code accordingly. For example, some arguments like `obs` might have been explicitly renamed or absorbed into new positional schemes.
affects: >=0.8.0
deprecatedVersion 0.7.0 contained critical bugs. Users on this version are strongly advised to upgrade.
fix
Upgrade to version 0.7.1 or newer (`pip install --upgrade scoringrules`).
affects: 0.7.0
gotchaWhen using Numba (which is a default dependency), the first call to a JIT-compiled scoring function can be noticeably slower due to the compilation process.
fix
This is expected behavior. Subsequent calls to the same function with similar input shapes will be significantly faster. For benchmarking, disregard the first call.
affects: All versions with Numba
Errors
Common errors & fixes
TypeError: scoringrules.crps.gaussian() missing 1 required positional argument: 'observations'
Attempting to use pre-v0.5.0 argument order (e.g., `sr.crps.gaussian(mean, std, observations)`) where `observations` was not the first argument.
fix
Update your function call to place `observations` as the first positional argument: `sr.crps.gaussian(observations, mean, std)`.
TypeError: scoringrules.crps.gaussian() got multiple values for argument 'observations'
Passing observations both positionally (as the first argument) and as a keyword argument (e.g., `observations=...`) after v0.5.0.
fix
Pass `observations` either positionally or as a keyword argument, but not both. For clarity and consistency with post-v0.5.0 API, use `sr.crps.gaussian(observations, mean, std)`.
AttributeError: module 'scoringrules.crps' has no attribute 'some_old_function_name'
A specific scoring function or its name was changed or removed in a breaking release (e.g., v0.8.0 introduced refactoring and renaming).
fix
Check the release notes for your version or the latest documentation to find the new function name or usage pattern. For example, `crps_t` was made more robust in v0.9.0, possibly implying changes.
ImportError: cannot import name 'crps' from 'scoringrules'
Trying to import submodules like `crps` or `logs` directly from the top-level `scoringrules` package instead of as `scoringrules.crps`.
fix
Use the fully qualified import path: `import scoringrules.crps as sr_crps` or `import scoringrules as sr` and then access `sr.crps`.
Upgrade
Version history
0.11.0latest on PyPI · released Jun 6, 2026
Audit
Dependencies
numpyrequiredCore numerical operations and array handling.
scipyrequiredStatistical functions and distributions.
numbaoptionalJust-In-Time (JIT) compilation for performance optimization.
torchoptionalBackend for PyTorch tensor compatibility.
jaxoptionalBackend for JAX array compatibility.
Agent activity
13 hits · last 30 days
node
12
OpenAI (training)
1
Resources
scoringrules — pip install scoringrules · libregistry