From e523df9e4f67250320b49095b647dfb65a4a4d87 Mon Sep 17 00:00:00 2001 From: Yukino Ikegami Date: Sat, 26 Nov 2016 04:15:13 +0900 Subject: [PATCH] v 0.2 --- CHANGES.rst | 8 ++++++++ README.rst | 25 +++++++++++++++++++++++-- oll/__init__.py | 4 ++-- 3 files changed, 33 insertions(+), 4 deletions(-) diff --git a/CHANGES.rst b/CHANGES.rst index 3cae048..f1b8a71 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -2,6 +2,14 @@ CHANGES ======= +0.2 (2016-11-26) +------------------- + +- scikit-learn like fit/predict interfaces are available +- Setting C and bias parameters is available in initialization +- Support Python 3.5 +- Unsupport Python 2.6 and 3.3 + 0.1.2 (2015-01-11) ------------------- diff --git a/README.rst b/README.rst index 4d88d5d..41063f6 100644 --- a/README.rst +++ b/README.rst @@ -5,7 +5,7 @@ oll-python This is a Python binding of the OLL library for machine learning. -Currently, OLL 0.03 supports following algorithms: +Currently, OLL 0.03 supports following binary classification algorithms: - Perceptron - Averaged Perceptron @@ -30,12 +30,33 @@ Usage .. code:: python import oll - o = oll.oll("CW") + # 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] + Note ---- diff --git a/oll/__init__.py b/oll/__init__.py index 3a4f9f5..55292d4 100644 --- a/oll/__init__.py +++ b/oll/__init__.py @@ -1,5 +1,5 @@ from .oll import oll -VERSION = (0, 1, 2) -__version__ = "0.1.2" +VERSION = (0, 2) +__version__ = "0.2" __all__ = ["oll"]