Skip to main content

Deploy, monitor and explain your machine learning models

Project description

BlueTarget

Deploy, monitor and explain machine learning models.

Logo

BlueTarget is a MLops platform which allows ML engineer and Data Science deploy, monitor and explain their machine learning models. We're able to deploy your model using different kind of strategies like A/B testing, Canary or Rolling update.

Get started with the BlueTarget.

What can I do with BlueTarget?

If you've ever tried to get a model out of a Jupyter notebook, BlueTargert is for you.

BlueTarget allow your to deploy your ML model taking away the whole complexity of the cloud. However If you prefer to have the control of the infrastructure, BlueTarget can work with your preferred cloud:

Here are some of the things BlueTarget does:

  • Turns your Python model into a microservice with a production-ready API endpoint, no need for Flask or Django.
  • Track your model's version and metadata
  • Understad the drift of your model
  • Track your inference
  • Deployment strategies like A/B testing, canary and rolling update

Installation

BlueTarget requires Python >=3.7

To install from PyPi, run:

pip install bluetarget

BlueTarget is actively developed, and we recommend using the latest version. To update your BlueTarget installation, run:

pip install --upgrade bluetarget

How to use BlueTarget

Quickstart: making a BlueTarget

train.py

!pip install --upgrade scikit-learn bluetarget pickle-mixin

from sklearn import svm
from sklearn import datasets

import pickle

# Load training data set
iris = datasets.load_iris()
X, y = iris.data, iris.target

# Train the model
clf = svm.SVC(gamma='scale')
clf.fit(X, y)

pickle.dump(clf, open('model.pkl', 'wb'))

service.py

import os
from typing import Dict, List

class Model:
    def __init__(self) -> None:
        self._model = None

    def load(self):
        import pickle

        with open(f"{os.path.dirname(__file__)}/model.pkl", 'rb') as pickle_file:
            self._model = pickle.load(pickle_file)

    def predict(self, request: Dict) -> Dict[str, List]:
        response = {}
        inputs = request["inputs"]
        result = self._model.predict(inputs).tolist()
        response["predictions"] = result

        return response

requirements.txt

scikit-learn==1.0.2
pickle-mixin==1.0.2

deploy.py

from bluetarget import BlueTarget

bt = BlueTarget(api_key="YOUR_API_KEY")

bt.deploy(
    model_name="YourFirstModel",
    model_class="Model",
    model_files=["model.py", "model.pkl"],
    requirements_file="requirements.txt"
)

inputs = [
    [6.9, 3.1, 5.1, 2.3],
    [5.8, 2.7, 5.1, 1.9],
    [6.8, 3.2, 5.9, 2.3],
    [6.7, 3.3, 5.7, 2.5],
    [6.7, 3.,  5.2, 2.3],
    [6.3, 2.5, 5.,  1.9],
    [6.5, 3.,  5.2, 2.],
    [6.2, 3.4, 5.4, 2.3],
    [5.9, 3.,  5.1, 1.8]
]

bt.predict(inputs)

# {
#     "predictions": [
#         2,
#         1,
#         2,
#         3,
#         0,
#         2,
#         3,
#         2,
#         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

bluetarget-0.3.1.tar.gz (9.1 kB view details)

Uploaded Source

Built Distribution

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

bluetarget-0.3.1-py3-none-any.whl (10.5 kB view details)

Uploaded Python 3

File details

Details for the file bluetarget-0.3.1.tar.gz.

File metadata

  • Download URL: bluetarget-0.3.1.tar.gz
  • Upload date:
  • Size: 9.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.2.2 CPython/3.8.10 Linux/5.4.0-135-generic

File hashes

Hashes for bluetarget-0.3.1.tar.gz
Algorithm Hash digest
SHA256 7083cf9e952add27e9b65cf5db8d2aa7ba806da884f9e958d76c7bae6279fd39
MD5 1529756ce1b64f8e24b93609d0df7151
BLAKE2b-256 64503bc95227758f9be950fdb61af3c010677382ed6cb20ffaf92cd8e54b56eb

See more details on using hashes here.

File details

Details for the file bluetarget-0.3.1-py3-none-any.whl.

File metadata

  • Download URL: bluetarget-0.3.1-py3-none-any.whl
  • Upload date:
  • Size: 10.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.2.2 CPython/3.8.10 Linux/5.4.0-135-generic

File hashes

Hashes for bluetarget-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 f52ed47ae035d5cc9dbca6a943dca560f2d9c764e5d44de4418e45213ba01ee3
MD5 51fd00c52439697dd93089c1a54accb4
BLAKE2b-256 defc4ef9c93bf16014845fc022ceae193e074a5d82e016a759aa876b1d932543

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