Skip to main content

fishladder

CI PyPI License

Fishladder Banner

An evaluation framework for online multi-output active learning on data streams.

fishladder is in alpha: the API may still change between minor versions.

What is this?

In many streaming applications (soft sensors, process monitoring, environmental sensing), each instance arrives with several outputs to predict, and obtaining the true values is expensive. An active learner has to decide, on the fly, which labels are worth asking for, and for which outputs. Those labels often come back late, and each output can have its own delay.

Existing stream-learning libraries support active learning only for single-output classification, and existing active learning libraries mostly assume a pool of data rather than a stream. fishladder fills the gap by providing tools to evaluate active learning methods in this setting. Like a fish ladder lets only some fish past a dam, the goal is to study which labels are worth letting through.

fishladder follows River's conventions (dictionaries for x and y, predict_one and learn_one, River-style metrics) and works with River's multi-output models, datasets and metrics out of the box. It complements River rather than replacing it.

Features

  • Output-level querying. Ask for any subset of the outputs of an instance, with a cost per output.
  • Query strategies, budgets and models are separate pieces. Any strategy can be combined with any budget and any model.
    • Strategies (fl.strategy): RandomPerOutput, QueryAll, QueryByCommittee and ExpectedError.
    • Budgets (fl.budget), measured in cost rather than in number of queries: TotalBudget, RateBudget, Unlimited, PerOutput to give each output its own share, and VariableThreshold to only query outputs whose utility is high compared to their recent ones, optionally with a randomized threshold.
  • Randomized querying, which makes active learning more robust to drift. fl.strategy.Split mixes any strategy with random exploration, and fl.strategy.Randomized turns any strategy's utilities into query probabilities, so that new randomized strategies only define how. The probabilities are kept in the log.
  • Prequential evaluation (fl.evaluate). Test-then-train, with predictions scored on every output, queried or not.
  • Delayed labels. A delay per output, constant or drawn at random, and labels that never arrive. Queries are paid for when they are made, and labels are learned when they arrive.
  • A tidy experiment log (fl.Log), with one row per instance and output, from which per-output metrics and learning curves indexed by cost are computed (fl.metrics).
  • A synthetic multi-target stream generator (fl.synth.MultiTarget), with control over the correlation between outputs, their noise and smoothness, and when each one drifts.
  • A River-style wrapper (fl.active.Wrapper) to add output-level active learning to an existing River application.

Installation

pip install "fishladder[river]"

The river extra installs River, which the examples use for models and metrics. fishladder itself only depends on NumPy and pandas. Add the plots extra for the notebooks.

Quickstart

from river import linear_model, metrics, multioutput, preprocessing

import fishladder as fl

costs = {"y0": 1.0, "y1": 2.0, "y2": 5.0}

log = fl.evaluate.prequential(
    dataset=fl.synth.MultiTarget(n_features=5, seed=42).take(2000),
    model=multioutput.RegressorChain(
        preprocessing.StandardScaler() | linear_model.LinearRegression(),
        order=list(costs),
    ),
    strategy=fl.strategy.RandomPerOutput(p=0.5, seed=42),
    budget=fl.budget.PerOutput(fl.budget.RateBudget(1.5)),
    costs=costs,
    delay={"y0": 0, "y1": 0, "y2": 100},  # y2's labels arrive 100 instances later
)

fl.metrics.per_output(log, metrics.MAE())
{'y0': MAE: 0.704636, 'y1': MAE: 0.526393, 'y2': MAE: 0.479729}

The log can be turned into a DataFrame with log.to_frame(), and fl.metrics.curve gives learning curves along the stream, against either the number of instances or the cost spent.

To add active learning to an existing River loop instead:

model = fl.active.Wrapper(model, strategy, budget, costs)

for x, y in dataset:
    y_pred, ask = model.predict_one(x)  # the outputs to ask for, paid for here
    if ask:
        model.learn_one(x, {o: y[o] for o in ask})

Notebooks

The notebooks show fishladder in use with River: a quickstart, the River wrapper, the query strategies, synthetic streams with drift, delayed labels, and randomized querying.

Contributing and feedback

Ideas, use cases and criticism are welcome through GitHub issues.

License

BSD 3-Clause. See LICENSE.

Metadata

Release files for fishladder 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for fishladder 0.1.0
File Size Uploaded Provenance Actions
fishladder-0.1.0.tar.gz 7.8 MB With provenance Details for fishladder-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for fishladder 0.1.0
File Interpreter ABI Platform Actions
fishladder-0.1.0-py3-none-any.whl Python 3 none any Details for fishladder-0.1.0-py3-none-any.whl

Total release size: 7.8 MB

Release files / fishladder-0.1.0.tar.gz

Download URL fishladder-0.1.0.tar.gz
Size 7.8 MB
Tags Source
SHA-256 checksum
How to use checksums
bc4d975c24e0e8f24c6663d6b183567d6acf614c19fa67ad1d6f17ece27cb313
BLAKE2b-256 checksum
How to use checksums
482be0168f42d6c1f866a3af7896bda980a29be2f0ec22d1be24ec28cb2d3205
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 Oct 30, 2026.

Transparency log

Release files / fishladder-0.1.0-py3-none-any.whl

Download URL fishladder-0.1.0-py3-none-any.whl
Size 28.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2f811a5b2edfe75f5c921442c68aad158d3866f88c0bbc6afa087283ccf90ad6
BLAKE2b-256 checksum
How to use checksums
afe9b35c2d8a8676365606b575f1d45fc3401b5e099002ed483d36fd851414e2
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 Oct 30, 2026.

Transparency log

Security for fishladder 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.

Select from 2 files

Attestation for fishladder-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 Oct 30, 2026.

Transparency log

A 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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page