Skip to main content

Klops: Koin Machine Learning Ops

Project description

Klops: Koin MLOps

Build your end-to-end machine learning projects within one tool.

Getting StartedDocumentationSupportContribution

Klops is an End-to-End machine learning development pipeline ops. Its build on top of Seldon Core, MLflow and DVC. The goal of this project is to make easier for Data Scientist to develop, maintain, log their experiments and deploy their machine learning projects.

Prerequisites

  • Seldon Core Installed on your Kubernetes cluster. Guidance here
  • MLflow Tracking Server deployed. Recommended to use the schenario 5 here
  • Local or remote storage such as Amazon S3 or Google Cloud Storage (GCS) or similar.

Installation

From PyPI

Using pip is the best option if you want to get the stable version and easier way to install.

$ pip install klops

Build From Source

This is the best way to get the lastest published library, including the experimental version.

Clone this repo

$ git clone https://gitlab-engineering.koinworks.com/data-team/klops.git

Change your directory to your klops folder:

$ cd klops

Install

$ python setup.py install

Basic Usages

Klops consists of three modules. Versioning, Experiment and Deployment.

Klops Experiment

Klops Experiment is a class that wraps the MLflow Tracking. Below are the simple example to begin with.

from klops.experiment import Experiment
from sklearn.datasets import load_iris
from sklearn.naive_bayes import GaussianNB

experiment = Experiment(name="your-experiment-name", tracking_uri="http://<your-mlflow-host>:<port>")

X, y = load_iris(return_X_y=True)
HYPERPARAMETERS = {
    "n_estimators": 20,
    "max_depth": 10,
    "min_samples_split": 5
}

experiment.start(GaussianNB, x_train_data=X, y_train_data=y, tuner_args=HYPERPARAMETERS)

You would see your experiment result in your Mlflow Tracking UI like below:
Tracking result For the complete tutorials could be seen through this documentation.

Klops Versioning

Klops Versioning is a kind of version control based on DVC. This module wrapped the commandline and python APIs from DVC.

from klops.versioning import Versioning

versioning = Versioning()

# Track your file into dvc
versioning.add("myfile.csv")

# Add your DVC repository storage
versioning.add_remote("gs://your-bucket-name/your-path/")

# Push your changes to DVC
versioning.push()

Complete examples could be seen on this tutorial page.

Klops Deployment

Klops Deployment is a module to deploy the development machine learning projects into Seldon Core instance. Below is the example on how to done with.

from klops.seldon_core import SeldonDeployment
from klops.seldon_core.auth import GKEAuthentication

gke = GKEAuthentication(
    project_id="your-project-id",
    zone="your-project-region",
    cluster_id="your-cluster-id")
deployment = SeldonDeployment(gke, "seldon")

## Config file could be json or yaml/yml file.
config = deployment.load_deployment_configuration("<deployment-config>.json")
deployment.deploy(config)

Now you can access your API through this doc http://<ingress_url>/seldon/<namespace>/<model-name>/api/v1.0/doc/. Example result:
Deployment Example

Development

We are open for anyone who wants to contribute! Please read the CONTRIBUTING.md guide.

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

klops-0.0.4.tar.gz (41.9 kB view details)

Uploaded Source

Built Distribution

klops-0.0.4-py3-none-any.whl (59.0 kB view details)

Uploaded Python 3

File details

Details for the file klops-0.0.4.tar.gz.

File metadata

  • Download URL: klops-0.0.4.tar.gz
  • Upload date:
  • Size: 41.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.15

File hashes

Hashes for klops-0.0.4.tar.gz
Algorithm Hash digest
SHA256 7b2c11f7262f8a66019445b791679d631154ba439740f49c71a59ac3f56bde65
MD5 72ae4624418ce90ec55f8561d646ae81
BLAKE2b-256 e5fa9da7ad80c4924a0306f49edab01b212912a31caf6cacdc0453e49aba61c5

See more details on using hashes here.

File details

Details for the file klops-0.0.4-py3-none-any.whl.

File metadata

  • Download URL: klops-0.0.4-py3-none-any.whl
  • Upload date:
  • Size: 59.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.15

File hashes

Hashes for klops-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 f29e0cf2686e784a3a305e903c6817b2270efed0d16b572eee81e42b267ff705
MD5 e800ba99e4a56a0a390bf55e9c040a1b
BLAKE2b-256 78ff0648c823fb3b81edb827298cad75025f4a7c721abe2d3b70d59c0d75b45a

See more details on using hashes here.

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