river

🌊 Online machine learning in Python

https://github.com/online-ml/river

Science Score: 59.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • β—‹
    CITATION.cff file
  • βœ“
    codemeta.json file
    Found codemeta.json file
  • βœ“
    .zenodo.json file
    Found .zenodo.json file
  • βœ“
    DOI references
    Found 1 DOI reference(s) in README
  • βœ“
    Academic publication links
    Links to: acm.org
  • βœ“
    Committers with academic emails
    5 of 126 committers (4.0%) from academic institutions
  • β—‹
    Institutional organization owner
  • β—‹
    JOSS paper metadata
  • β—‹
    Scientific vocabulary similarity
    Low similarity (12.3%) to scientific vocabulary

Keywords

concept-drift data-science incremental-learning machine-learning online-learning online-machine-learning online-statistics python real-time-processing stream-processing streaming streaming-data

Keywords from Contributors

cryptocurrencies data-profiling datacleaner pipeline-testing agents spacy-extension transformers mlops jax wavelets
Last synced: 6 months ago · JSON representation

Repository

🌊 Online machine learning in Python

Basic Info
  • Host: GitHub
  • Owner: online-ml
  • License: bsd-3-clause
  • Language: Python
  • Default Branch: main
  • Homepage: https://riverml.xyz
  • Size: 318 MB
Statistics
  • Stars: 5,510
  • Watchers: 83
  • Forks: 591
  • Open Issues: 142
  • Releases: 17
Topics
concept-drift data-science incremental-learning machine-learning online-learning online-machine-learning online-statistics python real-time-processing stream-processing streaming streaming-data
Created about 7 years ago · Last pushed 6 months ago
Metadata Files
Readme Contributing Funding License Code of conduct Citation Codeowners

README.md

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.

```python

from pprint import pprint from river import datasets

dataset = datasets.Phishing()

for x, y in dataset: ... pprint(x) ... print(y) ... break {'ageofdomain': 1, 'anchorfromotherdomain': 0.0, 'emptyserverformhandler': 0.0, 'https': 0.0, 'ipinurl': 1, 'ispopular': 0.5, 'longurl': 1.0, 'popupwindow': 0.0, 'requestfromotherdomain': 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.

```python

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: ... ypred = model.predictone(x) # make a prediction ... metric.update(y, ypred) # update the metric ... model.learnone(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.10 and above. Installation can be done with pip:

sh 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:

sh 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:

bibtex @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.

Owner

  • Name: The Fellowship of Online Machine Learning
  • Login: online-ml
  • Kind: organization

GitHub Events

Total
  • Create event: 28
  • Release event: 1
  • Issues event: 21
  • Watch event: 406
  • Delete event: 24
  • Issue comment event: 120
  • Push event: 90
  • Pull request review comment event: 14
  • Pull request review event: 28
  • Pull request event: 95
  • Fork event: 58
Last Year
  • Create event: 28
  • Release event: 1
  • Issues event: 21
  • Watch event: 406
  • Delete event: 24
  • Issue comment event: 120
  • Push event: 90
  • Pull request review comment event: 14
  • Pull request review event: 28
  • Pull request event: 95
  • Fork event: 58

Committers

Last synced: 9 months ago

All Time
  • Total Commits: 3,538
  • Total Committers: 126
  • Avg Commits per committer: 28.079
  • Development Distribution Score (DDS): 0.559
Past Year
  • Commits: 80
  • Committers: 18
  • Avg Commits per committer: 4.444
  • Development Distribution Score (DDS): 0.6
Top Committers
Name Email Commits
Max Halford m****5@g****m 1,560
Jacob Montiel j****l@g****m 678
smastelini s****i@g****m 284
gbolmier g****r@g****m 134
raphaelsty r****y@g****m 106
Adil Zouitine a****m@g****m 75
darkmyter b****4@g****m 52
Saulo Martiello Mastelini m****i@u****r 50
guimatsumoto g****o@g****m 46
krifi_amine a****4@g****m 45
garawalid g****4@g****m 40
hoanganhngo610 5****0 29
PGijsbers p****s@t****l 28
Vaysse Robin r****e@h****r 28
Etienne Kintzler e****r@g****m 27
jesse j****d@g****m 20
Γ‰mile 7****3 19
Gaurav Sharma g****9@g****m 19
AndreFCruz a****7@g****m 18
= = 17
Alexey C 5****K 16
Bruno Charron b****o@c****l 15
dependabot[bot] 4****] 14
Cedric Kulbach 4****c 11
Max Hauser m****r@g****m 10
Ferdinand Mom f****m@e****r 10
Gilberto Olimpio g****o@g****m 8
Alban de Crevoisier a****r@g****m 8
Buster Styren s****n@k****e 6
Mert OZER m****4@g****m 6
and 96 more...

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 238
  • Total pull requests: 276
  • Average time to close issues: about 1 month
  • Average time to close pull requests: 14 days
  • Total issue authors: 97
  • Total pull request authors: 68
  • Average comments per issue: 2.82
  • Average comments per pull request: 1.53
  • Merged pull requests: 182
  • Bot issues: 0
  • Bot pull requests: 38
Past Year
  • Issues: 19
  • Pull requests: 78
  • Average time to close issues: 17 days
  • Average time to close pull requests: 14 days
  • Issue authors: 14
  • Pull request authors: 22
  • Average comments per issue: 2.0
  • Average comments per pull request: 0.99
  • Merged pull requests: 33
  • Bot issues: 0
  • Bot pull requests: 17
Top Authors
Issue Authors
  • MaxHalford (80)
  • e10e3 (13)
  • yolking (6)
  • robme-l (6)
  • cdeterman (4)
  • niccolopetti (3)
  • jpfeil (3)
  • MarekWadinger (3)
  • raul-parada (3)
  • danielnowakassis (3)
  • Yasmen-Wahba (3)
  • gbolmier (2)
  • hesamgh77 (2)
  • sebasmos (2)
  • qetdr (2)
Pull Request Authors
  • dependabot[bot] (59)
  • MaxHalford (57)
  • e10e3 (43)
  • smastelini (23)
  • slach31 (20)
  • gbolmier (13)
  • Mo3ad-S (9)
  • danielnowakassis (8)
  • AdilZouitine (6)
  • boragokbakan (5)
  • MarekWadinger (5)
  • mbispham (4)
  • davidlpgomes (4)
  • hoanganhngo610 (4)
  • ColdTeapot273K (4)
Top Labels
Issue Labels
New feature (51) Good first issue (16) Enhancement (14) Needs researching (9) Discussion (6) Bug (5) Documentation (4) Code quality (2) Performance (1) Feature (1)
Pull Request Labels
dependencies (59) python (18) codeball:needs-careful-review (4) Bug (4) New feature (4) Improvement (2) github_actions (2) Feature (1)

Packages

  • Total packages: 3
  • Total downloads:
    • pypi 107,603 last-month
  • Total docker downloads: 274
  • Total dependent packages: 26
    (may contain duplicates)
  • Total dependent repositories: 63
    (may contain duplicates)
  • Total versions: 29
  • Total maintainers: 1
pypi.org: river

Online machine learning in Python

  • Versions: 23
  • Dependent Packages: 26
  • Dependent Repositories: 63
  • Downloads: 107,603 Last month
  • Docker Downloads: 274
Rankings
Dependent packages count: 0.4%
Stargazers count: 1.1%
Average: 1.8%
Dependent repos count: 1.9%
Downloads: 2.0%
Forks count: 2.3%
Docker downloads count: 3.1%
Maintainers (1)
Last synced: 6 months ago
proxy.golang.org: github.com/online-ml/river
  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Dependent packages count: 6.5%
Average: 6.7%
Dependent repos count: 7.0%
Last synced: 6 months ago
conda-forge.org: river
  • Versions: 5
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Stargazers count: 5.3%
Forks count: 7.3%
Average: 24.4%
Dependent repos count: 34.0%
Dependent packages count: 51.2%
Last synced: 6 months ago