Skip to main content
QUICK REVIEW

[Paper Review] River: machine learning for streaming data in Python

Jacob Montiel, Max Halford|arXiv (Cornell University)|Dec 8, 2020
Machine Learning and Data ClassificationComputer Science3 references159 citations
TL;DR

River is a Python library for streaming/online machine learning, merging Creme and scikit-multiflow, with a unified architecture, pipelines, and benchmarks for diverse tasks.

ABSTRACT

River is a machine learning library for dynamic data streams and continual learning. It provides multiple state-of-the-art learning methods, data generators/transformers, performance metrics and evaluators for different stream learning problems. It is the result from the merger of the two most popular packages for stream learning in Python: Creme and scikit-multiflow. River introduces a revamped architecture based on the lessons learnt from the seminal packages. River's ambition is to be the go-to library for doing machine learning on streaming data. Additionally, this open source package brings under the same umbrella a large community of practitioners and researchers. The source code is available at https://github.com/online-ml/river.

Motivation & Objective

  • Enable machine learning on streaming data with continual learning capabilities.
  • Provide a flexible, unified architecture that supports multiple learning tasks (classification, regression, clustering, forecasting, anomaly detection).
  • Offer transformers, pipelines, and performance evaluators to facilitate reproducible stream experiments.
  • Benchmark River against existing streaming libraries to evaluate accuracy and speed.
  • Promote accessibility and community adoption by consolidating tools under one open-source package.

Proposed method

  • Architectural design with task-specific mixins to ensure compatibility across learning tasks (classification, regression, clustering, etc.).
  • Core learning interfaces learn_one and predict_one (and related methods) for instance-incremental learning; supports batch-incremental via learn_many/predict_many.
  • Pipelines to chain transformers and estimators, enabling preprocessing (e.g., StandardScaler) before learners.
  • Efficient dictionary-based data containers with Cython-backed operations for fast feature handling and feature evolution.
  • Instance-incremental and limited batch-incremental learning approaches to handle streaming data in real time.
  • Benchmarking against existing libraries (GNB, LR, Hoeffding Tree) on Elec2 dataset, comparing accuracy and processing time.

Experimental results

Research questions

  • RQ1How does River's accuracy compare to scikit-learn, Creme, and scikit-multiflow on standard streaming benchmarks like Elec2?
  • RQ2How do River's learn_one/predict_one and learn_many/predict_many performance compare in terms of speed and scalability across models?
  • RQ3Does River provide comparable or superior speed while maintaining competitive accuracy across key streaming tasks (classification, regression, clustering, forecasting, anomaly detection)?
  • RQ4What architectural features (mixins, pipelines, dictionary-based data containers) most effectively support model extensibility and feature evolution in streaming contexts?

Key findings

  • River achieves comparable accuracy to other streaming libraries on the Elec2 benchmark for Gaussian Naive Bayes, Logistic Regression, and Hoeffding Tree.
  • River generally offers faster learn and predict times than competing libraries on the Elec2 dataset, indicating strong runtime performance.
  • On the Elec2 benchmark, River's accuracy is closely aligned with scikit-learn, Creme, and scikit-multiflow across the evaluated models, demonstrating competitive predictive performance.
  • The architecture emphasizes flexibility, ease of use, and a unified interface for both instance-incremental and limited batch-incremental learning, supporting diverse streaming scenarios.
  • Benchmark results illustrate River’s capacity to serve as a go-to library for streaming machine learning with a broad set of supported tasks and efficient performance.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.