This is onelearn’s documentation Documentation Status PyPI - Python Version PyPI - Wheel GitHub stars GitHub issues GitHub license

onelearn stands for ONE-shot LEARNning. It is a small python package for online learning with Python. It provides :

  • online (or one-shot) learning algorithms: each sample is processed once, only a single pass is performed on the data
  • including multi-class classification and regression algorithms
  • For now, only ensemble methods, namely Random Forests


onelearn follows the scikit-learn API: you call fit instead of partial_fit each time a new bunch of data is available and use predict_proba or predict whenever you need predictions.

from onelearn import AMFClassifier

amf = AMFClassifier(n_classes=2)
clf.partial_fit(X_train, y_train)
y_pred = clf.predict_proba(X_test)[:, 1]

Each time you call partial_fit the algorithm updates its decision function using the new data as illustrated in the next figure.



The easiest way to install onelearn is using pip :

pip install onelearn

But you can also use the latest development from github directly with

pip install git+

Where to go from here?

To know more about onelearn, check out our example gallery or browse through the module reference using the left navigation bar.