Library For Online Machine Learning
Project description
LIBOML:Library For Online Machine Learning
Here we implement representative online learning algorithms. We split these algorithms into 3 parts:
- Linear classifiers;
- Kernel classifiers;
- Deep classifiers.
The models we have implement:
| Name | Binary/Multiclass | Description |
|---|---|---|
OGDBinaryClassifier |
binary | Online gradient descent algorithm with logistic loss. |
OGDClassifier |
multiclass | Online gradient descent algorithm with cross-entropy loss. |
PAClassifier |
binary | Passive-aggresive algorithm with 3 types of step-size calculation. |
Perceptron |
binary | Perceptron algorithm. |
KernelOGD |
binary | Online gradient descent with kernels using logistic loss. |
KernelPercetron |
binary | Perceptron with kernels. |
KernelSVM |
binary | Online SVM with kernels. |
MLPClassifier |
multiclass | Online multi-layer percetron with cross-entropy loss. |
ODLClassifier |
multiclass | Online deep learning framework. |
ODLAEClassifier |
multiclass | Online deep learning with Auto-Encoder. |
Install
pip install liboml
or
git clone https://github.com/Kaslanarian/liboml
cd liboml
python setup.py install
How to use
Our implementation is based on sklearn, so you can easily use it just like this:
from sklearn.dataset import load_breast_cancer
from sklearn.preprocessing import StandardScaler
from sklearn.model_selection import train_test_split
from liboml.linear import OGDClassifier
X, y = load_breast_cancer(return_X_y=True)
train_X, test_X, train_y, test_y = train_test_split(
X,
y,
train_size=0.8,
random_state=42,
)
stder = StandardScaler().fit(train_X)
train_X, test_X = stder.transform(train_X), stder.transform(test_X)
model = OGDClassifier(init_lr=0.1)
model.fit(train_X, train_y)
acc = model.score(test_X, test_y)
print(acc) # 0.9649122807017544
Future
- More algorithms.
- Support GPU.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
liboml-0.0.2.tar.gz
(7.7 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
liboml-0.0.2-py3-none-any.whl
(12.0 kB
view details)
File details
Details for the file liboml-0.0.2.tar.gz.
File metadata
- Download URL: liboml-0.0.2.tar.gz
- Upload date:
- Size: 7.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.7.1 importlib_metadata/4.11.3 pkginfo/1.8.3 requests/2.28.1 requests-toolbelt/0.9.1 tqdm/4.64.1 CPython/3.10.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ec0943113dab19a38815f70ae5d13e0dbb1e4660c42c59ff666561821f870d2f
|
|
| MD5 |
232706fff8ca2b9bca1f26c163001363
|
|
| BLAKE2b-256 |
3d53ced323c3187be51a4a6db2bb1279b48360cbd112ce7587a8da8a8077e191
|
File details
Details for the file liboml-0.0.2-py3-none-any.whl.
File metadata
- Download URL: liboml-0.0.2-py3-none-any.whl
- Upload date:
- Size: 12.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.7.1 importlib_metadata/4.11.3 pkginfo/1.8.3 requests/2.28.1 requests-toolbelt/0.9.1 tqdm/4.64.1 CPython/3.10.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9ab2c39094654038d13c219b8f3fe206b7ae3c805dac8f2ede03757215232069
|
|
| MD5 |
22bd956617fafd68bcede6534a405897
|
|
| BLAKE2b-256 |
e2ce72ec7a42988dda75cd17586a1307c3cbecb528012aeebc6384b45f88ef63
|