Made With ML
Learn how to develop, deploy and iterate on production-grade ML applications.
Install / Use
npx skills add GokuMohandas/Made-With-MLInstalls into whichever agent you are using.
README
Lessons
Learn how to combine machine learning with software engineering to design, develop, deploy and iterate on production-grade ML applications.
- Lessons: https://madewithml.com/
- Code: GokuMohandas/Made-With-ML
Overview
In this course, we'll go from experimentation (design + development) to production (deployment + iteration). We'll do this iteratively by motivating the components that will enable us to build a reliable production system.
<blockquote> <img width=20 src="https://upload.wikimedia.org/wikipedia/commons/thumb/0/09/YouTube_full-color_icon_%282017%29.svg/640px-YouTube_full-color_icon_%282017%29.svg.png"> Be sure to watch the video below for a quick overview of what we'll be building. </blockquote> <div align="center"> <a href="https://youtu.be/AWgkt8H8yVo"><img src="https://img.youtube.com/vi/AWgkt8H8yVo/0.jpg" alt="Course overview video"></a> </div> <br>- 💡 First principles: before we jump straight into the code, we develop a first principles understanding for every machine learning concept.
- 💻 Best practices: implement software engineering best practices as we develop and deploy our machine learning models.
- 📈 Scale: easily scale ML workloads (data, train, tune, serve) in Python without having to learn completely new languages.
- ⚙️ MLOps: connect MLOps components (tracking, testing, serving, orchestration, etc.) as we build an end-to-end machine learning system.
- 🚀 Dev to Prod: learn how to quickly and reliably go from development to production without any changes to our code or infra management.
- 🐙 CI/CD: learn how to create mature CI/CD workflows to continuously train and deploy better models in a modular way that integrates with any stack.
Audience
Machine learning is not a separate industry, instead, it's a powerful way of thinking about data that's not reserved for any one type of person.
- 👩💻 All developers: whether software/infra engineer or data scientist, ML is increasingly becoming a key part of the products that you'll be developing.
- 👩🎓 College graduates: learn the practical skills required for industry and bridge gap between the university curriculum and what industry expects.
- 👩💼 Product/Leadership: who want to develop a technical foundation so that they can build amazing (and reliable) products powered by machine learning.
Set up
Be sure to go through the course for a much more detailed walkthrough of the content on this repository. We will have instructions for both local laptop and Anyscale clusters for the sections below, so be sure to toggle the ► dropdown based on what you're using (Anyscale instructions will be toggled on by default). If you do want to run this course with Anyscale, where we'll provide the structure, compute (GPUs) and community to learn everything in one day, join our next upcoming live cohort → sign up here!
Cluster
We'll start by setting up our cluster with the environment and compute configurations.
<details> <summary>Local</summary><br> Your personal laptop (single machine) will act as the cluster, where one CPU will be the head node and some of the remaining CPU will be the worker nodes. All of the code in this course will work in any personal laptop though it will be slower than executing the same workloads on a larger cluster. </details> <details open> <summary>Anyscale</summary><br>We can create an Anyscale Workspace using the webpage UI.
- Workspace name: `madewithml`
- Project: `madewithml`
- Cluster environment name: `madewithml-cluster-env`
# Toggle `Select from saved configurations`
- Compute config: `madewithml-cluster-compute-g5.4xlarge`
</details> <details> <summary>Other (cloud platforms, K8s, on-prem)</summary><br>Alternatively, we can use the CLI to create the workspace via
anyscale workspace create ...
If you don't want to do this course locally or via Anyscale, you have the following options:
- On AWS and GCP. Community-supported Azure and Aliyun integrations also exist.
- On Kubernetes, via the officially supported KubeRay project.
- Deploy Ray manually on-prem or onto platforms not listed here.
Git setup
Create a repository by following these instructions: Create a new repository → name it Made-With-ML → Toggle Add a README file (very important as this creates a main branch) → Click Create repository (scroll down)
Now we're ready to clone the repository that has all of our code:
git clone https://github.com/GokuMohandas/Made-With-ML.git .
Credentials
touch .env
# Inside .env
GITHUB_USERNAME="CHANGE_THIS_TO_YOUR_USERNAME" # ← CHANGE THIS
source .env
Virtual environment
<details> <summary>Local</summary><br>export PYTHONPATH=$PYTHONPATH:$PWD
python3 -m venv venv # recommend using Python 3.10
source venv/bin/activate # on Windows: venv\Scripts\activate
python3 -m pip install --upgrade pip setuptools wheel
python3 -m pip install -r requirements.txt
pre-commit install
pre-commit autoupdate
</details> <details open> <summary>Anyscale</summary><br>Highly recommend using Python
3.10and using pyenv (mac) or pyenv-win (windows).
Our environment with the appropriate Python version and libraries is already all set for us through the cluster environment we used when setting up our Anyscale Workspace. So we just need to run these commands:
export PYTHONPATH=$PYTHONPATH:$PWD
pre-commit install
pre-commit autoupdate
</details>
Notebook
Start by exploring the jupyter notebook to interactively walkthrough the core machine learning workloads.
<div align="center"> <img src="https://madewithml.com/static/images/mlops/systems-design/workloads.png"> </div> <details> <summary>Local</summary><br># Start notebook
jupyter lab notebooks/madewithml.ipynb
</details>
<details open>
<summary>Anyscale</summary><br>
Click on the Jupyter icon <img width=15 src="https://upload.wikimedia.org/wikipedia/commons/thumb/3/38/Jupyter_logo.svg/1200px-Jupyter_logo.svg.png"> at the top right corner of our Anyscale Workspace page and this will open up our JupyterLab instance in a new tab. Then navigate to the notebooks directory and open up the madewithml.ipynb notebook.
Scripts
Now we'll execute the same workloads using the clean Python scripts following software engineering best practices (testing, documentation, logging, serving, versioning, etc.) The code we've implemented in our notebook will be refactored into the following scripts:
madewithml
├── config.py
├── data.py
├── evaluate.py
├── models.py
├── predict.py
├── serve.py
├── train.py
├── tune.py
└── utils.py
Note: Change the --num-workers, --cpu-per-worker, and --gpu-per-worker input argument values below based on your system's resources. For example, if you're on a local laptop, a reasonable configuration would be --num-workers 6 --cpu-per-worker 1 --gpu-per-worker 0.
Training
export EXPERIMENT_NAME="llm"
export DATASET_LOC="https://raw.githubusercontent.com/GokuMohandas/Made-With-ML/main/datasets/dataset.csv"
export TRAIN_LOOP_CONFIG='{"dropout_p": 0.5, "lr": 1e-4, "lr_factor": 0.8, "lr_patience": 3}'
python madewithml/train.py \
--experiment-name "$EXPERIMENT_NAME" \
--dataset-loc "$DATASET_LOC" \
--train-loop-config "$TRAIN_LOOP_CONFIG" \
--num-workers 1 \
--cpu-per-worker 3 \
--gpu-per-worker 1 \
--num-epochs 10 \
--batch-size 256 \
--results-fp results/training_results.json
Tuning
export EXPERIMENT_NAME="llm"
export DATASET_LOC="https://raw.githubusercontent.com/GokuMohandas/Made-With-ML/main/datasets/dataset.csv"
export TRAIN_LOOP_CONFIG='{"dropout_p": 0.5, "lr": 1e-4, "lr_factor": 0.8, "lr_patience": 3}'
export INITI
Related Skills
python-debugpy
385.5kDebug Python with pdb, breakpoint(), post-mortem inspection, and debugpy remote attach.
skill-creator
385.5kCreate, edit, audit, tidy, validate, or restructure AgentSkills and SKILL.md files.
claude-opus-4-5-migration
140.6kMigrate prompts and code from Claude Sonnet 4.0, Sonnet 4.5, or Opus 4.1 to Opus 4.5
automl-hyperparameter-optimization
40.5kAutoML and hyperparameter optimization rules for Python ML projects using Ray Tune, Optuna, PyCaret, and time-series AutoML libraries
