Skip to main content

SEVQ: Simple Evolving Vector Quantization

Project description

https://img.shields.io/pypi/v/sevq.svg https://img.shields.io/travis/sylwekczmil/sevq.svg Documentation Status

SEVQ: Simple Evolving Vector Quantization

Installation

To install sevq, run this command in your terminal:

pip install sevq

Usage

Training and prediction one sample at a time

from sevq.algorithm import SEVQ

c = SEVQ()
c.partial_fit([-2, -2], 2)
c.partial_fit([-1, -1], 1)
c.partial_fit([1, 1], 1)
c.partial_fit([2, 2], 2)

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

Training and prediction on multiple samples

from sevq.algorithm import SEVQ

c = SEVQ()
c.fit(
    [[-2, -2], [-1, -1], [1, 1], [2, 2]],
    [2, 1, 1, 2],
    epochs=1, permute=False
)

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

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

sevq-1.0.2.tar.gz (22.7 kB view hashes)

Uploaded Source

Built Distribution

sevq-1.0.2-py2.py3-none-any.whl (4.0 kB view hashes)

Uploaded Python 2 Python 3

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