How to Set Up and Run the Term Deposit Prediction Project with MLflow and scikit-learn
You've downloaded the Term Deposit Prediction source code, and you want to see it working. This post takes you from the zip file to a finished hyperparameter search that MLflow has recorded as one parent run with a child run for each of the best candidates, one step at a time, with what each step should print.
You don't need to have read the tutorial series first. By the end, you'll have:
- an MLflow tracking server running on your own computer, with its UI at
http://127.0.0.1:8080; - the project installed and in Git, so every search records the version of the code that ran it;
- a search over 9 combinations of settings, each scored with 5-fold cross-validation, filed in MLflow as one parent run and 5 child runs;
- the best settings, and how well they predict customers the search never saw.
Everything on this page is real output, from a fresh copy of the archive on macOS, in zsh. The PowerShell lines were run in PowerShell 7.6.
Get the Source Code
The archive holds everything this post installs and runs. After you buy it, you'll find it in your library on the store, as one zip file.
What You Need
- uv. uv installs Python and every package the project needs. If your computer doesn't have Python 3.15, uv downloads it for you.
- Git. Every run records the Git commit of the code that produced it.
- A terminal. On macOS or Linux, that's zsh or bash. On Windows, it's PowerShell.
- An internet connection for the install, about 550 MB of packages, and for the first search, which downloads the data, about 1 MB.
Check the first two in your terminal:
uv --version
git --version
uv 0.13.10 (e3e7c1eac 2026-11-24 aarch64-apple-darwin)
git version 2.56.1
Your numbers can be higher than these.
What it costs: nothing. MLflow, scikit-learn, uv and Python are free and open source, and everything runs on your own computer. The dataset is free to use under its CC BY 4.0 licence.
Step 1: Unzip the Archive
Open a terminal in the folder where you saved the zip file.
- macOS / Linux
- Windows (PowerShell)
unzip term-deposit-prediction-mlflow-scikit-learn-1.0.0.zip
cd term-deposit-prediction-mlflow-scikit-learn
Expand-Archive -Path term-deposit-prediction-mlflow-scikit-learn-1.0.0.zip -DestinationPath .
Set-Location term-deposit-prediction-mlflow-scikit-learn
This is what you've got:
├── README.md These same steps, the search and every setting
├── pyproject.toml The project, its packages and its tune command
├── uv.lock The exact version of every package
├── .python-version Python 3.15
├── .env.example The settings, with their defaults
├── .gitignore
└── src/
└── term_deposit_prediction/
├── tune.py The tune command: the search and its test score
├── model.py The model the search tunes
├── data.py Downloads the data once, checks it and splits it
├── config.py The settings
├── code_version.py The Git commit each run records
└── __init__.py
Step 2: Start an MLflow Tracking Server
The project doesn't keep its runs itself. It sends them to an MLflow tracking server: a small web application that stores every run in a database and shows them in your browser. The server lives in a folder of its own, next to the project. If you already run one for another project of the series, keep it running and go to Step 3.
Go up to the folder that holds the project, and create the server's folder there:
cd ..
uv init --bare --python 3.15 mlflow-server
Initialized project `mlflow-server` at `/Users/you/source/mlflow-server`
--bare creates only a pyproject.toml file, because this folder only runs a server. --python 3.15 records that it needs Python 3.15 or newer. Now install MLflow in it:
cd mlflow-server
uv add mlflow
Using CPython 3.15.2 interpreter at: /Library/Frameworks/Python.framework/Versions/3.15/bin/python3
Creating virtual environment at: .venv
Resolved 92 packages in 1.57s
Installed 88 packages in 811ms
...
+ mlflow==3.18.0
+ mlflow-skinny==3.18.0
...
Then start the server:
uv run mlflow server --port 8080
Backend store URI not provided. Using sqlite:///mlflow.db
Registry store URI not provided. Using backend store URI.
2026/11/28 16:07:08 INFO mlflow.store.db.utils: Creating initial MLflow database tables...
2026/11/28 16:07:08 INFO mlflow.store.db.utils: Updating database tables
[MLflow] Security middleware enabled with default settings (localhost-only). To allow connections from other hosts, use --host 0.0.0.0 and configure --allowed-hosts and --cors-allowed-origins.
2026/11/28 16:07:09 INFO: Uvicorn running on http://127.0.0.1:8080 (Press CTRL+C to quit)
...
2026/11/28 16:07:11 INFO: Application startup complete.

sqlite:///mlflow.db: the runs go into a database file inmlflow-server, and the files each run saves, such as plots, intomlflow-server/mlartifacts. How to See Where MLflow Stores Runs and Artifacts shows both.--port 8080: MLflow's usual port, 5000, belongs to AirPlay Receiver on a Mac, so the project uses 8080 on every system. How to Change the MLflow Server Port covers other ports.- Four
StarletteDeprecationWarningmessages, which the excerpt leaves out, come from MLflow's own code, one per worker. They're harmless: Fixed: "StarletteDeprecationWarning: starlette.middleware.wsgi is deprecated" When You Start the MLflow Server explains them.
Leave this terminal open: the server runs as long as it does. How to Start an MLflow Tracking Server on Your Computer explains every option of mlflow server.
Step 3: Create Your Settings File
Open a second terminal in the term-deposit-prediction-mlflow-scikit-learn folder, and copy the example settings to .env, the file the project reads them from:
- macOS / Linux
- Windows (PowerShell)
cp .env.example .env
Copy-Item .env.example .env
Nothing is printed. This is the file you've just made:
# The MLflow tracking server this project sends its runs to.
MLFLOW_TRACKING_URI=http://127.0.0.1:8080
# The MLflow experiment that groups this project's runs.
MLFLOW_EXPERIMENT_NAME=term-deposit-prediction
# The folder that keeps the downloaded dataset, relative to the project folder.
TERM_DEPOSIT_DATA_DIR=data
The defaults match the server from Step 2, so there's nothing to change. Git ignores .env, so your own settings never end up in a commit.
Step 4: Install the Packages
uv sync
Using CPython 3.15.2 interpreter at: /Library/Frameworks/Python.framework/Versions/3.15/bin/python3.15
Creating virtual environment at: .venv
Resolved 94 packages in 5ms
Built term-deposit-prediction @ file:///Users/you/source/term-deposit-prediction-mlflow-scikit-learn
Prepared 1 package in 4ms
Installed 91 packages in 847ms
+ aiohappyeyeballs==2.7.1
...
+ zipp==4.1.2

uv sync creates the project's own environment in .venv and installs exactly the versions uv.lock lists, so you get the same packages the project was tested with. It also installs the project itself, which is what makes its tune command work with uv run.
Step 5: Put the Project in Git
Every run records the Git commit the code is at, so that months later you can still tell which code produced a result. That needs a Git repository:
git init -b main
Initialized empty Git repository in /Users/you/source/term-deposit-prediction-mlflow-scikit-learn/.git/
git add .
git commit -m "Term deposit prediction 1.0.0"
[main (root-commit) 612e0ab] Term deposit prediction 1.0.0
12 files changed, 2182 insertions(+)
create mode 100644 .env.example
create mode 100644 .gitignore
create mode 100644 .python-version
create mode 100644 README.md
create mode 100644 pyproject.toml
create mode 100644 src/term_deposit_prediction/__init__.py
create mode 100644 src/term_deposit_prediction/code_version.py
create mode 100644 src/term_deposit_prediction/config.py
create mode 100644 src/term_deposit_prediction/data.py
create mode 100644 src/term_deposit_prediction/model.py
create mode 100644 src/term_deposit_prediction/tune.py
create mode 100644 uv.lock

.env and .venv aren't in the list: .gitignore keeps them out, and the data folder the first search creates is ignored too. If Git asks who you are, How to Create a Git Repository and Make Your First Commit shows how to set your name and email. Your commit's hash, 612e0ab here, will be different.
Step 6: Run the Search
uv run tune --run-name first-search
2026/11/28 15:41:51 INFO mlflow.tracking.fluent: Experiment with name 'term-deposit-prediction' does not exist. Creating a new experiment.
2026/11/28 15:41:59 INFO term_deposit_prediction: Loading the Bank Marketing data
2026/11/28 15:41:59 INFO term_deposit_prediction.data: Downloading the Bank Marketing data from https://archive.ics.uci.edu/static/public/222/bank+marketing.zip
2026/11/28 15:42:27 INFO term_deposit_prediction: Trying 9 candidates with 5-fold cross-validation on 32950 calls
/Users/you/source/term-deposit-prediction-mlflow-scikit-learn/.venv/lib/python3.15/site-packages/sklearn/metrics/_classification.py:3424: FutureWarning: `y_pred` was renamed to `y_proba` in version 1.9 and will be removed in 1.11. Use `y_proba` instead.
warnings.warn(
2026/11/28 15:42:40 INFO mlflow.sklearn.utils: Logging the 5 best runs, 4 runs will be omitted.
🏃 View run unequaled-hen-32 at: http://127.0.0.1:8080/#/experiments/2/runs/3716c82b04054c62853660d05f7f0c4d
🧪 View experiment at: http://127.0.0.1:8080/#/experiments/2
🏃 View run valuable-tern-474 at: http://127.0.0.1:8080/#/experiments/2/runs/d30a209008b140dfbb36d68a88a6e514
🧪 View experiment at: http://127.0.0.1:8080/#/experiments/2
🏃 View run sincere-shrimp-736 at: http://127.0.0.1:8080/#/experiments/2/runs/a3a73da4efe34d779ae24f13ea321447
🧪 View experiment at: http://127.0.0.1:8080/#/experiments/2
🏃 View run flawless-moose-125 at: http://127.0.0.1:8080/#/experiments/2/runs/044fdfd2114547c4b40b3fa6371a176b
🧪 View experiment at: http://127.0.0.1:8080/#/experiments/2
🏃 View run defiant-midge-910 at: http://127.0.0.1:8080/#/experiments/2/runs/1b875e6bda8f4a4688d7baa339d943b0
🧪 View experiment at: http://127.0.0.1:8080/#/experiments/2
2026/11/28 15:42:41 INFO term_deposit_prediction: Run first-search: best {'model__learning_rate': 0.1, 'model__max_leaf_nodes': 15}, cross-validation ROC AUC 0.7998, test ROC AUC 0.8145
🏃 View run first-search at: http://127.0.0.1:8080/#/experiments/2/runs/eb9baede343249bb91212733d10f52aa
🧪 View experiment at: http://127.0.0.1:8080/#/experiments/2

Line by line:
Creating a new experiment: the first search creates theterm-deposit-predictionexperiment, the group your runs go into. I ran all three projects of the series against one server, so it's experiment 2 here; on your server, the number may differ.Downloading the Bank Marketing data: the project downloads the dataset once into itsdatafolder, checks its SHA-256 fingerprint, and reads that copy from then on.Trying 9 candidates: 3 learning rates times 3 tree sizes, each scored by its ROC AUC on 5 different splits of 32,950 calls. 20% of the calls are kept back and never seen by the search.FutureWarning: scikit-learn warns about an old argument name in a call MLflow's autologging makes. It changes nothing in the results, and MLflow has fixed it for a later release (mlflow/mlflow#28012).Logging the 5 best runs: MLflow gives the 5 best candidates a child run each, with names it makes up, such asunequaled-hen-32.Run first-search: the best settings, their cross-validation ROC AUC, and the ROC AUC of the best model on the calls the search never saw: 0.8145. A score of 0.5 would be guessing, and 1.0 perfect.
Step 7: Find the Search in MLflow
Open http://127.0.0.1:8080 in your browser. On your first visit, MLflow opens in GenAI mode, with the MLflow Assistant panel on the right. Recent Experiments lists every experiment on the server: here the two other projects of the series as well, because they share it.

GenAI mode is for apps built on language models. This project tunes a classic model, so:
- Click Model training at the top of the sidebar.
- Close the MLflow Assistant panel with the X in its top-right corner.

MLflow remembers both choices in your browser. Click term-deposit-prediction. The runs page shows one row, first-search, with a + before its name: click the + to show its child runs:

Each child run holds one candidate: its settings, and its scores across the 5 folds as mean_test_score, std_test_score and rank_test_score. Click first-search to open the parent run:

best_cv_scoreis the best candidate's cross-validation ROC AUC, andtest_roc_aucits score on the calls the search never saw.training_…metrics are the best model's scores on the calls it trained on, so they're higher than the honest test score.- Child runs links to the five candidates, and Source shows the commit from Step 5.
- Parameters, further down, lists the search's own settings and the best values, as
best_model__learning_rateandbest_model__max_leaf_nodes. - Artifacts holds
cv_results.csv, the score of every candidate on every fold, and plots of the best model's training confusion matrix, ROC curve and precision-recall curve.
Stop It, and Start It Again Later
To stop the server, press Ctrl+C in its terminal:
^CTraceback (most recent call last):
File "<frozen runpy>", line 201, in _run_module_as_main
File "<frozen runpy>", line 87, in _run_code
File "/Users/you/source/mlflow-server/.venv/lib/python3.15/site-packages/mlflow/server/jobs/_job_runner.py", line 49, in <module>
time.sleep(10) # wait for huey consumer launching
~~~~~~~~~~^^^^
KeyboardInterrupt
2026/11/28 16:07:14 INFO: Shutting down
...
2026/11/28 16:07:14 INFO: Stopping parent process [91461]
The KeyboardInterrupt traceback comes from the server's background job runner, and the server still stops cleanly. Fixed: "Exception ignored on threading shutdown" KeyboardInterrupt When You Stop the MLflow Server explains it, and shows how to turn the job runner off when you don't need it.
Your runs stay in mlflow-server/mlflow.db, and the downloaded data in the project's data folder. Next time, start the server from its folder. Your searches are still there in the UI, and uv run tune with a new --run-name adds another one:
uv run mlflow server --port 8080
Find Your Way Around the Code
| To change | Look in |
|---|---|
| The settings the search tries | PARAM_GRID in tune.py |
| The number of folds, the share kept back for testing, the seed | CV_FOLDS, TEST_SIZE and RANDOM_STATE in tune.py |
| How many candidates get a child run | The --max-tuning-runs option, 5 by default |
| The model | model.py: the text columns are one-hot encoded, then a HistGradientBoostingClassifier predicts |
| Which columns the model may use | data.py, which leaves out the length of the call |
| Where the runs go | MLFLOW_TRACKING_URI and MLFLOW_EXPERIMENT_NAME in .env |
Before You Go to Production
What you've just run is a tracking server for one person, on one computer. Part 10 of the series goes through the whole checklist. In short:
- Commit before you search. A run records the last commit, not changes you haven't committed.
- Back the server up. How to Back Up an MLflow Tracking Server copies the database and the artifacts safely while the server runs.
- Upgrade MLflow with a backup first. How to Upgrade an MLflow Tracking Database with mlflow db upgrade shows why.
- Open the server to other computers only on purpose. It accepts local addresses only. How to Let an MLflow Server Accept Another Host Name with --allowed-hosts is the first step when you need more.
Common Mistakes
| Mistake | What happens | Do this instead |
|---|---|---|
| Skipping Step 5 | Each run says Found no Git commit for the project, so the run won't record one, and records no commit | Put the folder in Git and commit, then search |
| Searching while the server isn't running | The run fails to reach 127.0.0.1:8080 | Start the server first, in its own terminal |
| Starting the server on port 5000 on a Mac | The browser shows "Access to localhost was denied" | Use --port 8080, as in Step 2 |
Reading the training_… metrics as the model's quality | They're scores on the data it learned from, so they look better than they are | Judge the model by best_cv_score and test_roc_auc |
Troubleshooting
| Symptom | Likely cause | Fix |
|---|---|---|
MlflowException: API request to … failed with exception … Max retries exceeded | The server isn't running, or runs on another port | Fixed: "MlflowException: API request to … failed with exception … Max retries exceeded" Connection Refused in MLflow |
| "Access to localhost was denied" in the browser | Something else, such as AirPlay Receiver, answers on that port | Fixed: "Access to localhost was denied" HTTP ERROR 403 When You Open the MLflow UI on a Mac |
The runs page shows only first-search | The child runs are folded under it | Click the + before its name |
Exception ignored on threading shutdown or another KeyboardInterrupt traceback when you stop the server | Ctrl+C interrupts the server's background job runner | Nothing to fix: Fixed: "Exception ignored on threading shutdown" KeyboardInterrupt When You Stop the MLflow Server |
FAQ
Do I need to read the tutorial series first?
No. This post is all you need to run the project. Part 5 of the series explains how the search and its autologging work.
Why is there no model file?
The search is about choosing settings, so autologging is told not to save models. Each run records the settings and the scores, which is what you compare.
Why does the project leave out the length of the call?
The length of a call isn't known until the call is over, and by then the customer has answered. The dataset's own notes point that out, so a model that's meant to be used before a call can't rely on it.
Does it run on Windows?
The steps are the same in PowerShell: only unzipping the archive and copying the settings file differ, and both have a PowerShell tab above. I ran those two in PowerShell 7.6 on macOS, not on Windows.
Conclusion
From the zip file to a finished search took six steps: unzip, start a tracking server, create .env, run uv sync, commit, and run tune. first-search tried 9 combinations of settings with 5-fold cross-validation, filed the 5 best as child runs, and found that a learning rate of 0.1 with 15 leaves per tree predicts unseen customers with a ROC AUC of 0.8145.
Additional Resources
README.mdin the archive: the search, every option and every setting.- MLflow Tutorial for Machine Learning in Python: the free series that builds this project.
- MLflow Tracking Server: MLflow's own guide to the server.
- Bank Marketing dataset: the data and its notes.
