Skip to main content

ML2P – or (ML)^2P – is the minimal lovable machine-learning pipeline and a friendlier interface to AWS SageMaker.

Design goals:

  • support the full machine learning lifecyle

  • support custom feature engineering

  • support building custom models in Python

  • provide reproducible training and deployment of models

  • support the use of customised base Docker images for training and deployment

Concretely it provides a command line interface and a Python library to assist with:

  • S3:
    • Managing training data

  • SageMaker:
    • Launching training jobs

    • Deploying trained models

    • Creating notebook instances

  • On your local machine or in a SageMaker notebook:
    • Downloading training datasets from S3

    • Training models

    • Loading trained models from SageMaker / S3

Installing

Install ML2P with:

$ pip install ml2p

Mailing list

If you have questions about ML2P, or would like to contribute or have suggestions for improvements, you are welcome to join the project mailing list at https://groups.google.com/g/ml2p and write us a letter there.

Overview

ML2P helps manage a machine learning project. You’ll define your project by writing a small YAML file named ml2p.yml:

project: "ml2p-tutorial"
s3folder: "s3://your-s3-bucket/"
models:
  bob: "models.RegressorModel"
defaults:
  image: "XXXXX.dkr.ecr.REGION.amazonaws.com/your-docker-image:X.Y.Z"
  role: "arn:aws:iam::XXXXX:role/your-role"
train:
  instance_type: "ml.m5.large"
deploy:
  instance_type: "ml.t2.medium"
  record_invokes: true

This specifies:

  • project: the name of your project

  • s3folder: the S3 bucket that will hold the models and data sets for your project

  • models: a list of model names and the Python classes that will be used to train the models and make predictions

  • defaults:

    • image: the docker image that your project will use for training and prediction

    • role: the AWS role your project will run under

  • train:

    • instance_type: the AWS instance type that will be used when training your model

  • deploy:

    • instance_type: the AWS instance type that will be used when deploying your model

    • record_invokes: whether to record prediction requests in S3

The name of your project functions as a prefix to the names of SageMaker training jobs, models and endpoints that ML2P creates (since these names are global within a SageMaker account).

ML2P also tags all of the AWS objects it creates with your project name.

Tutorial

See https://ml2p.readthedocs.io/en/latest/tutorial/ for a step-by-step tutorial.

Metadata

Release files for ml2p 0.6.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ml2p 0.6.0
File Size Uploaded
ml2p-0.6.0.tar.gz 40.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for ml2p 0.6.0
File Interpreter ABI Platform
ml2p-0.6.0-py2.py3-none-any.whl Python 2, Python 3 none any Details

Total release size: 88.3 kB

Release files / ml2p-0.6.0.tar.gz

Download URL ml2p-0.6.0.tar.gz
Size 40.4 kB
Tags Source
SHA-256 checksum
How to use checksums
9ae4c0d1b3d0ad09d370757f4b1227d33a01e1d55cf0605e5bcd1f4c1a83c581
BLAKE2b-256 checksum
How to use checksums
c47b040e7daaec15a7ce90d7a67e02c8dfc798eb65eb2a7ff0e8ed66f705d646
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.3

Release files / ml2p-0.6.0-py2.py3-none-any.whl

Download URL ml2p-0.6.0-py2.py3-none-any.whl
Size 47.9 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
e525b8e256895927c9c4d25e7444729813cef969788ad415f862f51676e48956
BLAKE2b-256 checksum
How to use checksums
11255736fb9fc1d9dc8bdef216b50ad28bf8f30813a6f777a427d6fec3d82014
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.3

Release history Release notifications | RSS feed

This release

0.6.0 This release

2 release files

0.5.0

2 release files

0.4.0

2 release files

0.3.5

2 release files

0.3.4

2 release files

0.3.3

2 release files

0.3.2

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.4

2 release files

0.2.3

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.5

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page