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
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file evq-0.0.2.tar.gz
.
File metadata
- Download URL: evq-0.0.2.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
Algorithm | Hash digest | |
---|---|---|
SHA256 | 02cd3082fbb586874d4d96eb9bc5154d93f1b05aaec3005bad7a7f2c5e411b85 |
|
MD5 | c4bdcd372d1fb6e2a8fa7c2783433e28 |
|
BLAKE2b-256 | 6223f36cefc425ad36e2d39107f929dfea9e44d55e055f931a360d32a3c5b107 |
File details
Details for the file evq-0.0.2-py2.py3-none-any.whl
.
File metadata
- Download URL: evq-0.0.2-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
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7a3f9ab98e765888a31b823597b83e85ca8ac228b73a8df12388b213387c23b7 |
|
MD5 | 0e469f0812c0064d62e900008a9481d6 |
|
BLAKE2b-256 | b247f1092ee3537d64798c536a21a89a2186752fd155f96025ea4bf9b6cf4bbb |