Skip to main content

Python-Wrapper for Francesco Parrella's OnlineSVR C++ implementation.

Project description

PyOnlineSVR

pipeline status coverage report Code style: black PyPI package License: GPL v3 python version 3.7|3.8|3.9

Python-Wrapper for Francesco Parrella's OnlineSVR [PAR2007] C++ implementation with scikit-learn-compatible interfaces. You can find more information about the OnlineSVR here and the original source code here.

Installation

Dependencies

PyOnlineSVR requires the following dependencies:

  • python (>=3.7)
  • numpy (>=1.13.3)
  • scipy (>=0.19.1)
  • joblib (>=0.11)
  • scikit-learn (>=0.23.0)

Binaries

PyOnlineSVR is published to PyPi and can be installed using pip.

Prerequisites

Steps

You can use pip to install PyOnlineSVR using:

pip install PyOnlineSVR

From Source (Linux)

If you are installing PyOnlineSVR from source, you will need Python 3.7 or later and a modern C++ compiler. We highly recommend using an Anaconda environment for building this project.

In the following, we explain the steps to build PyOnlineSVR using Anaconda and git.

Prepare environment

Create a new Anaconda environment and install the required dependencies. This includes python, SWIG to generate the C++ wrapper, and the C and C++ compiler toolchains.

conda create -n pyonlinesvr python swig gcc_linux-64 gxx_linux-64
conda activate pyonlinesvr

Install dependencies

conda install -n pyonlinesvr numpy scipy scikit-learn

Get the source code

git clone https://github.com/CodeLionX/pyonlinesvr.git
cd pyonlinesvr

Install PyOnlineSVR

python setup.py install

Note that if your are using Anaconda, you may experience an error caused by the linker:

build/temp.linux-x86_64-3.7/torch/csrc/stub.o: file not recognized: file format not recognized
collect2: error: ld returned 1 exit status
error: command 'g++' failed with exit status 1

This is caused by the linker ld from the Conda environment shadowing the system ld. You should use a newer version of Python in your environment that fixes this issue. The recommended Python versions are (3.6.10+,) 3.7.6+ and 3.8.1+. For further details see the issue.

Usage

>>> import numpy as np
>>> from pyonlinesvr import OnlineSVR
>>> X = np.array([[0, 0], [2, 2]])
>>> y = np.array([0.5, 2.5])
>>> regr = OnlineSVR()
>>> regr.fit(X[:1], y[:1])
OnlineSVR()
>>> regr.predict([[1, 1]])
array([ 0.4])
>>> regr.partial_fit(X[1:], y[1:])
OnlineSVR()
>>> regr.predict([[1, 1]])
array([ 1.5])

License

PyOnlineSVR is free software under the terms of the GNU General Public License, as found in the LICENSE file.

References

[PAR2007]: Parrelly, Francesco (2007). "Online Support Vector Machines for Regression." Master thesis. University of Genoa, Italy. PDF

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

PyOnlineSVR-0.0.4.tar.gz (47.2 kB view details)

Uploaded Source

Built Distributions

PyOnlineSVR-0.0.4-cp310-cp310-win_amd64.whl (169.1 kB view details)

Uploaded CPython 3.10 Windows x86-64

PyOnlineSVR-0.0.4-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.1 MB view details)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

PyOnlineSVR-0.0.4-cp310-cp310-macosx_10_9_x86_64.whl (173.3 kB view details)

Uploaded CPython 3.10 macOS 10.9+ x86-64

PyOnlineSVR-0.0.4-cp39-cp39-win_amd64.whl (169.1 kB view details)

Uploaded CPython 3.9 Windows x86-64

PyOnlineSVR-0.0.4-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.1 MB view details)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64

PyOnlineSVR-0.0.4-cp39-cp39-macosx_10_9_x86_64.whl (173.3 kB view details)

Uploaded CPython 3.9 macOS 10.9+ x86-64

PyOnlineSVR-0.0.4-cp38-cp38-win_amd64.whl (168.9 kB view details)

Uploaded CPython 3.8 Windows x86-64

PyOnlineSVR-0.0.4-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.0 MB view details)

Uploaded CPython 3.8 manylinux: glibc 2.17+ x86-64

PyOnlineSVR-0.0.4-cp38-cp38-macosx_10_9_x86_64.whl (173.7 kB view details)

Uploaded CPython 3.8 macOS 10.9+ x86-64

PyOnlineSVR-0.0.4-cp37-cp37m-win_amd64.whl (168.7 kB view details)

Uploaded CPython 3.7m Windows x86-64

PyOnlineSVR-0.0.4-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.0 MB view details)

Uploaded CPython 3.7m manylinux: glibc 2.17+ x86-64

PyOnlineSVR-0.0.4-cp37-cp37m-macosx_10_9_x86_64.whl (173.5 kB view details)

Uploaded CPython 3.7m macOS 10.9+ x86-64

File details

Details for the file PyOnlineSVR-0.0.4.tar.gz.

File metadata

  • Download URL: PyOnlineSVR-0.0.4.tar.gz
  • Upload date:
  • Size: 47.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.17

File hashes

Hashes for PyOnlineSVR-0.0.4.tar.gz
Algorithm Hash digest
SHA256 7072b2074397008ae24ba785ba4587d7f9524213d59dffca6092bf693934a064
MD5 917adae1b2e141a5e0bbf639c924c61c
BLAKE2b-256 31f2bb713dd09f6a7a79f98a6c5d0b981d682366550da58fc3ca249379a96e6e

See more details on using hashes here.

File details

Details for the file PyOnlineSVR-0.0.4-cp310-cp310-win_amd64.whl.

File metadata

File hashes

Hashes for PyOnlineSVR-0.0.4-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 b2929e3eeecfc23749c7f0c59c0b2829ac91decb1a7f75eed61fde1dba19b090
MD5 b20ef085704234beb27a334fc0b2d931
BLAKE2b-256 38d03c5800d75a3e9dda42c96f807c19541bc76e9e2c83a743469ad575a25371

See more details on using hashes here.

File details

Details for the file PyOnlineSVR-0.0.4-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for PyOnlineSVR-0.0.4-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 b9bd2088cb22013d4c5d76c0a0e7a66daff539dfc7e4ea02b53a469f903288dd
MD5 2c7215d6fe202ad0467caf5fd54e8422
BLAKE2b-256 3e50afcc05dfff60ac2bd9f77c847ea1ac0872f2517b525441746b4adf7c68cb

See more details on using hashes here.

File details

Details for the file PyOnlineSVR-0.0.4-cp310-cp310-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for PyOnlineSVR-0.0.4-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 d714ffe876128584ece4195a81235b122f7193734175540568081a3ae3c2c220
MD5 e8e6613f44840ccfe56787b464114159
BLAKE2b-256 a9948ffa8baa3bbc2c33155175b6d966b57b0e12919b137bd0d778edad80fac0

See more details on using hashes here.

File details

Details for the file PyOnlineSVR-0.0.4-cp39-cp39-win_amd64.whl.

File metadata

File hashes

Hashes for PyOnlineSVR-0.0.4-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 ac6c085b26504cc8f62f2f1ae951f28814817be0f7cdfd0dc5baf278352647f8
MD5 90e4b131fb591b7b7b3fbed0f6753352
BLAKE2b-256 30d80af0841f5636a3daca56226fd67aede938be725c03647c16246deb9b0322

See more details on using hashes here.

File details

Details for the file PyOnlineSVR-0.0.4-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for PyOnlineSVR-0.0.4-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 52e363d617bf7281f356429be97e43e580425014a3b98bff17ba5792be28c911
MD5 bd744b5ce4edd165393e126686f59a0d
BLAKE2b-256 8accd3760b7680c829f91878b2d8169c153194b47fbeb3681cc95aee68ddf530

See more details on using hashes here.

File details

Details for the file PyOnlineSVR-0.0.4-cp39-cp39-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for PyOnlineSVR-0.0.4-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 e2363a243908f3db5f489a1637b3c2f0c9a844d6d3ba3eac77b49c2b72afaf4b
MD5 38f77a6e254ec281973781ee16f1d0a9
BLAKE2b-256 cb4bd3fbf37a3dfb1e1e8c449d1672526a34630127df0e4eab5e4ba2b279f77e

See more details on using hashes here.

File details

Details for the file PyOnlineSVR-0.0.4-cp38-cp38-win_amd64.whl.

File metadata

File hashes

Hashes for PyOnlineSVR-0.0.4-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 78e0b8c1dddd8d8af296ef268027838cfb5f09c51396c3067974e45ef8b66202
MD5 57cebfba5542f87b0bac64bf69419a10
BLAKE2b-256 c71448c641de0fd58ad61260edd6df4d496e39d4072a69bdc686fcbbb91e413d

See more details on using hashes here.

File details

Details for the file PyOnlineSVR-0.0.4-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for PyOnlineSVR-0.0.4-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 c4433b38d7af8a49faba4a965c24af3e7ff68245a2bf811856873646c9325b13
MD5 5a9f69dda9f3b333200b59ff01d34dfd
BLAKE2b-256 8f24d321d99dba751f03648181513851976e3a6b66584f68842a2d323fceb2b0

See more details on using hashes here.

File details

Details for the file PyOnlineSVR-0.0.4-cp38-cp38-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for PyOnlineSVR-0.0.4-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 1c7a4bdee118f62465348a18151001454567f93bf16958214870179680bb0c47
MD5 120ed97d660ff712d3f9d22e4128dec8
BLAKE2b-256 b307a45ed2f3a43fc4e9eab4669e4dc5d76b613b345a6fe866934af7e4bffcc7

See more details on using hashes here.

File details

Details for the file PyOnlineSVR-0.0.4-cp37-cp37m-win_amd64.whl.

File metadata

File hashes

Hashes for PyOnlineSVR-0.0.4-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 35a0f2407cc0caef5c82dcec114800e0ab960a944caad69418fd4e30724b626a
MD5 c0e2ab6a81c9b5c33bb016f9fbfa5727
BLAKE2b-256 44fe79be43090533da679d05ef2a360ff3078cdd94d0bcec529cd4beed82c475

See more details on using hashes here.

File details

Details for the file PyOnlineSVR-0.0.4-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for PyOnlineSVR-0.0.4-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 516255905dee8fadd08b89974beddf46ac24b8cbe51b5da0beaa87226543db46
MD5 e9a139f44a08875b8fc3f34c4a0f2143
BLAKE2b-256 304c5de12ffe17cf5e5fa882cdcaf6980391f00c61684d590167a4d6f26ad36b

See more details on using hashes here.

File details

Details for the file PyOnlineSVR-0.0.4-cp37-cp37m-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for PyOnlineSVR-0.0.4-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 52531752ee4292ec0fad74e8aadb9c836ceb924ff2430a37596e85340c7bbb2c
MD5 6b61a76deade71a0063b2aacf8dc3cb1
BLAKE2b-256 590fbdc28e6450ffd532054484aaca69a7d02b62b111234c31f81c6949319af6

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page