---
title: "Training Machine Learning Models with ClickHouse"
description: "ClickHouse can serve as both the transformation engine and offline store in a virtual feature store, using the open-source Featureform as an orchestration layer."
url: "https://swe.quest/articles/training-machine-learning-models-with-clickhouse-fff12f2958d1827c"
canonical: "https://clickhouse.com/blog/training-machine-learning-models-with-clickhouse-and-featureform"
source: "ClickHouse"
published: "2024-04-03"
difficulty: "medium"
kind: "How-to"
reading_minutes: 25
tags: ["ml-platform","analytics","machine-learning","python"]
---

# Training Machine Learning Models with ClickHouse

A post on [ClickHouse](https://swe.quest/sources/clickhouse.md), published 2024-04-03, 25 min read, How-to. Original: [https://clickhouse.com/blog/training-machine-learning-models-with-clickhouse-and-featureform](https://clickhouse.com/blog/training-machine-learning-models-with-clickhouse-and-featureform)

## Summary

ClickHouse can serve as both the transformation engine and offline store in a virtual feature store, using the open-source Featureform as an orchestration layer. Exploration and feature engineering run as SQL at the data source, with no need to move data into frameworks like Spark, and results persist via INSERT INTO SELECT or views. A hands-on walkthrough deploys Featureform with ClickHouse in Docker, registers a Kaggle credit card fraud dataset, and defines versioned features. Those features are then used to train Logistic Regression and Decision Tree classifiers.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [ML platforms](https://swe.quest/tags/ml-platform.md) (AI & ML)
- [Analytics & OLAP](https://swe.quest/tags/analytics.md) (Data & databases)
- [Machine learning](https://swe.quest/tags/machine-learning.md) (AI & ML)
- [Python](https://swe.quest/tags/python.md) (Languages)

## Prerequisites

- SQL basics ([easy posts on SQL](https://swe.quest/tags/sql.md?difficulty=easy))
- Python and pandas ([easy posts on Python](https://swe.quest/tags/python.md?difficulty=easy))
- basic ML classification concepts ([easy posts on Machine learning](https://swe.quest/tags/machine-learning.md?difficulty=easy))

## Keywords

ClickHouse, Featureform, feature store, scikit-learn, Docker, Kaggle

## Related posts

- [Powering Feature Stores with ClickHouse](https://swe.quest/articles/powering-feature-stores-with-clickhouse-9d4db3ca1ba6f6e2.md): ClickHouse · 2024-01-18 · Easy · 17 min read · ML platforms, Analytics & OLAP, Machine learning
  Feature stores centralize the storage, versioning and retrieval of ML features so the same data serves both model training and inference.
- [Modeling Machine Learning Data in OLAP databases](https://swe.quest/articles/modeling-machine-learning-data-in-olap-databases-0fad2c579add8f45.md): ClickHouse · 2024-08-08 · Medium · 26 min read · ML platforms, Analytics & OLAP, SQL, Data pipelines
  ClickHouse can act as the transformation engine and offline store of an ML feature store, with features modeled as timestamped tables and assembled into point-in-time correct training sets.
- [If it’s in your catalog, you can query it: The DataLakeCatalog engine in ClickHouse Cloud](https://swe.quest/articles/if-it-s-in-your-catalog-you-can-query-it-the-datalakecatalog-engine-in-8d1562fe3bdf6842.md): ClickHouse · 2025-10-15 · Medium · 13 min read · Analytics & OLAP, Query engines, Cloud platforms, SQL
  ClickHouse's DataLakeCatalog database engine connects to lakehouse catalogs such as AWS Glue and Databricks Unity Catalog, reads their metadata, and automatically maps each table to the matching Iceberg or DeltaLake table engine.
- [Trillabit Utilizes the Power of ClickHouse for Fast, Scalable Results Within Their Self-Service, Search-Driven Analytics Offering](https://swe.quest/articles/trillabit-utilizes-the-power-of-clickhouse-for-fast-scalable-results-within-6137812e3149a41e.md): ClickHouse · 2023-01-30 · Easy · 6 min read · Analytics & OLAP, Databases, Data pipelines
  TrillaBit moved its search-driven BI platform from Apache Solr to ClickHouse after Solr proved weak at high-volume aggregation, compression, SQL maturity and joins, and chose ClickHouse over Snowflake on cost and the ability to self-host.
- [Analyzing Hugging Face datasets with ClickHouse](https://swe.quest/articles/analyzing-hugging-face-datasets-with-clickhouse-12e5d1b0f22de93c.md): ClickHouse · 2023-08-29 · Medium · 28 min read · Analytics & OLAP, SQL, Machine learning
  Hugging Face's Datasets Server automatically converts every dataset to Parquet and exposes the file URLs through a REST endpoint, so clickhouse-local can query any dataset with plain SQL via the url function and URL table engine.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
