{ "info": { "author": "Yukino Ikegami", "author_email": "yknikgm@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", "Intended Audience :: Science/Research", "License :: OSI Approved :: BSD License", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Topic :: Scientific/Engineering :: Artificial Intelligence", "Topic :: Scientific/Engineering :: Information Analysis", "Topic :: Text Processing :: Linguistic" ], "description": "oll-python\n==========\n\n|travis| |coveralls| |version| |license|\n\nThis is a Python binding of the OLL library for machine learning.\n\nCurrently, OLL 0.03 supports following binary classification algorithms:\n\n- Perceptron\n- Averaged Perceptron\n- Passive Agressive (PA, PA-I, PA-II)\n- ALMA (modified slightly from original)\n- Confidence Weighted Linear-Classification.\n\nFor details of oll, see: http://code.google.com/p/oll\n\nInstallation\n------------\n\n::\n\n $ pip install oll\n\nOLL library is bundled, so you don't need to install it separately.\n\nUsage\n-----\n\n.. code:: python\n\n import oll\n # You can choose algorithms in\n # \"P\" -> Perceptron,\n # \"AP\" -> Averaged Perceptron,\n # \"PA\" -> Passive Agressive,\n # \"PA1\" -> Passive Agressive-I,\n # \"PA2\" -> Passive Agressive-II,\n # \"PAK\" -> Kernelized Passive Agressive,\n # \"CW\" -> Confidence Weighted Linear-Classification,\n # \"AL\" -> ALMA\n o = oll.oll(\"CW\", C=1.0, bias=0.0)\n o.add({0: 1.0, 1: 2.0, 2: -1.0}, 1) # train\n o.classify({0:1.0, 1:1.0}) # predict\n o.save('oll.model')\n o.load('oll.model')\n\n # scikit-learn like fit/predict interface\n import numpy as np\n array = np.array([[1, 2, -1], [0, 0, 1]])\n o.fit(array, [1, -1])\n o.predict(np.array([[1, 2, -1], [0, 0, 1]]))\n # => [1, -1]\n from scipy.sparse import csr_matrix\n matrix = csr_matrix([[1, 2, -1], [0, 0, 1]])\n o.fit(matrix, [1, -1])\n o.predict(matrix)\n # => [1, -1]\n\n # Multi label classification\n import time\n import oll\n from sklearn.multiclass import OutputCodeClassifier\n from sklearn import datasets, cross_validation, metrics\n\n\n dataset = datasets.load_digits()\n ALGORITHMS = (\"P\", \"AP\", \"PA\", \"PA1\", \"PA2\", \"PAK\", \"CW\", \"AL\")\n for algorithm in ALGORITHMS:\n print(algorithm)\n occ_predicts = []\n expected = []\n start = time.time()\n for (train_idx, test_idx) in cross_validation.StratifiedKFold(dataset.target,\n n_folds=10, shuffle=True):\n clf = OutputCodeClassifier(oll.oll(algorithm))\n clf.fit(dataset.data[train_idx], dataset.target[train_idx])\n occ_predicts += list(clf.predict(dataset.data[test_idx]))\n expected += list(dataset.target[test_idx])\n print('Elapsed time: %s' % (time.time() - start))\n print('Accuracy', metrics.accuracy_score(expected, occ_predicts))\n # => P\n # => Elapsed time: 109.82188701629639\n # => Accuracy 0.770172509738\n # => AP\n # => Elapsed time: 111.42936396598816\n # => Accuracy 0.760155815248\n # => PA\n # => Elapsed time: 110.95964503288269\n # => Accuracy 0.74735670562\n # => PA1\n # => Elapsed time: 111.39844799041748\n # => Accuracy 0.806343906511\n # => PA2\n # => Elapsed time: 115.12716913223267\n # => Accuracy 0.766277128548\n # => PAK\n # => Elapsed time: 119.53838682174683\n # => Accuracy 0.77796327212\n # => CW\n # => Elapsed time: 121.20785689353943\n # => Accuracy 0.771285475793\n # => AL\n # => Elapsed time: 116.52497220039368\n # => Accuracy 0.785754034502\n\nNote\n----\n- This module requires C++ compiler to build.\n- oll.cpp & oll.hpp : Copyright (c) 2011, Daisuke Okanohara\n- oll_swig_wrap.cxx is generated based on 'oll_swig.i' in oll-ruby (https://github.com/syou6162/oll-ruby)\n\nLicense\n-------\nNew BSD License.\n\n.. |travis| image:: https://travis-ci.org/ikegami-yukino/oll-python.svg?branch=master\n :target: https://travis-ci.org/ikegami-yukino/oll-python\n :alt: travis-ci.org\n.. |coveralls| image:: https://coveralls.io/repos/ikegami-yukino/oll-python/badge.png\n :target: https://coveralls.io/r/ikegami-yukino/oll-python\n :alt: coveralls.io\n\n.. |version| image:: https://img.shields.io/pypi/v/oll.svg\n :target: http://pypi.python.org/pypi/oll/\n :alt: latest version\n\n.. |license| image:: https://img.shields.io/pypi/l/oll.svg\n :target: http://pypi.python.org/pypi/oll/\n :alt: license\n\n\n\nCHANGES\n=======\n\n0.2.1 (2017-6-30)\n-------------------\n\n- Multi label clasification (using scikit-learn)\n- Support Python 3.6\n\n0.2 (2016-11-26)\n-------------------\n\n- scikit-learn like fit/predict interfaces are available\n- Setting C and bias parameters is available in initialization\n- Support Python 3.5\n- Unsupport Python 2.6 and 3.3\n\n0.1.2 (2015-01-11)\n-------------------\n\n- Support testFile method\n- docstrings are available\n\n0.1.1 (2014-03-29)\n-------------------\n\n- Compatibility some compilers\n\n\n0.1 (2013-10-11)\n-------------------\n\n- Initial release.\n\n", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/ikegami-yukino/oll-python", "keywords": "machine learning", "license": "", "maintainer": "", "maintainer_email": "", "name": "oll", "package_url": "https://pypi.org/project/oll/", "platform": "", "project_url": "https://pypi.org/project/oll/", "project_urls": { "Homepage": "https://github.com/ikegami-yukino/oll-python" }, "release_url": "https://pypi.org/project/oll/0.2.1/", "requires_dist": null, "requires_python": "", "summary": "Online binary classification algorithms library (wrapper for OLL C++ library)", "version": "0.2.1" }, "last_serial": 2987989, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "0fa81dc4875d86b9d4892caabdd5d012", "sha256": "15b354aac18137215bfecc92aa400ab78a546762375032e5e91aed0f9a594563" }, "downloads": -1, "filename": "oll-0.1.tar.gz", "has_sig": false, "md5_digest": "0fa81dc4875d86b9d4892caabdd5d012", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 66823, "upload_time": "2013-10-11T17:03:31", "url": "https://files.pythonhosted.org/packages/16/d4/922d2807126c11c356df54a9efec2ff3971da40745c1f850967e2f277b48/oll-0.1.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "2ba30a544ff523c89bb7530949608c92", "sha256": "be345faf4f0b9e6982db8ee310f93f81be26cea8b2f533a0eaf5f1dc26754238" }, "downloads": -1, "filename": "oll-0.1.1.tar.gz", "has_sig": false, "md5_digest": "2ba30a544ff523c89bb7530949608c92", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 67185, "upload_time": "2014-03-29T02:52:52", "url": "https://files.pythonhosted.org/packages/80/11/89790a317649ac55b640a774af7b3b295d346175e75fdb7023e12974c8e9/oll-0.1.1.tar.gz" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "3559d0b9f94d350281028117d7805105", "sha256": "82f3848811d4f2c7bd192cf4cba686101d07187dff9a55acd44158c694147899" }, "downloads": -1, "filename": "oll-0.1.2.tar.gz", "has_sig": false, "md5_digest": "3559d0b9f94d350281028117d7805105", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 67794, "upload_time": "2015-01-10T21:27:38", "url": "https://files.pythonhosted.org/packages/99/79/95fb9a36715f347fad4705b0058848e578f395651a4ffc54d126c1829d1c/oll-0.1.2.tar.gz" } ], "0.2.1": [ { "comment_text": "", "digests": { "md5": "777f0613853a4c75791cb887c2e24b82", "sha256": "de9a4a45a5da1cc55882289e85f186f582c024f82724053b813b0bd54c899d23" }, "downloads": -1, "filename": "oll-0.2.1.tar.gz", "has_sig": false, "md5_digest": "777f0613853a4c75791cb887c2e24b82", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 70068, "upload_time": "2017-06-29T17:03:07", "url": "https://files.pythonhosted.org/packages/ac/c8/91ed18f42663960273ed4480e6b8cc51f234169a6a08ee3abb1fbb716759/oll-0.2.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "777f0613853a4c75791cb887c2e24b82", "sha256": "de9a4a45a5da1cc55882289e85f186f582c024f82724053b813b0bd54c899d23" }, "downloads": -1, "filename": "oll-0.2.1.tar.gz", "has_sig": false, "md5_digest": "777f0613853a4c75791cb887c2e24b82", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 70068, "upload_time": "2017-06-29T17:03:07", "url": "https://files.pythonhosted.org/packages/ac/c8/91ed18f42663960273ed4480e6b8cc51f234169a6a08ee3abb1fbb716759/oll-0.2.1.tar.gz" } ] }