Skip to main content
Release files added late

2 files were added to this release more than 14 days after its initial publication. Inspect the release files before installing.

river_logo

unit-tests code-quality documentation discord pypi pepy black mypy bsd_3_license


River is a Python library for online machine learning. It aims to be the most user-friendly library for doing machine learning on streaming data. River is the result of a merger between creme and scikit-multiflow.

⚡️ Quickstart

As a quick example, we'll train a logistic regression to classify the website phishing dataset. Here's a look at the first observation in the dataset.

>>> from pprint import pprint
>>> from river import datasets

>>> dataset = datasets.Phishing()

>>> for x, y in dataset:
...     pprint(x)
...     print(y)
...     break
{'age_of_domain': 1,
 'anchor_from_other_domain': 0.0,
 'empty_server_form_handler': 0.0,
 'https': 0.0,
 'ip_in_url': 1,
 'is_popular': 0.5,
 'long_url': 1.0,
 'popup_window': 0.0,
 'request_from_other_domain': 0.0}
True

Now let's run the model on the dataset in a streaming fashion. We sequentially interleave predictions and model updates. Meanwhile, we update a performance metric to see how well the model is doing.

>>> from river import compose
>>> from river import linear_model
>>> from river import metrics
>>> from river import preprocessing

>>> model = compose.Pipeline(
...     preprocessing.StandardScaler(),
...     linear_model.LogisticRegression()
... )

>>> metric = metrics.Accuracy()

>>> for x, y in dataset:
...     y_pred = model.predict_one(x)      # make a prediction
...     metric = metric.update(y, y_pred)  # update the metric
...     model = model.learn_one(x, y)      # make the model learn

>>> metric
Accuracy: 89.28%

Of course, this is just a contrived example. We welcome you to check the introduction section of the documentation for a more thorough tutorial.

🛠 Installation

River is intended to work with Python 3.8 and above. Installation can be done with pip:

pip install river

There are wheels available for Linux, MacOS, and Windows. This means you most probably won't have to build River from source.

You can install the latest development version from GitHub as so:

pip install git+https://github.com/online-ml/river --upgrade
pip install git+ssh://git@github.com/online-ml/river.git --upgrade  # using SSH

This method requires having Cython and Rust installed on your machine.

🔮 Features

River provides online implementations of the following family of algorithms:

  • Linear models, with a wide array of optimizers
  • Decision trees and random forests
  • (Approximate) nearest neighbors
  • Anomaly detection
  • Drift detection
  • Recommender systems
  • Time series forecasting
  • Bandits
  • Factorization machines
  • Imbalanced learning
  • Clustering
  • Bagging/boosting/stacking
  • Active learning

River also provides other online utilities:

  • Feature extraction and selection
  • Online statistics and metrics
  • Preprocessing
  • Built-in datasets
  • Progressive model validation
  • Model pipelines

Check out the API for a comprehensive overview

🤔 Should I be using River?

You should ask yourself if you need online machine learning. The answer is likely no. Most of the time batch learning does the job just fine. An online approach might fit the bill if:

  • You want a model that can learn from new data without having to revisit past data.
  • You want a model which is robust to concept drift.
  • You want to develop your model in a way that is closer to what occurs in a production context, which is usually event-based.

Some specificities of River are that:

  • It focuses on clarity and user experience, more so than performance.
  • It's very fast at processing one sample at a time. Try it, you'll see.
  • It plays nicely with the rest of Python's ecosystem.

🔗 Useful links

👐 Contributing

Feel free to contribute in any way you like, we're always open to new ideas and approaches.

  • Open a discussion if you have any question or enquiry whatsoever. It's more useful to ask your question in public rather than sending us a private email. It's also encouraged to open a discussion before contributing, so that everyone is aligned and unnecessary work is avoided.
  • Feel welcome to open an issue if you think you've spotted a bug or a performance issue.
  • Our roadmap is public. Feel free to work on anything that catches your eye, or to make suggestions.

Please check out the contribution guidelines if you want to bring modifications to the code base.

🤝 Affiliations

affiliations

💬 Citation

If River has been useful to you, and you would like to cite it in a scientific publication, please refer to the paper published at JMLR:

@article{montiel2021river,
  title={River: machine learning for streaming data in Python},
  author={Montiel, Jacob and Halford, Max and Mastelini, Saulo Martiello
          and Bolmier, Geoffrey and Sourty, Raphael and Vaysse, Robin and Zouitine, Adil
          and Gomes, Heitor Murilo and Read, Jesse and Abdessalem, Talel and others},
  year={2021}
}

📝 License

River is free and open-source software licensed under the 3-clause BSD license.

Metadata

Release files for river 0.20.1

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

Files added late

2 files were uploaded more than 14 days after the first file in this release.

While project maintainers occasionally add legitimate files to an existing release, late additions can also indicate a security compromise.

We recommend inspecting the release files before installing.

Source distribution (sdist)

Source distribution for river 0.20.1
File Size Uploaded Provenance Actions
river-0.20.1.tar.gz 796.8 kB Without provenance Details for river-0.20.1.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for river 0.20.1
File Actions
river-0.20.1-cp312-cp312-win_amd64.whl CPython 3.12 CPython 3.12 Windows x86-64 Details for river-0.20.1-cp312-cp312-win_amd64.whl
river-0.20.1-cp312-cp312-win32.whl CPython 3.12 CPython 3.12 Windows x86-32 Details for river-0.20.1-cp312-cp312-win32.whl
river-0.20.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl CPython 3.12 CPython 3.12 Linux glibc 2.17+ ARM64 Details for river-0.20.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
river-0.20.1-cp312-cp312-macosx_12_0_x86_64.whl CPython 3.12 CPython 3.12 macOS 12.0+ x86-64 Details for river-0.20.1-cp312-cp312-macosx_12_0_x86_64.whl
river-0.20.1-cp311-cp311-win_amd64.whl CPython 3.11 CPython 3.11 Windows x86-64 Details for river-0.20.1-cp311-cp311-win_amd64.whl
river-0.20.1-cp311-cp311-win32.whl CPython 3.11 CPython 3.11 Windows x86-32 Details for river-0.20.1-cp311-cp311-win32.whl
river-0.20.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl CPython 3.11 CPython 3.11 Linux glibc 2.17+ ARM64 Details for river-0.20.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
river-0.20.1-cp311-cp311-macosx_12_0_x86_64.whl CPython 3.11 CPython 3.11 macOS 12.0+ x86-64 Details for river-0.20.1-cp311-cp311-macosx_12_0_x86_64.whl
river-0.20.1-cp311-cp311-macosx_12_0_universal2.whl CPython 3.11 CPython 3.11 macOS 12.0+ universal2 (ARM64, x86-64) Details for river-0.20.1-cp311-cp311-macosx_12_0_universal2.whl
river-0.20.1-cp311-cp311-macosx_11_0_universal2.whl CPython 3.11 CPython 3.11 macOS 11.0+ universal2 (ARM64, x86-64) Details for river-0.20.1-cp311-cp311-macosx_11_0_universal2.whl
river-0.20.1-cp310-cp310-win_amd64.whl CPython 3.10 CPython 3.10 Windows x86-64 Details for river-0.20.1-cp310-cp310-win_amd64.whl
river-0.20.1-cp310-cp310-win32.whl CPython 3.10 CPython 3.10 Windows x86-32 Details for river-0.20.1-cp310-cp310-win32.whl
river-0.20.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl CPython 3.10 CPython 3.10 Linux glibc 2.17+ ARM64 Details for river-0.20.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
river-0.20.1-cp310-cp310-macosx_12_0_x86_64.whl CPython 3.10 CPython 3.10 macOS 12.0+ x86-64 Details for river-0.20.1-cp310-cp310-macosx_12_0_x86_64.whl
river-0.20.1-cp39-cp39-win_amd64.whl CPython 3.9 CPython 3.9 Windows x86-64 Details for river-0.20.1-cp39-cp39-win_amd64.whl
river-0.20.1-cp39-cp39-win32.whl CPython 3.9 CPython 3.9 Windows x86-32 Details for river-0.20.1-cp39-cp39-win32.whl
river-0.20.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl CPython 3.9 CPython 3.9 Linux glibc 2.17+ ARM64 Details for river-0.20.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
river-0.20.1-cp39-cp39-macosx_12_0_x86_64.whl CPython 3.9 CPython 3.9 macOS 12.0+ x86-64 Details for river-0.20.1-cp39-cp39-macosx_12_0_x86_64.whl

Total release size: 43.1 MB

Release files / river-0.20.1.tar.gz

Download URL river-0.20.1.tar.gz
Size 796.8 kB
Tags Source
SHA-256 checksum
How to use checksums
bc34ac01055cffcc5cdd752be0dbedb1df1aa9f4384551dbbdbd1df245760802
BLAKE2b-256 checksum
How to use checksums
c81683d957def676a2e1635615d8ceba73f92013af16cd978f426ac8ad7cd231
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.6

Release files / river-0.20.1-cp312-cp312-win_amd64.whl

Download URL river-0.20.1-cp312-cp312-win_amd64.whl
Size 1.8 MB
Tags CPython 3.12 Windows x86-64
SHA-256 checksum
How to use checksums
c5318744a9a34e8c48ceba0109a694027f70b338d127e32602cb1d77f630f2b2
BLAKE2b-256 checksum
How to use checksums
43c3735b16909e8d28cfd06a9b8d6ed10bef2ea9e8b574a9d5f02e7e7ad6dc5f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.6

Release files / river-0.20.1-cp312-cp312-win32.whl

Download URL river-0.20.1-cp312-cp312-win32.whl
Size 1.7 MB
Tags CPython 3.12 Windows x86-32
SHA-256 checksum
How to use checksums
8baebcd663c8734ee8424b8a75dd6db6ee286a70638a37d48fe340bbb5939dd3
BLAKE2b-256 checksum
How to use checksums
356a1e0d3342923ff71a1f0a7bd8c0c03c6560d708d8f9876ee10b3c27ca75e9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.6

Release files / river-0.20.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl

Download URL river-0.20.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Size 4.0 MB
Tags CPython 3.12 Linux glibc 2.17+ ARM64
SHA-256 checksum
How to use checksums
4171c7ca37e30e8f95c89f31d0adcbe687818cdcf5c8bc3c93f9f6ccb1fea4a6
BLAKE2b-256 checksum
How to use checksums
b4f78d74a0590d94879c6e3b88a06e9b5fd7d805d9866133ed3540e83439fc47
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.6

Release files / river-0.20.1-cp312-cp312-macosx_12_0_x86_64.whl

Download URL river-0.20.1-cp312-cp312-macosx_12_0_x86_64.whl
Size 1.9 MB
Tags CPython 3.12 macOS 12.0+ x86-64
SHA-256 checksum
How to use checksums
bb4c1eb78c8d9448fe20922878c1c210904f2c09fad11100594132c87db38af9
BLAKE2b-256 checksum
How to use checksums
f85989fc439051951ba9ed9c45e3293c2dd4996c1f4491eeac12d51c8fe4c91d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.6

Release files / river-0.20.1-cp311-cp311-win_amd64.whl

Download URL river-0.20.1-cp311-cp311-win_amd64.whl
Size 1.8 MB
Tags CPython 3.11 Windows x86-64
SHA-256 checksum
How to use checksums
2cc9bdf96a0116aca19d306507b781b149bb5f7531119e7b1c63089ea54c74cd
BLAKE2b-256 checksum
How to use checksums
1d7d8ee86cf076b70516517f25e1915211e17536896be31d83cc56d07aeb160f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.6

Release files / river-0.20.1-cp311-cp311-win32.whl

Download URL river-0.20.1-cp311-cp311-win32.whl
Size 1.7 MB
Tags CPython 3.11 Windows x86-32
SHA-256 checksum
How to use checksums
ff696726a90fbe56dbd487e62178d84de3f70085875c3330dc8aa2b781a7421d
BLAKE2b-256 checksum
How to use checksums
5fcdf56e076b3f069e33d730d4e20d646268720cccb407336ed46fbb7df22033
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.6

Release files / river-0.20.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl

Download URL river-0.20.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Size 4.0 MB
Tags CPython 3.11 Linux glibc 2.17+ ARM64
SHA-256 checksum
How to use checksums
32e8e2e373edabaa1c3ff8d92dca1bdb3308ae2b8e408c6401de33ab24c1f2cb
BLAKE2b-256 checksum
How to use checksums
7f94bf7e96926e13562daa07b01124e125b1a4412802e4f8907ab8c8102c87e5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.6

Release files / river-0.20.1-cp311-cp311-macosx_12_0_x86_64.whl

Download URL river-0.20.1-cp311-cp311-macosx_12_0_x86_64.whl
Size 1.9 MB
Tags CPython 3.11 macOS 12.0+ x86-64
SHA-256 checksum
How to use checksums
973fd2908a8e399284886ad7c5029d82459496985a106362aa71436cb6459a3b
BLAKE2b-256 checksum
How to use checksums
f2935eb6aad0fc2f78dd49cf304d7a1185b750b447647afdacd2aca4c46a8f02
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.6

Release files / river-0.20.1-cp311-cp311-macosx_12_0_universal2.whl

File added late

This file was uploaded more than 14 days after the first file in this release.

While project maintainers occasionally add legitimate files to an existing release, late additions can also indicate a security compromise.

We recommend inspecting the release file before installing.

Download URL river-0.20.1-cp311-cp311-macosx_12_0_universal2.whl
Size 2.4 MB
Tags CPython 3.11 macOS 12.0+ universal2 (ARM64, x86-64)
SHA-256 checksum
How to use checksums
2358e5041d446bda4bff20c089f2c0562d5e21e57fdcaf29b48cf574b709982c
BLAKE2b-256 checksum
How to use checksums
257e0bb8c9c51d821d37a1dbe336a733c60aa343ecc7fe1d8448306797b285e7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.6

Release files / river-0.20.1-cp311-cp311-macosx_11_0_universal2.whl

File added late

This file was uploaded more than 14 days after the first file in this release.

While project maintainers occasionally add legitimate files to an existing release, late additions can also indicate a security compromise.

We recommend inspecting the release file before installing.

Download URL river-0.20.1-cp311-cp311-macosx_11_0_universal2.whl
Size 2.4 MB
Tags CPython 3.11 macOS 11.0+ universal2 (ARM64, x86-64)
SHA-256 checksum
How to use checksums
40ec7dc6dc7f1255d43f04867bcd35951fa45176ba9e33be76517c0328a11805
BLAKE2b-256 checksum
How to use checksums
6bfc2ff1597e00841605253a6d09d18350a4297fa732df371323b6a2946e72e2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.6

Release files / river-0.20.1-cp310-cp310-win_amd64.whl

Download URL river-0.20.1-cp310-cp310-win_amd64.whl
Size 1.8 MB
Tags CPython 3.10 Windows x86-64
SHA-256 checksum
How to use checksums
ef56052d3ed05e6bce3997d55972c938d4f695d7aea191b8e7e2d1a474855ef8
BLAKE2b-256 checksum
How to use checksums
8bb0e275f47540db63106c9d742a40180e89db5980ac71a91ea2961f3426680b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.6

Release files / river-0.20.1-cp310-cp310-win32.whl

Download URL river-0.20.1-cp310-cp310-win32.whl
Size 1.7 MB
Tags CPython 3.10 Windows x86-32
SHA-256 checksum
How to use checksums
0a437a02d41ae082e3d7bc447521c6c28571ba134486c9a88e337ddd3f3b44bb
BLAKE2b-256 checksum
How to use checksums
fb509a6b0397e66419cbf7f8cd229285eb14dcfbee34dd051558687b03cc0797
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.6

Release files / river-0.20.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl

Download URL river-0.20.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Size 3.9 MB
Tags CPython 3.10 Linux glibc 2.17+ ARM64
SHA-256 checksum
How to use checksums
d59375cf9182282b87c310e5b90b5a67f921b8ca44e856afa2bcf20b147ad24a
BLAKE2b-256 checksum
How to use checksums
c3cb3b28858a1b53d5ee591aa760cb5685d6c8022633ad5e925b5dc3c63ae24b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.6

Release files / river-0.20.1-cp310-cp310-macosx_12_0_x86_64.whl

Download URL river-0.20.1-cp310-cp310-macosx_12_0_x86_64.whl
Size 1.9 MB
Tags CPython 3.10 macOS 12.0+ x86-64
SHA-256 checksum
How to use checksums
709f37649598d5b7e692406e8b6c780d02e223ed8b318560635342d191b00a5a
BLAKE2b-256 checksum
How to use checksums
13bdebf26dbb4b586da45b845723252bab5ba4765a1d32493c9c5eaf052d53eb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.6

Release files / river-0.20.1-cp39-cp39-win_amd64.whl

Download URL river-0.20.1-cp39-cp39-win_amd64.whl
Size 1.8 MB
Tags CPython 3.9 Windows x86-64
SHA-256 checksum
How to use checksums
ba91d603434081a84012ed14603cdb22cbfb50182279fbcf2396991ebfa6da8e
BLAKE2b-256 checksum
How to use checksums
ce33981fa64bffd600966c11eb230c2e0e85763813f3c18d6cf14aa957d1ad9c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.6

Release files / river-0.20.1-cp39-cp39-win32.whl

Download URL river-0.20.1-cp39-cp39-win32.whl
Size 1.7 MB
Tags CPython 3.9 Windows x86-32
SHA-256 checksum
How to use checksums
86f8c79010b4866dcfd8ae0b102ab0d84104195e6597b28548811772432e5c9c
BLAKE2b-256 checksum
How to use checksums
6a61ca091d4751513b58482c3f040fb038728060ea99b411c6cec34536487a18
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.6

Release files / river-0.20.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl

Download URL river-0.20.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Size 3.9 MB
Tags CPython 3.9 Linux glibc 2.17+ ARM64
SHA-256 checksum
How to use checksums
61038f7bcedb1d3cda76c84d037d9c56191f0a4f496cd50a1ed3b6489ca88a47
BLAKE2b-256 checksum
How to use checksums
720a28c14503da11497939fa380864efae6df79b5f865fee52e16d0e77c185be
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.6

Release files / river-0.20.1-cp39-cp39-macosx_12_0_x86_64.whl

Download URL river-0.20.1-cp39-cp39-macosx_12_0_x86_64.whl
Size 1.9 MB
Tags CPython 3.9 macOS 12.0+ x86-64
SHA-256 checksum
How to use checksums
416fec8cc3b3d87713796ac2ed111c7837755a3627a84efbd1b5df5199d5d9c3
BLAKE2b-256 checksum
How to use checksums
6e96dbe7cb738b205cd2d285bc8b9cffb2c1c761be9a0e625f51a579be35f287
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.6

Security for river 0.20.1

Upload timing

Release files added late

2 files were uploaded more than 14 days after the first file in this release.

While project maintainers occasionally add legitimate files to an existing release, late additions can also indicate a security compromise.


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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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.

Release history Release notifications | RSS feed

This release

0.20.1 This release

19 release files No provenance

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