Registry / ai-ml / preliz

preliz

JSON →
library0.26.0pypypiunverified

Preliz is a Python library for exploring and eliciting probability distributions. It provides a flexible and object-oriented framework for defining, manipulating, and visualizing various distributions, commonly used for setting priors in Bayesian inference workflows. The current version is 0.24.0, and it maintains an active development and release cadence.

pip install preliz
INSTALL
IMPORT
SIG · PRELIZ
P
preliz
ai-mlpythonv0.26.0
Install
17.1s avg
Import
4785ms
Disk
535MB
Pass rate
5/ 10
Env Coverage5 / 10
glibc
3.9–3.13
musl
3.9–3.13
Install & Compatibility
Where this runs
tested against v0.11.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
py 3.10–3.910 runs
build_error
glibc
py 3.10–3.910 runs
installs and imports cleanly · install 17.1s · import 1.914s · 497MB
535MB installed
● package 535MB
Code
Verified usage

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

Normal
✓ from preliz import Normal
✗ from preliz.distributions import Normal
As of v0.20.0, distributions are directly available from the top-level 'preliz' module. The old path was deprecated.
preliz
✓ import preliz
General import for accessing the library's features.

Demonstrates how to define a distribution, calculate its PDF, sample from it, and convert it to a scipy.stats compatible object.

import preliz import numpy as np # Define a Normal distribution norm_dist = preliz.Normal(mu=0, sigma=1) # Get PDF at a specific point print(f"PDF at x=0: {norm_dist.pdf(0):.3f}") # Sample from the distribution samples = norm_dist.rvs(size=100) print(f"Mean of 100 samples: {np.mean(samples):.2f}") print(f"Std dev of 100 samples: {np.std(samples):.2f}") # Access a scipy.stats compatible object (if needed) scipy_norm = norm_dist.to_scipy() print(f"Scipy PDF at x=0: {scipy_norm.pdf(0):.3f}")
Debug
Known issues
breakingDirect import paths for individual distributions changed in `0.20.0`. Previously, distributions like `Normal` were imported from `preliz.distributions`. Now, they are directly available from the top-level `preliz` module.
fix
Update your import statements. For example, change `from preliz.distributions import Normal` to `from preliz import Normal`. A backward-compatible `from preliz import distributions` was added in `0.22.0`, but direct import is preferred.
affects: >=0.20.0
gotchaPreliz distribution objects are not direct subclasses of `scipy.stats` distributions and cannot be used interchangeably with `scipy.stats` functions without explicit conversion. They offer their own `pdf()`, `cdf()`, `rvs()` methods.
fix
Use the `to_scipy()` method available on `preliz` distribution objects to obtain a `scipy.stats` compatible distribution, or directly use the `preliz` object's native methods for calculations and sampling.
affects: All versions
deprecatedThe plotting methods `plot_pdf()` and `plot_cdf()` on distribution objects have been deprecated in favor of a more unified `plot()` method.
fix
Replace calls to `dist.plot_pdf()` or `dist.plot_cdf()` with `dist.plot()`. You can specify the desired plot type using the `plot_type` argument, e.g., `dist.plot(plot_type='pdf')`.
affects: Likely >=0.22.0 (check specific changelog)
Upgrade
Version history
0.26.0latest on PyPI · released Jun 9, 2026
Audit
Dependencies

No dependency data recorded yet.

Agent activity
13 hits · last 30 days
node
12
Amazon
1
Resources
preliz — pip install preliz · libregistry