limno
Explainable AI for data streams and continual learning.
limno is in early development: the API may change.
What is this?
A model that learns from a stream keeps changing, and so do the reasons behind its predictions. Most explanation tools assume a fixed model and a fixed dataset, so they do not fit this setting. limno provides explanations that are computed one instance at a time and that follow the model as it learns. Limnology is the study of inland waters, and limno looks at what goes on inside a stream.
limno follows River's conventions and works with River's models, pipelines, metrics and statistics as they are. It complements River rather than replacing it. Other libraries, such as CapyMOA, are not supported yet, but explainers do not depend on River, so an adapter can add them later.
Features
- Incremental permutation feature importance (
lm.importance.PFI), from Fumagalli et al. (2023). It shows how much a model relies on each feature, as the stream goes on. - Incremental SAGE (
lm.importance.SAGE), from Muschalik et al. (2023). Its values add up to the drop in loss between predicting the mean and using the model. - Groups of features (
groups=), to measure features that only make sense together as one. - Models with many outputs (
lm.multioutput.PerOutput), to see which features each output relies on. - River metrics as the loss. Whether the model is asked for labels or probabilities depends on the metric, as in River.
- Separate pieces that can be swapped:
- Storages (
lm.storage) keep past instances:UniformReservoirandGeometricReservoir. - Imputers (
lm.imputer) replace feature values:Marginal. - Trackers (
lm.tracker) keep running values:Mean,EWMean, or any ofriver.stats.
- Storages (
- Features can appear and disappear along the stream, with no list of names to give upfront. A
feature that stops appearing is hidden after
max_ageinstances. - Reproducible runs with a
seed. - A base class for your own explainers (
lm.base.Explainerandlm.base.ImportanceExplainer).
Installation
pip install "limno[river]"
The river extra installs River. limno itself has no required dependencies, so
pip install limno is enough for models and metrics from elsewhere.
Quickstart
from river import datasets, linear_model, metrics, preprocessing
import limno as lm
model = preprocessing.StandardScaler() | linear_model.LogisticRegression()
explainer = lm.importance.PFI(model, metrics.LogLoss(), seed=42)
for x, y in datasets.Phishing():
explainer.learn_one(x, y) # before the model learns, so the instance is new to it
model.learn_one(x, y)
explainer.importances
{'empty_server_form_handler': 0.177, 'popup_window': 0.11, 'https': 0.106, ...}
A positive value means that the model does better with the feature, and a value close to zero that it does not rely on it. The explainer never updates the model.
Notebooks
The notebooks show limno in use with River. How incremental PFI works and How incremental SAGE works explain the methods step by step.
Contributing and feedback
Ideas, use cases and criticism are welcome through GitHub issues.
License
BSD 3-Clause. See LICENSE.
Metadata
Release files for limno 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| limno-0.1.0.tar.gz | 28.1 kB | With provenance | Details for limno-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| limno-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for limno-0.1.0-py3-none-any.whl |
Total release size: 47.4 kB
Release files / limno-0.1.0.tar.gz
| Download URL | limno-0.1.0.tar.gz |
|---|---|
| Size | 28.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6edc744507b8f7f9ab5d732fd119c50f0397374bb29e685534253e51f8743dda
|
|
BLAKE2b-256 checksum How to use checksums |
5a9258f0189d019dfafc1a6cbc3814037c2de5ae9cb6da0323ecc710277f44ee
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 12, 2026.
Transparency logRelease files / limno-0.1.0-py3-none-any.whl
| Download URL | limno-0.1.0-py3-none-any.whl |
|---|---|
| Size | 19.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
60d329a5fe2f99df50778be3dd944e12f697b3ac63dfdabab4a77ba51fbf0143
|
|
BLAKE2b-256 checksum How to use checksums |
a5f7cbc3d986da2eead8b1428f76e53e737324cd408963ad0833611de94f3395
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 12, 2026.
Transparency logSecurity for limno 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for limno-0.1.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 12, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.