river
Online machine learning in Python
Decision gist · record as of 2026-08-14
Yes. River is worth installing if you need online machine learning on streaming data—a genuinely different problem from batch learning. Active maintenance, no known vulnerabilities, permissive licensing, and prebuilt wheels across platforms make it low-friction. Start with it if concept drift, event-driven learning, or single-sample-at-a-time processing matches your use case; skip it if standard batch learning suffices.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Python 3.11 or above.
- Development installation from source requires Cython and Rust.
- Medium install friction with prebuilt wheels for Python 3.11+ across Linux, macOS, and Windows.
License · maintenance · safety
BSD-3-Clause (permissive) — BSD-3-Clause permissive license allows commercial use, modification, and distribution with minimal restrictions, making it suitable for most production and research contexts.
last release 2026-05-31 (75 days) · last repo commit 2026-08-12 · 5,916 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 213,412 downloads/mo, #9,437 on PyPI
Alternatives
Verify before relying
pip install river
from river import compose, linear_model, metrics, preprocessing
model = compose.Pipeline(
preprocessing.StandardScaler(),
linear_model.LogisticRegression()
)
metric = metrics.Accuracy()
for x, y in dataset:
y_pred = model.predict_one(x)
metric.update(y, y_pred)
model.learn_one(x, y)- Performance characteristics compared to batch learning libraries for specific use cases
- Memory footprint and scalability limits for very high-frequency streaming scenarios
- Maturity and stability of individual algorithm implementations within the library
What it is and what it does
River is a Python library for online machine learning on streaming data, designed for scenarios where models must learn continuously from new observations without revisiting historical data. It implements a wide range of algorithms—linear models, decision trees, random forests, nearest neighbors, anomaly detection, clustering, and time series forecasting—all optimized for the online learning paradigm where predictions and model updates interleave on single samples.
The library emphasizes user-friendliness and clarity over raw performance, with a core interface (`learn_one`/`predict_one`) that has no pandas dependency. It depends on scipy, numpy, and altair for visualization. River targets scenarios where concept drift matters, where production systems are event-driven, or where you need a model that adapts to new data without batch retraining. It requires Python 3.11 or above.
Use it for
- Real-time fraud detection systems that adapt to evolving fraud patterns without retraining on historical data
- Sensor data anomaly detection in IoT deployments where data arrives continuously and must be processed one observation at a time
- Adaptive recommendation systems that learn user preferences from streaming interaction events
- Time series forecasting for stock prices or weather data where concept drift is common
- Online clustering of streaming data for customer segmentation that evolves over time
- Model validation and evaluation in production contexts where data distribution may shift
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes.
River is worth installing if you need online machine learning on streaming data—a genuinely different problem from batch learning. Active maintenance, no known vulnerabilities, permissive licensing, and prebuilt wheels across platforms make it low-friction. Start with it if concept drift, event-driven learning, or single-sample-at-a-time processing matches your use case; skip it if standard batch learning suffices.
Install
river on PyPI
Before you install
Medium install friction with prebuilt wheels for Python 3.11+ across Linux, macOS, and Windows. Active maintenance with a recent release (75 days ago) and 5916 repository stars. Core functionality has no pandas dependency; pandas support is opt-in.
Requires Python 3.11 or above. Development installation from source requires Cython and Rust.
License in practice
BSD-3-Clause permissive license allows commercial use, modification, and distribution with minimal restrictions, making it suitable for most production and research contexts.
Quickstart
pip install river
from river import compose, linear_model, metrics, preprocessing
model = compose.Pipeline(
preprocessing.StandardScaler(),
linear_model.LogisticRegression()
)
metric = metrics.Accuracy()
for x, y in dataset:
y_pred = model.predict_one(x)
metric.update(y, y_pred)
model.learn_one(x, y)
Verify before relying
- Performance characteristics compared to batch learning libraries for specific use cases
- Memory footprint and scalability limits for very high-frequency streaming scenarios
- Maturity and stability of individual algorithm implementations within the library
Package facts
| License | BSD-3-Clause permissive |
| Python support | Supports the current Python release >=3.11 |
| Install friction | Medium. Platform-specific wheel |
| Runtime dependencies | 3 packagesscipynumpyaltair |
| Maintenance | Actively maintained 75 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 213,412 / month, #9,437 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
Evidence: river-0.25.0-cp311-cp311-macosx_10_13_universal2.whl; river-0.25.0-cp311-cp311-manylinux_2_28_aarch64.whl; river-0.25.0-cp311-cp311-manylinux_2_28_x86_64.whl; river-0.25.0-cp311-cp311-musllinux_1_2_aarch64.whl; river-0.25.0-cp311-cp311-musllinux_1_2_x86_64.whl; river-0.25.0-cp311-cp311-win_amd64.whl; river-0.25.0-cp312-cp312-macosx_10_13_universal2.whl; river-0.25.0-cp312-cp312-manylinux_2_28_aarch64.whl; river-0.25.0-cp312-cp312-manylinux_2_28_x86_64.whl; river-0.25.0-cp312-cp312-musllinux_1_2_aarch64.whl; river-0.25.0-cp312-cp312-musllinux_1_2_x86_64.whl; river-0.25.0-cp312-cp312-win_amd64.whl; river-0.25.0-cp313-cp313-macosx_10_13_universal2.whl; river-0.25.0-cp313-cp313-manylinux_2_28_aarch64.whl; river-0.25.0-cp313-cp313-manylinux_2_28_x86_64.whl; river-0.25.0-cp313-cp313-musllinux_1_2_aarch64.whl; river-0.25.0-cp313-cp313-musllinux_1_2_x86_64.whl; river-0.25.0-cp313-cp313-win_amd64.whl; river-0.25.0-cp314-cp314-macosx_10_15_universal2.whl; river-0.25.0-cp314-cp314-manylinux_2_28_aarch64.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “online machine learning streaming”
- riverRiver provides online machine learning algorithms that learn from…
- azure-ai-mlProvides a Python client library for interacting with Azure Machine…
- feastFeast is an open-source feature store that manages offline and online…
Give your agent the search over MCP, or paste the wish link into any chat.
More Artificial Intelligence packages
LiteLLM provides a unified Python interface to call 100+ LLM providers (OpenAI, Anthropic, Gemini, Bedrock, Azure, and others) using OpenAI-compatible API format, available as both a Python SDK and a self-hosted AI Gateway proxy server.
Install it if you need to work with multiple LLM providers or want to centralize LLM routing in your organization.
Client library and CLI tool for downloading, uploading, and managing models, datasets, and repositories on the Hugging Face Hub platform.
Install it if you work with Hugging Face Hub models or datasets.
LangChain provides a framework for building agents and LLM-powered applications by composing language models, tools, and memory through a unified API that abstracts over multiple model providers.
hf-xet provides chunk-based deduplication and efficient file transfer for the Hugging Face Hub, enabling faster uploads and downloads of large files with local disk caching.
Tokenizers converts raw text into token sequences for NLP models, with support for training custom vocabularies and using pre-built tokenizers (BPE, WordPiece) optimized for speed via Rust.
Transformers provides a unified framework for loading, fine-tuning, and running state-of-the-art pretrained models across text, vision, audio, video, and multimodal tasks using PyTorch, JAX, or TensorFlow.
Install it if you need to run or train any transformer-based model for NLP, vision, audio, or multimodal tasks.
See also crick · tslearn · darts · sktime · drain3 · h2o · pypots · imblearn · libcuml-cu12 · alibi-detect