Skip to main content

Python package equipped with a procedures to process data streams using estimators with API compatible with scikit-learn.

Project description

stream-learn

Travis Status Coverage Status CircleCI Status

stream-learn is a Python package equipped with a procedures to process data streams using estimators with API compatible with scikit-learn.

Documentation

API documentation with set of examples may be found on the documentation page.

Installation

stream-learn is available on the PyPi and you may install it with pip:

pip install stream-learn

Example usage

import strlearn as sl
from sklearn.neural_network import MLPClassifier
from sklearn.naive_bayes import GaussianNB

# Initialize list of scikit-learn classifiers with partial_fit() function
clf = [MLPClassifier(), GaussianNB()]

# Declare data stream
stream = sl.streams.StreamGenerator(n_chunks=10, n_drifts=1)

# Select vector of metrics
metrics = [sl.utils.metrics.bac, sl.utils.metrics.f_score]

# Initialize evaluator with given metrics
evaluator = sl.evaluators.TestThenTrain(metrics)

# Run evaluator over stream with classifier
evaluator.process(stream, clf)
>>> print(evaluator.scores)
[[[0.29730274 0.29145729]
  [0.34494021 0.36097561]
  [0.43464118 0.44878049]
  [0.42579578 0.36666667]
  [0.45569557 0.4171123 ]
  [0.47020869 0.44791667]
  [0.4645207  0.46534653]
  [0.525      0.5177665 ]
  [0.4893617  0.46875   ]]

 [[0.87701288 0.88038278]
  [0.90091448 0.9047619 ]
  [0.89930938 0.9047619 ]
  [0.85376189 0.82681564]
  [0.61521152 0.60913706]
  [0.64714185 0.61538462]
  [0.64556129 0.62564103]
  [0.74       0.74      ]
  [0.80820955 0.80597015]]]

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

stream-learn-0.8.4.tar.gz (15.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

stream_learn-0.8.4-py3-none-any.whl (39.4 kB view details)

Uploaded Python 3

File details

Details for the file stream-learn-0.8.4.tar.gz.

File metadata

  • Download URL: stream-learn-0.8.4.tar.gz
  • Upload date:
  • Size: 15.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.39.0 CPython/3.7.5

File hashes

Hashes for stream-learn-0.8.4.tar.gz
Algorithm Hash digest
SHA256 289cb12be3a762167aa1fcfe677961705fb358cf484367db1a2194d96d16a127
MD5 85f070ad8df0c2d31c0ace799c42f711
BLAKE2b-256 abb8866979f6fbdb99d93f26ba65e0e4139bea8a2c83f1e61b40a8d6dee6a8f1

See more details on using hashes here.

File details

Details for the file stream_learn-0.8.4-py3-none-any.whl.

File metadata

  • Download URL: stream_learn-0.8.4-py3-none-any.whl
  • Upload date:
  • Size: 39.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.39.0 CPython/3.7.5

File hashes

Hashes for stream_learn-0.8.4-py3-none-any.whl
Algorithm Hash digest
SHA256 b6a712708397b67087a4bdb78b0c67cad93df56d3c18ac2b6d793df18910b950
MD5 fd682635896699b52f1ed8e9e1d6531d
BLAKE2b-256 979d0f8c0772c4e80599b9db87d61d3113cab6d7f14ab0dd8bed14de32ae8891

See more details on using hashes here.

Supported by

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