Skip to main content

House Price Prediction with MLflow and scikit-learn

Train California house price models with scikit-learn and track every run in MLflow: a score at every step, system metrics, the exact data and a plot.

  • Python
  • uv
  • MLflow
  • scikit-learn
  • pandas

Screenshots

Screenshot 1 of 6: Title card: House Price Prediction, Python source code for MLflow, with its stack and a terminal where the validation RMSE falls from 0.5490 at 10 trees to 0.5276 at 100.

Title card: House Price Prediction, Python source code for MLflow, with its stack and a terminal where the validation RMSE falls from 0.5490 at 10 trees to 0.5276 at 100.

One-off price

  • ₹249+ GST, ₹293.82 in total
  • $5
  • Download it from your library as soon as your payment is confirmed.
  • Every later release of this project is included, at no extra cost.
Latest release
1.0.0 · Nov 28, 2026

Overview

The complete source code of a house price model in Python, tracked end to end with MLflow 3.18. Each training run records its settings, a validation score after every 10 trees, its test scores, CPU and memory use, the data it trained on, a predicted-against-actual plot and its Git commit. Two commands read the runs back as a leaderboard and a learning curve.

A model is only as useful as your memory of how you got it. House Price Prediction with MLflow and scikit-learn trains a scikit-learn random forest on the California Housing data and lets MLflow remember everything about every run, so you can compare runs instead of guessing.

What every run records

  • Its settings. Trees, depth, the split sizes and the seed, as MLflow parameters.
  • A score at every step. The forest grows 10 trees at a time and is scored on validation rows after each step, so MLflow draws the learning curve.
  • Its test scores. MAE, RMSE and R² on rows the model never trained on. The first run scored an RMSE of 0.516, about $51,600 on a typical house.
  • The computer's work. CPU, memory, disk and network use, sampled every second.
  • The exact data. The training, validation and test rows as MLflow datasets, each with a digest that changes when the data does.
  • The evidence. A predicted-against-actual plot, the feature importances, every test prediction as a CSV file and the model's full settings.
  • The code behind it. The Git commit of the code that produced it.

Read your runs back

  • leaderboard ranks the finished runs by validation RMSE, with an optional MLflow search filter.
  • curve prints one run's score after each step and the step where it was best.

Code you can build on

  • A clean Python package. A src layout managed by uv, with three commands: train, curve and leaderboard.
  • Settings in one place. pydantic-settings reads .env, and .env.example documents every setting.
  • Exact versions. uv.lock pins every package: MLflow 3.18.0, scikit-learn 1.9.1, pandas 3.1.1 and Python 3.15.
  • No data in the archive. scikit-learn downloads the public dataset on the first run.

What it doesn't include

  • No hosting. It runs on your own computer, against an MLflow tracking server you start in one command.
  • No test project. The results above come from real runs, not from automated tests in the archive.

Run it in six steps

  1. Unzip the archive.
  2. Start an MLflow tracking server.
  3. Copy .env.example to .env.
  4. Install the packages with uv sync.
  5. Put the project in Git.
  6. Train with uv run train.

The README has every command, for macOS and Linux and for PowerShell. How to Set Up and Run the House Price Prediction Project (opens in a new tab) shows each step with what it should print. It was tested from a clean copy of the archive on macOS.

Learn how it was built

Parts 1 to 4 of the free tutorial series MLflow Tutorial for Machine Learning in Python (opens in a new tab) explain the tracking server, metrics over time, system metrics, artifacts, datasets and searching runs, using this code.

Free tutorial series

MLflow Tutorial for Machine Learning in Python

Prefer to learn by building it? This free, step-by-step guide on our blog shows how the project is made.

Read the series (opens in a new tab)

What you get

Everything in the archive, at a glance.

  • Version 1.0.0 of the complete source code: a Python package managed by uv
  • The train command: a random forest grown 10 trees at a time, with validation scores at every step and test scores at the end
  • MLflow tracking of parameters, step metrics, test metrics, system metrics, datasets, a plot, two tables and the Git commit
  • The leaderboard command, which ranks runs with an optional MLflow search filter
  • The curve command, which prints a run's learning curve and its best step
  • Settings in .env through pydantic-settings, with a documented .env.example
  • uv.lock with the exact version of every package
  • A README with the setup for macOS, Linux and PowerShell, every command, option and setting, and the dataset's credit

Built with

The exact runtimes and versions it was built and tested against.

  • Python3.15.2
  • uv0.13.10
  • MLflow3.18.0
  • scikit-learn1.9.1
  • pandas3.1.1
  • NumPy2.5.5
  • Matplotlib3.11.2
  • pydantic-settings2.16.3
  • psutil7.2.2

What is in the archive

The file tree you get once you unzip it.

house-price-prediction-mlflow-scikit-learn/

  • src/
    • house_price_prediction/
      • __init__.py
      • code_version.py
      • config.py
      • curve.py
      • data.py
      • datasets.py
      • leaderboard.py
      • plots.py
      • reports.py
      • train.py
  • .env.example
  • .gitignore
  • .python-version
  • pyproject.toml
  • uv.lock
  • README.md

What it needs from you

The accounts and services it expects to find, so nothing is a surprise.

  • uv, which installs Python 3.15 and the packages for you
  • Git, so each run records the commit of its code
  • An MLflow tracking server: the README starts one on your computer in one command
  • An internet connection for the first install, about 550 MB of packages, and the first run, which downloads the data

Releases

Every version so far, newest first.

  1. 1.0.0Latest

    First release of the complete source code.

    • Trains a scikit-learn random forest on the California Housing data and tracks every run in MLflow 3.18.0.
    • Records the settings, a validation score at every step, the test scores, system metrics, the datasets, a plot, two tables and the Git commit.
    • Adds two commands that read the runs back: a leaderboard and a learning curve.
    • Includes a README that takes you from the archive to your first tracked run.

Source Code Licence

What you may do with it

What you may and may not do with the source code you buy.

Read the full licence
  1. What this licence covers

This licence governs every file included in a product you buy from Dewiride Store: source code, configuration, database scripts, sample data, documentation and any other file in the download. It takes effect when your payment is confirmed and applies to every release of that product that reaches your library. Files that reach your library through an annual updates membership are governed in exactly the same way.

It forms part of the Terms of Sale and Use. Where a product page states different or additional licence terms for that product, those terms prevail for that product. The membership page may likewise state different or additional licence terms for the files a membership carries, and those terms then prevail for those files.

  1. The licence we grant you

We grant you a perpetual, worldwide, non-exclusive, non-transferable licence to use, reproduce, adapt, translate and modify the files, and to include the result in your own work, on the conditions set out below.

Perpetual means it does not expire. Worldwide means it is not limited to any country. Non-exclusive means we license the same product to other customers. Non-transferable means you cannot pass it on to someone else.

The licence is granted to you — either you personally, or the organisation you identified when buying. Everyone working within that organisation may use the files for that organisation’s projects. Nobody outside it may.

  1. What you may do
  • Use and change the files in your own projects, commercial or otherwise, with no limit on the number of projects.
  • Build a product or a service on them and charge your own customers for it.
  • Deploy the result for a client, as part of work you are doing for that client.
  • Distribute the result in compiled, deployed or otherwise non-source form.
  • Keep as many back-up copies as you reasonably need.
  • Study, observe and test how the code works, and obtain the information you need to make it work with your own software.

The last two are yours by law under sections 52(1)(aa) to (ac) of the Indian Copyright Act, 1957, and nothing in this licence is intended to take them away.

  1. What you may not do
  • Resell, sublicense, redistribute or publish the files themselves, in whole or in substantial part, in source form.
  • Include them in a template, starter kit, course, tutorial repository or component library that you sell or give away, where the code is the thing being supplied.
  • Share your account, your download links or your invoices with anyone outside your organisation.
  • Publish the files in a public repository, or in any other place where they can be obtained without buying them.
  • Remove or obscure the copyright and attribution notices in the source files.
  • Use the files to build something whose main purpose is to compete with Dewiride Store as a supplier of the same code.

The distinction that matters is simple: you may sell what you build with the code; you may not sell the code.

  1. Third-party components

Our products depend on open-source libraries, frameworks and services that we did not write. Those remain under their own licences, which we do not and cannot change. Where a product includes or requires such a component, its licence is named in the product’s documentation, and complying with it is your responsibility.

  1. Releases

Every release of a product you own is covered by this same licence and appears in your library at no extra cost. A release you have already downloaded remains licensed to you even if we later stop publishing the product. A release that reached your library through an annual updates membership is licensed to you on these same terms, and stays licensed after the period that carried it has ended.

  1. Ownership

We keep ownership of the files and of the copyright in them. You own whatever you create with them: your changes, your additions and the product you build are yours.

  1. If this licence ends

This licence ends if you materially breach it and do not put the breach right within thirty days of us asking you to in writing. It also ends if your payment is reversed or refunded, because the purchase it depends on no longer stands. Where a membership period is refunded or reversed, the licence ends for the releases that period carried and for nothing else: anything you bought separately, or that another period carried, is unaffected.

If it ends, you must stop using the files and delete the copies you hold. Work you had already delivered to a client before that point may continue in use, so that ending this licence never breaks something your own customer relies on.

  1. No warranty beyond the description

The warranties and limits in section 19 and section 20 of the Terms of Sale and Use apply to this licence as well.

  1. Governing law

This licence is governed by the law of India, and section 24 of the Terms of Sale and Use applies to any dispute about it. If a translation and the English version differ in meaning, the English version governs.