All Projects → ikegami-yukino → oll-python

ikegami-yukino / oll-python

Licence: BSD-3-Clause License
Online machine learning algorithms (based on OLL C++ library)

Programming Languages

C++
36643 projects - #6 most used programming language
python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to oll-python

MachineLearning
Implementations of machine learning algorithm by Python 3
Stars: ✭ 16 (-30.43%)
Mutual labels:  perceptron
perceptron
The simplest Perceptron you'll ever see
Stars: ✭ 45 (+95.65%)
Mutual labels:  perceptron
ml
经典机器学习算法的极简实现
Stars: ✭ 130 (+465.22%)
Mutual labels:  perceptron
Ensemble-of-Multi-Scale-CNN-for-Dermatoscopy-Classification
Fully supervised binary classification of skin lesions from dermatoscopic images using an ensemble of diverse CNN architectures (EfficientNet-B6, Inception-V3, SEResNeXt-101, SENet-154, DenseNet-169) with multi-scale input.
Stars: ✭ 25 (+8.7%)
Mutual labels:  binary-classification
efficient online learning
Efficient Online Transfer Learning for 3D Object Detection in Autonomous Driving
Stars: ✭ 20 (-13.04%)
Mutual labels:  online-learning
MiniVox
Code for our ACML and INTERSPEECH papers: "Speaker Diarization as a Fully Online Bandit Learning Problem in MiniVox".
Stars: ✭ 15 (-34.78%)
Mutual labels:  online-learning
Online-Category-Learning
ML algorithm for real-time classification
Stars: ✭ 67 (+191.3%)
Mutual labels:  online-learning
data aggregation
This repository contains the code for the CVPR 2020 paper "Exploring Data Aggregation in Policy Learning for Vision-based Urban Autonomous Driving"
Stars: ✭ 26 (+13.04%)
Mutual labels:  online-learning
keras-malicious-url-detector
Malicious URL detector using keras recurrent networks and scikit-learn classifiers
Stars: ✭ 24 (+4.35%)
Mutual labels:  binary-classification
fetch
A set of deep learning models for FRB/RFI binary classification.
Stars: ✭ 19 (-17.39%)
Mutual labels:  binary-classification
catseye
Neural network library written in C and Javascript
Stars: ✭ 29 (+26.09%)
Mutual labels:  perceptron
2018-JData-Unicom-RiskUser
2018-JData-联通-基于移动网络通讯行为的风险用户识别:Baseline 0.77
Stars: ✭ 20 (-13.04%)
Mutual labels:  binary-classification
EasyRec
A framework for large scale recommendation algorithms.
Stars: ✭ 599 (+2504.35%)
Mutual labels:  online-learning
COVID19Tweet
WNUT-2020 Task 2: Identification of informative COVID-19 English Tweets
Stars: ✭ 26 (+13.04%)
Mutual labels:  binary-classification
python-libmf
No description or website provided.
Stars: ✭ 24 (+4.35%)
Mutual labels:  online-learning
ML-MCU
Code for IoT Journal paper title 'ML-MCU: A Framework to Train ML Classifiers on MCU-based IoT Edge Devices'
Stars: ✭ 28 (+21.74%)
Mutual labels:  online-learning
perceptronCobol
A perceptron written in COBOL
Stars: ✭ 64 (+178.26%)
Mutual labels:  perceptron
alma-slipsomat
Tool for syncing Alma letters XSL files with a local folder
Stars: ✭ 16 (-30.43%)
Mutual labels:  alma
ConnectingDots
1. Perceptron: The very basic entity in Machine Learning. It's training and weights update in code. 2. Image Aesthetic Assessment: Determining the aesthetic content of an image. The network defined use Spatial Pyramid Pooling. 3. Image Classification: Alexnet architecture in Keras for image classification. Find more here
Stars: ✭ 12 (-47.83%)
Mutual labels:  perceptron
Remote-Work-and-Study-Resources
Free services, tools, articles and other resources for remote workers and distance learners
Stars: ✭ 49 (+113.04%)
Mutual labels:  online-learning

oll-python

travis-ci.org coveralls.io latest version license

This is a Python binding of the OLL library for machine learning.

Currently, OLL 0.03 supports following binary classification algorithms:

  • Perceptron
  • Averaged Perceptron
  • Passive Agressive (PA, PA-I, PA-II, Kernelized)
  • ALMA (modified slightly from original)
  • Confidence Weighted Linear-Classification.

For details of oll, see: http://code.google.com/p/oll

Installation

$ pip install oll

OLL library is bundled, so you don't need to install it separately.

Usage

import oll
# You can choose algorithms in
# "P" -> Perceptron,
# "AP" -> Averaged Perceptron,
# "PA" -> Passive Agressive,
# "PA1" -> Passive Agressive-I,
# "PA2" -> Passive Agressive-II,
# "PAK" -> Kernelized Passive Agressive,
# "CW" -> Confidence Weighted Linear-Classification,
# "AL" -> ALMA
o = oll.oll("CW", C=1.0, bias=0.0)
o.add({0: 1.0, 1: 2.0, 2: -1.0}, 1)  # train
o.classify({0:1.0, 1:1.0})  # predict
o.save('oll.model')
o.load('oll.model')

# scikit-learn like fit/predict interface
import numpy as np
array = np.array([[1, 2, -1], [0, 0, 1]])
o.fit(array, [1, -1])
o.predict(np.array([[1, 2, -1], [0, 0, 1]]))
# => [1, -1]
from scipy.sparse import csr_matrix
matrix = csr_matrix([[1, 2, -1], [0, 0, 1]])
o.fit(matrix, [1, -1])
o.predict(matrix)
# => [1, -1]

# Multi label classification
import time
import oll
from sklearn.multiclass import OutputCodeClassifier
from sklearn import datasets, cross_validation, metrics


dataset = datasets.load_digits()
ALGORITHMS = ("P", "AP", "PA", "PA1", "PA2", "PAK", "CW", "AL")
for algorithm in ALGORITHMS:
    print(algorithm)
    occ_predicts = []
    expected = []
    start = time.time()
    for (train_idx, test_idx) in cross_validation.StratifiedKFold(dataset.target,
                                                                  n_folds=10, shuffle=True):
        clf = OutputCodeClassifier(oll.oll(algorithm))
        clf.fit(dataset.data[train_idx], dataset.target[train_idx])
        occ_predicts += list(clf.predict(dataset.data[test_idx]))
        expected += list(dataset.target[test_idx])
    print('Elapsed time: %s' % (time.time() - start))
    print('Accuracy', metrics.accuracy_score(expected, occ_predicts))
# => P
# => Elapsed time: 109.82188701629639
# => Accuracy 0.770172509738
# => AP
# => Elapsed time: 111.42936396598816
# => Accuracy 0.760155815248
# => PA
# => Elapsed time: 110.95964503288269
# => Accuracy 0.74735670562
# => PA1
# => Elapsed time: 111.39844799041748
# => Accuracy 0.806343906511
# => PA2
# => Elapsed time: 115.12716913223267
# => Accuracy 0.766277128548
# => PAK
# => Elapsed time: 119.53838682174683
# => Accuracy 0.77796327212
# => CW
# => Elapsed time: 121.20785689353943
# => Accuracy 0.771285475793
# => AL
# => Elapsed time: 116.52497220039368
# => Accuracy 0.785754034502

Note

  • This module requires C++ compiler to build.
  • oll.cpp & oll.hpp : Copyright (c) 2011, Daisuke Okanohara
  • oll_swig_wrap.cxx is generated based on 'oll_swig.i' in oll-ruby (https://github.com/syou6162/oll-ruby)

License

New BSD License.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].