How to Set Up and Run the House Price Prediction Project with MLflow and scikit-learn
You've downloaded the House Price Prediction source code, and you want to see it working. This post takes you from the zip file to a trained model whose every run you can open in MLflow, 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 run records the version of the code that produced it;
- two trained models, with their settings, a score after every 10 trees, their test scores, a plot and the data each one used, side by side in MLflow;
- two commands that read the runs back: a leaderboard and a learning curve.
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 training run, which downloads the data, under 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.
Step 1: Unzip the Archive
Open a terminal in the folder where you saved the zip file.
- macOS / Linux
- Windows (PowerShell)
unzip house-price-prediction-mlflow-scikit-learn-1.0.0.zip
cd house-price-prediction-mlflow-scikit-learn
Expand-Archive -Path house-price-prediction-mlflow-scikit-learn-1.0.0.zip -DestinationPath .
Set-Location house-price-prediction-mlflow-scikit-learn
This is what you've got:
├── README.md These same steps, every command and every setting
├── pyproject.toml The project, its packages and its three commands
├── uv.lock The exact version of every package
├── .python-version Python 3.15
├── .env.example The settings, with their defaults
├── .gitignore
└── src/
└── house_price_prediction/
├── train.py The train command
├── curve.py The curve command
├── leaderboard.py The leaderboard command
├── data.py Loads the data and splits it
├── datasets.py Describes each part of the split for MLflow
├── plots.py The predicted-against-actual plot
├── reports.py The tables each run saves
├── 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 2.37s
Installed 88 packages in 1.01s
...
+ 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 15:35:41 INFO mlflow.store.db.utils: Creating initial MLflow database tables...
2026/11/28 15:35:41 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 15:35:42 INFO: Uvicorn running on http://127.0.0.1:8080 (Press CTRL+C to quit)
...
2026/11/28 15:35:48 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 house-price-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=house-price-prediction
# Record the computer's CPU, memory, disk and network use during each run (true or false).
HOUSE_PRICES_LOG_SYSTEM_METRICS=true
# Seconds between two system metrics samples (0.1 or more). A run records none unless it lasts
# longer than one interval, so keep this below your shortest training run.
HOUSE_PRICES_SYSTEM_METRICS_INTERVAL=1
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 6ms
Built house-price-prediction @ file:///Users/you/source/house-price-prediction-mlflow-scikit-learn
Prepared 1 package in 5ms
Installed 92 packages in 853ms
+ aiohappyeyeballs==2.7.1
+ aiohttp==3.14.5
...
+ 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 three commands, train, curve and leaderboard, 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/house-price-prediction-mlflow-scikit-learn/.git/
git add .
git commit -m "House price prediction 1.0.0"
[main (root-commit) 7e0134d] House price prediction 1.0.0
16 files changed, 2442 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/house_price_prediction/__init__.py
create mode 100644 src/house_price_prediction/code_version.py
create mode 100644 src/house_price_prediction/config.py
create mode 100644 src/house_price_prediction/curve.py
create mode 100644 src/house_price_prediction/data.py
create mode 100644 src/house_price_prediction/datasets.py
create mode 100644 src/house_price_prediction/leaderboard.py
create mode 100644 src/house_price_prediction/plots.py
create mode 100644 src/house_price_prediction/reports.py
create mode 100644 src/house_price_prediction/train.py
create mode 100644 uv.lock

.env and .venv aren't in the list: .gitignore keeps them out. 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, 7e0134d here, will be different.
Step 6: Train Your First Model
uv run train --run-name first-run
2026/11/28 15:38:18 INFO mlflow.tracking.fluent: Experiment with name 'house-price-prediction' does not exist. Creating a new experiment.
2026/11/28 15:38:18 INFO house_price_prediction: Loading the California Housing data
2026/11/28 15:38:18 INFO sklearn.datasets._california_housing: Downloading Cal. housing from https://ndownloader.figshare.com/files/5976036 to /Users/you/scikit_learn_data
2026/11/28 15:38:21 INFO mlflow.system_metrics.system_metrics_monitor: Skip logging GPU metrics. Set logger level to DEBUG for more details.
2026/11/28 15:38:21 INFO mlflow.system_metrics.system_metrics_monitor: Started monitoring system metrics.
2026/11/28 15:38:21 INFO house_price_prediction: Training on 13209 rows, scoring on 3303 validation rows
2026/11/28 15:38:21 INFO house_price_prediction: 10 trees: validation RMSE 0.5490
2026/11/28 15:38:21 INFO house_price_prediction: 20 trees: validation RMSE 0.5417
2026/11/28 15:38:21 INFO house_price_prediction: 30 trees: validation RMSE 0.5363
2026/11/28 15:38:21 INFO house_price_prediction: 40 trees: validation RMSE 0.5320
2026/11/28 15:38:21 INFO house_price_prediction: 50 trees: validation RMSE 0.5308
2026/11/28 15:38:22 INFO house_price_prediction: 60 trees: validation RMSE 0.5300
2026/11/28 15:38:22 INFO house_price_prediction: 70 trees: validation RMSE 0.5301
2026/11/28 15:38:22 INFO house_price_prediction: 80 trees: validation RMSE 0.5287
2026/11/28 15:38:22 INFO house_price_prediction: 90 trees: validation RMSE 0.5283
2026/11/28 15:38:22 INFO house_price_prediction: 100 trees: validation RMSE 0.5276
2026/11/28 15:38:23 INFO house_price_prediction: Run first-run: MAE 0.337, RMSE 0.516, R2 0.797
🏃 View run first-run at: http://127.0.0.1:8080/#/experiments/1/runs/ce4616f10a6e405dabf35d68503eb0a5
🧪 View experiment at: http://127.0.0.1:8080/#/experiments/1
2026/11/28 15:38:23 INFO mlflow.system_metrics.system_metrics_monitor: Stopping system metrics monitoring...
2026/11/28 15:38:23 INFO mlflow.system_metrics.system_metrics_monitor: Successfully terminated system metrics monitoring!

Line by line:
Creating a new experiment: the first run creates thehouse-price-predictionexperiment, the group your runs go into.Downloading Cal. housing: scikit-learn downloads the California Housing data once, and keeps it inscikit_learn_datain your home folder. Later runs read that copy.Started monitoring system metrics: MLflow samples CPU, memory, disk and network use every second while the run lasts.10 treesto100 trees: the forest grows 10 trees at a time, and after each step it's scored on 3,303 rows it doesn't train on. RMSE is the typical error, in units of $100,000.Run first-run: the final scores, on 4,128 rows kept back for testing. The model is off by about $51,600 on a typical house, and explains about 80% of the variation in prices.
Step 7: Find the Run in MLflow
Open http://127.0.0.1:8080 in your browser. On a first visit, MLflow opens in GenAI mode, with the MLflow Assistant panel on the right:

GenAI mode is for apps built on language models. This project trains 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 house-price-prediction:

Click first-run to open the run:

Next to Source, 7e0134d is the commit from Step 5: this run came from exactly that code. Below the metrics, Parameters lists every setting the run used. Open the Model metrics tab to see the scores as charts:

The test scores are bars, because they were logged once. The validation scores are lines, one point per step, so you can see the forest improve as it grows, and see the improvement flatten out after about 50 trees.
Then open Artifacts, then plots, then predicted_vs_actual.png:

Each dot is a test row: the closer it sits to the dashed line, the better the prediction. The column of dots on the right edge is the dataset's highest value, 5.00001, or $500,001, which 965 of its 20,640 rows share. evaluation holds the feature importance table and every test prediction as a CSV file.
Step 8: Train Again and Compare
Train a second model whose trees may only grow 8 levels deep:
uv run train --run-name depth-8 --max-depth 8
2026/11/28 15:38:34 INFO house_price_prediction: 100 trees: validation RMSE 0.5857
2026/11/28 15:38:34 INFO house_price_prediction: Run depth-8: MAE 0.403, RMSE 0.586, R2 0.738
🏃 View run depth-8 at: http://127.0.0.1:8080/#/experiments/1/runs/4abd5fd82ac14b23826763ef63d83b30
🧪 View experiment at: http://127.0.0.1:8080/#/experiments/1
2026/11/28 15:38:34 INFO mlflow.system_metrics.system_metrics_monitor: Stopping system metrics monitoring...
2026/11/28 15:38:34 INFO mlflow.system_metrics.system_metrics_monitor: Successfully terminated system metrics monitoring!
Now rank the runs. leaderboard lists the finished runs with the lowest validation RMSE first:
uv run leaderboard
run val_rmse test_rmse trees max_depth seed run_id
first-run 0.5276 0.5157 100 None 42 ce4616f10a6e405dabf35d68503eb0a5
depth-8 0.5857 0.5864 100 8 42 4abd5fd82ac14b23826763ef63d83b30

Limiting the depth made the model worse here: 0.5857 against 0.5276. --top sets how many runs it shows, and --filter narrows them with an MLflow search condition, such as --filter "params.max_depth = '8'".
curve shows how one run's score changed as its forest grew:
uv run curve first-run
10 trees val_rmse 0.5490
20 trees val_rmse 0.5417
30 trees val_rmse 0.5363
40 trees val_rmse 0.5320
50 trees val_rmse 0.5308
60 trees val_rmse 0.5300
70 trees val_rmse 0.5301
80 trees val_rmse 0.5287
90 trees val_rmse 0.5283
100 trees val_rmse 0.5276
Best val_rmse: 0.5276 at 100 trees

--metric val_mae or --metric val_r2 shows the other two scores. The README lists every option of the three commands.
Stop It, and Start It Again Later
To stop the server, press Ctrl+C in its terminal:
^CException ignored on threading shutdown:
2026/11/28 15:59:06 INFO: Shutting down
...
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.15/lib/python3.15/threading.py", line 1721, in _shutdown
_thread_shutdown()
~~~~~~~~~~~~~~~~^^
KeyboardInterrupt
...
2026/11/28 15:59:07 INFO: Waiting for child process [71282]
2026/11/28 15:59:07 INFO: Stopping parent process [71276]
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 mlflow-server/mlartifacts. Next time, start the server from its folder, then work from the project's folder in a second terminal, for example with the leaderboard from Step 8:
uv run mlflow server --port 8080
uv run leaderboard
Find Your Way Around the Code
| To change | Look in |
|---|---|
| What a run records | train.py: the parameters, the step and test metrics, the plot and the tables |
| The model | train.py, where it builds the RandomForestRegressor |
| How the data is split | data.py, and the --test-size, --validation-size and --random-state options |
| The plot | plots.py |
| The tables a run saves | reports.py |
| The leaderboard's columns or its sort order | leaderboard.py |
| 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 train. 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 train |
| Training 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 |
Running an mlflow command, such as mlflow runs describe, without --env-file .env | The command uses a new local database, and can't find your runs | Add --env-file .env |
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 |
MlflowException: Run with id=… not found from an mlflow command | The command didn't read .env | Fixed: "MlflowException: Run with id=… not found" When You Run an MLflow CLI Command |
| The UI shows Traces and Evaluation menus, and no runs | It's in GenAI mode | Click Model training at the top of the sidebar |
Exception ignored on threading shutdown and a 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. The series explains how each piece works, from Part 1 to Part 4 for this project.
Can I use another port?
Yes. Start the server with your port, and change MLFLOW_TRACKING_URI in .env to match, such as http://127.0.0.1:8090.
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.
Can I turn off the data MLflow sends?
Yes. MLflow sends anonymous usage data to its developers by default. How to Turn Off MLflow Telemetry shows how to turn it off.
Conclusion
From the zip file to a trained model took six steps: unzip, start a tracking server, create .env, run uv sync, commit, and train. first-run scored an RMSE of 0.516 on its test rows, recorded the commit 7e0134d, and saved its scores, settings, data, plot and tables in MLflow, where leaderboard and curve read them back.
Additional Resources
README.mdin the archive: every command, option and 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.
- uv: Working on projects: what
uv syncanduv rundo.
