River trains and updates models on streaming data one observation at a time in Python. It merged creme and scikit-multiflow and covers drift detection, bandits, forecasting, and many incremental algorithms.
Overview
River is a Python library for online machine learning on streaming data. It aims to be approachable for incremental learning where predictions and model updates interleave on each arriving example.
River is the result of merging creme and scikit-multiflow. It supports Python 3.11 and above with pip wheels on Linux, macOS, and Windows; Cython and Rust are needed to install the latest development version from GitHub.
Algorithm families include linear models with many optimizers, decision trees and random forests, approximate nearest neighbors, anomaly and drift detection, recommenders, time series forecasting, bandits, factorization machines, imbalanced learning, clustering, ensembling, and active learning. Online utilities cover feature extraction, metrics, preprocessing, datasets, progressive validation, and pipelines.
Batch learning is usually enough; online learning fits when models must learn continuously from streams.
Key features
- One-pass learnone and predictone API
- Incremental linear and tree models
- Drift and anomaly detection
- Streaming metrics and preprocessing
- Bandits and recommendation models
- Time series forecasting modules
- Built-in progressive validation
- Optional pandas mini-batch interface
Use cases
- Updating models on live data streams
- Detecting concept drift online
- Scoring events as they arrive
- Teaching incremental learning workflows