Registry / ai-ml / properscoring

properscoring

JSON →
library0.1pypypi✓ verified 88d ago

A Python library for evaluating probabilistic forecasts using proper scoring rules. Version 0.1 is the only release; the project is in maintenance mode with no recent updates. It provides implementations of the Continuous Ranked Probability Score (CRPS), Brier score, and related metrics for forecast verification.

pip install properscoring
INSTALL
IMPORT
SIG · PROPERSCORING
P
properscoring
ai-mlpythonv0.1
Install
7.2s avg
Import
2431ms
Disk
230MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.9–3.13
musl
3.9–3.13
Install & Compatibility
Where this runs
tested against v0.1 · 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
py 3.10–3.95 runs
installs and imports cleanly · install 0.0s · import 2.458s · 230.8MB
glibc
py 3.10–3.95 runs
installs and imports cleanly · install 7.2s · import 2.404s · 222MB
230MB installed
● package 230MB
Code
Verified usage

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

crps_ensemble
✓ from properscoring import crps_ensemble
Most commonly used function for CRPS from ensemble forecasts.
crps_gaussian
✓ from properscoring import crps_gaussian
For parametric Gaussian forecasts.

Compute the Continuous Ranked Probability Score (CRPS) for ensemble forecasts against observations.

import numpy as np from properscoring import crps_ensemble # Ensemble forecasts (10 members) ensemble = np.random.randn(10, 100) # Observations observations = np.random.randn(100) # Calculate CRPS for each observation crps = crps_ensemble(observations, ensemble) print(crps.mean())
Debug
Known issues
gotchaInput arrays for `crps_ensemble` must be 1D or 2D with observations as first argument and ensemble as second. If dimensions are mismatched (e.g., shapes (n,) vs (m, n) transposed), you may get incorrect results or broadcasting issues.
fix
Ensure observations have shape (n,) or (1, n) and ensemble has shape (n_ens, n); use `ensemble.T` if needed.
affects: <=0.1
gotchaThe library has no official support for Python 3.10+ (no wheels for recent Python versions). Installing on Python 3.10 or 3.11 requires building from source, which may fail if compilation tools are missing.
fix
Use Python 3.8 or 3.9 for guaranteed compatibility, or install via conda-forge: `conda install -c conda-forge properscoring`.
affects: >=0.1
breakingIn v0.1, `crps_ensemble` does not handle NaN values; passing arrays with NaN can cause silent errors or incorrect results.
fix
Manually remove or impute NaN values before calling the function.
affects: 0.1
Errors
Common errors & fixes
ImportError: cannot import name 'crps_ensemble'
Older version or mis-installation. The import name is correct; ensure properscoring is installed.
fix
Run `pip install properscoring` and verify import with `import properscoring`.
ValueError: operands could not be broadcast together with shapes ...
Input arrays of incompatible shapes to `crps_ensemble`.
fix
Reshape: observations should be (n,) or (1, n), ensemble should be (m, n). Use `np.atleast_2d(obs)` and check ensemble shape.
TypeError: 'numpy.float64' object is not callable
Accidentally shadowed the `crps_ensemble` function with a variable (e.g., `crps_ensemble = ...`).
fix
Restart the interpreter and avoid using the function name as a variable.
Upgrade
Version history
0.1latest on PyPI · released Nov 12, 2015
Audit
Dependencies
numpyrequiredCore dependency for array operations and numerical computations.
scipyrequiredRequired for special functions (e.g., erf) used in CRPS calculations.
Agent activity
7 hits · last 30 days
node
6
Resources
properscoring — pip install properscoring · libregistry