Skip to main content

EVQ: Evolving Vector Quantization for Classification

Project description

EVQ

Evolving Vector Quantization for Classification of On-Line Data Streams

Note

Inspired by this algorithm and several others, I created a new one called SEVQ: https://github.com/sylwekczmil/sevq

Installation

Inspiration

Implementation done by Sylwester Czmil based on pseudocode and algorithm description from:

E. Lughofer, “Evolving Vector Quantization for Classification of On-Line Data Streams,” 2008 International Conference on Computational Intelligence for Modelling Control & Automation, 2008, pp.779-784, doi: 10.1109/CIMCA.2008.47.

Installation

# create venv and activate
# install algorithm
pip3 evq

Example usage

Training and prediction one sample at a time

from evq.algorithm import EVQ

c = EVQ(number_of_classes=2, vigilance=0.1)
c.partial_fit([-2, -2], 1)
c.partial_fit([-1, -1], 0)
c.partial_fit([1, 1], 0)
c.partial_fit([2, 2], 1)

print(c.predict([0, 0]))  # 0
print(c.predict([3, 3]))  # 1
print(c.predict([-3, -3]))  # 1

Training and prediction on multiple samples

from evq.algorithm import EVQ

c = EVQ(number_of_classes=2, vigilance=0.1)
c.fit(
    [[-2, -2], [-1, -1], [1, 1], [2, 2]],
    [1, 0, 0, 1],
    epochs=1, permute=False
)

print(c.predict([[0, 0], [3, 3], [-3, -3]]))  # [0, 1, 1]

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

evq-0.0.1.tar.gz (3.4 kB view details)

Uploaded Source

Built Distribution

evq-0.0.1-py2.py3-none-any.whl (4.0 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file evq-0.0.1.tar.gz.

File metadata

  • Download URL: evq-0.0.1.tar.gz
  • Upload date:
  • Size: 3.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.14.0 pkginfo/1.8.2 requests/2.27.1 setuptools/44.0.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.10

File hashes

Hashes for evq-0.0.1.tar.gz
Algorithm Hash digest
SHA256 ff069755b679743d9d33ece0e90edc6462ab7d977056e9428e06494a263815fa
MD5 f2a339ff4bc80cd364f2592f37a65bb8
BLAKE2b-256 7a067b37c65532d860b1ad6e60d167aedb339613b49d6de8a320b945c71ffd45

See more details on using hashes here.

File details

Details for the file evq-0.0.1-py2.py3-none-any.whl.

File metadata

  • Download URL: evq-0.0.1-py2.py3-none-any.whl
  • Upload date:
  • Size: 4.0 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.14.0 pkginfo/1.8.2 requests/2.27.1 setuptools/44.0.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.10

File hashes

Hashes for evq-0.0.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 4a8bbfb83b010d47d2db6723cb6fc30bf0ac85f8e6bea7afc2a629e8764efb8b
MD5 58c008cca2f7214688a9eb5b692abe90
BLAKE2b-256 3ae67e8867b3d2f30714dc90af2507e6ab7e0405ff1f5c5e6f24fb0519c9062c

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