machine learning pipelines
Project description
chariots
chariots aims to be a complete framework to build and deploy versioned machine learning pipelines.
Documentation: https://chariots.readthedocs.io.
Getting Started: 30 seconds to Chariots:
You can check the chariots docutemtation for a complete tutorial on getting started with chariots, but here are the essentials:
you can create operations to execute steps in your pipeline:
>>> from chariots.sklearn import SKUnsupervisedOp, SKSupervisedOp >>> from chariots.versioning import VersionType, VersionedFieldDict, VersionedField >>> from sklearn.decomposition import PCA >>> from sklearn.linear_model import LogisticRegression ... ... >>> class PCAOp(SKUnsupervisedOp): ... training_update_version = VersionType.MAJOR ... model_parameters = VersionedFieldDict(VersionType.MAJOR, {"n_components": 2}) ... model_class = VersionedField(PCA, VersionType.MAJOR) ... >>> class LogisticOp(SKSupervisedOp): ... training_update_version = VersionType.PATCH ... model_class = LogisticRegression
Once your ops are created, you can create your various training and prediction pipelines:
>>> from chariots import Pipeline, MLMode >>> from chariots.nodes import Node ... ... >>> train = Pipeline([ ... Node(IrisFullDataSet(), output_nodes=["x", "y"]), ... Node(PCAOp(MLMode.FIT_PREDICT), input_nodes=["x"], output_nodes="x_transformed"), ... Node(LogisticOp(MLMode.FIT), input_nodes=["x_transformed", "y"]) ... ], 'train') ... >>> pred = Pipeline([ ... Node(PCAOp(MLMode.PREDICT), input_nodes=["__pipeline_input__"], output_nodes="x_transformed"), ... Node(LogisticOp(MLMode.PREDICT), input_nodes=["x_transformed"], output_nodes=['__pipeline_output__']) ... ], 'pred')
Once all your pipelines have been created, deploying them is as easy as creating a creating a Chariots object:
>>> from chariots import Chariots ... ... >>> app = Chariots([train, pred], app_path, import_name='iris_app')
The Chariots class inherits from the Flask class so you can deploy this the same way you would any flask application
Once this the server is started, you can use the chariots client to query your machine learning micro-service from python:
>>> from chariots import Client ... ... >>> client = Client()
with this client we will be
training the models
saving them and reloading the prediction pipeline (so that it uses the latest/trained version of our models)
query some prediction
>>> client.call_pipeline(train) >>> client.save_pipeline(train) >>> client.load_pipeline(pred) >>> client.call_pipeline(pred, [[1, 2, 3, 4]]) [1]
Features
versionable individual op
easy pipeline building
easy pipelines deployment
ML utils (implementation of ops for most popular ML libraries with adequate Versionedfield) for sklearn and keras at first
A CookieCutter template to properly structure your Chariots project
Comming Soon
Some key features of Chariot are still in development and should be coming soon:
Cloud integration (integration with cloud services to fetch and load models from)
Graphql API to store and load information on different ops and pipelines (performance monitoring, …)
ABTesting
Credits
This package was created with Cookiecutter and the audreyr/cookiecutter-pypackage project template. audreyr/cookiecutter-pypackage’s project is also the basis of the Chariiots project template
History
0.1.0 (2019-06-15)
First release on PyPI.
0.2.0 (2019-06-15)
sci-kit learn and keras integration
multiple outputs per nodes
project template
tutorials
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 chariots-0.2.4.tar.gz
.
File metadata
- Download URL: chariots-0.2.4.tar.gz
- Upload date:
- Size: 33.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.35.0 CPython/3.5.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 29cdf5708785b1235d7be305e339d745b437b9da90bb765b722a8fc3b4a1ae6f |
|
MD5 | c5bd80c55899b1d0012f7a62e62d1487 |
|
BLAKE2b-256 | 57612d3d84ed41eb2f04e21c68545b4cee949ccf434681580c77161f72dd4032 |
File details
Details for the file chariots-0.2.4-py2.py3-none-any.whl
.
File metadata
- Download URL: chariots-0.2.4-py2.py3-none-any.whl
- Upload date:
- Size: 13.9 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.35.0 CPython/3.5.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 02b9cf135a30e73d59e7dce948e6d4fd12ddcda305b557461cb67a135830ed60 |
|
MD5 | bb711ed4e401a6d7de55448a30b431f9 |
|
BLAKE2b-256 | a85adf0e6c043e6ebf4c1b7796a455f44e851a72fe6b5d2b00db70dde2e067e4 |