<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Data-Science on Max Halford</title><link>https://maxhalford.github.io/tags/data-science/</link><description>Recent content in Data-Science on Max Halford</description><generator>Hugo</generator><language>en-US</language><managingEditor>maxhalford25@gmail.com (Max Halford)</managingEditor><webMaster>maxhalford25@gmail.com (Max Halford)</webMaster><lastBuildDate>Tue, 21 Jul 2026 21:18:41 +0200</lastBuildDate><atom:link href="https://maxhalford.github.io/tags/data-science/index.xml" rel="self" type="application/rss+xml"/><item><title>My unvarnished guide to solution engineering</title><link>https://maxhalford.github.io/blog/solution-engineering-advice/</link><pubDate>Thu, 04 Jun 2026 00:00:00 +0000</pubDate><author>maxhalford25@gmail.com (Max Halford)</author><guid>https://maxhalford.github.io/blog/solution-engineering-advice/</guid><description>&lt;div align="center" &gt;
&lt;figure style="width: 100%; margin: 0;"&gt;
 &lt;img src="https://maxhalford.github.io/img/blog/solution-engineering-advice/cover.png" style="box-shadow: none;"&gt;
&lt;/figure&gt;
&lt;/div&gt;
&lt;h2 id="introduction"&gt;Introduction&lt;/h2&gt;
&lt;p&gt;I joined &lt;a href="https://www.carbonfact.com/"&gt;Carbonfact&lt;/a&gt; as a first employee. In a nutshell, it&amp;rsquo;s software that takes in raw ERP and PLM data, and spits out environmental reports. I got pulled into many Sales processes and customer onboardings, in addition to building the software. As the company grew, so did my expertise, which made me relevant for selling to and managing big logos. We &lt;a href="https://www.carbonfact.com/customers"&gt;signed&lt;/a&gt; a lot of well-known brands in the fashion industry.&lt;/p&gt;</description></item><item><title>The total derivative of a metric tree</title><link>https://maxhalford.github.io/blog/metric-tree-total-derivative/</link><pubDate>Tue, 06 May 2025 00:00:00 +0000</pubDate><author>maxhalford25@gmail.com (Max Halford)</author><guid>https://maxhalford.github.io/blog/metric-tree-total-derivative/</guid><description>&lt;p&gt;&lt;em&gt;A metric tree is a visual way to organize a complex metric. Count gives a good introduction &lt;a href="https://count.co/blog/intro-to-metric-trees"&gt;here&lt;/a&gt;. &lt;a href="https://www.linkedin.com/in/abhi-sivasailam/"&gt;Abhi Sivasailam&lt;/a&gt; gave a popular &lt;a href="https://www.youtube.com/watch?v=Dbr8jmtfZ7Q&amp;amp;ab_channel=DataCouncil"&gt;talk&lt;/a&gt; at Data Council 2023 if watching videos is your thing. &lt;a href="https://www.linkedin.com/in/ergestx/"&gt;Ergest Xheblati&lt;/a&gt; is someone to follow if you want to go deeper. There&amp;rsquo;s also a &lt;a href="https://www.lightdash.com/blogpost/metric-trees-how-top-data-teams-impact-growth"&gt;recent article&lt;/a&gt; from Lightdash. Finally, there&amp;rsquo;s &lt;a href="https://timodechau.com/metric-trees-for-digital-analysts/"&gt;this article&lt;/a&gt; by Timo Dechau, but it&amp;rsquo;s behind a paywall. The concept has a &lt;a href="https://en.wikipedia.org/wiki/Metric_tree"&gt;homonym&lt;/a&gt;, so beware when you browse for it.&lt;/em&gt;&lt;/p&gt;</description></item><item><title>Hard data integration problems at Carbonfact</title><link>https://maxhalford.github.io/blog/hard-data-integration-problems-at-carbonfact/</link><pubDate>Thu, 02 Jan 2025 00:00:00 +0000</pubDate><author>maxhalford25@gmail.com (Max Halford)</author><guid>https://maxhalford.github.io/blog/hard-data-integration-problems-at-carbonfact/</guid><description>&lt;p&gt;Carbonfact&amp;rsquo;s customers are clothing brands and factories. Our mission is to measure (and ultimately reduce) the carbon footprint of their products. We need primary data to do this: purchase orders, bills of materials, energy consumption data, etc.&lt;/p&gt;
&lt;p&gt;Each customer has a unique IT setup, which makes it challenging to scale to hundreds/thousands of customers. Our success as a business depends on our ability to not reinvent the wheel for each customer.&lt;/p&gt;</description></item><item><title>Cutting up shoes to measure their footprint</title><link>https://maxhalford.github.io/blog/cutting-up-shoes/</link><pubDate>Fri, 17 May 2024 00:00:00 +0000</pubDate><author>maxhalford25@gmail.com (Max Halford)</author><guid>https://maxhalford.github.io/blog/cutting-up-shoes/</guid><description>&lt;p&gt;Our mission at &lt;a href="https://www.carbonfact.com/"&gt;Carbonfact&lt;/a&gt; is to measure the environmental impact of clothes. This involves a lot of steps. The main one is to determine what materials a product is made of, along with each material&amp;rsquo;s mass. This is straightforward for most clothes like jumpers and pants. These are typically made of a single fabric, such as cotton or polyester. The mass of each material is roughly the same as the product&amp;rsquo;s mass.&lt;/p&gt;</description></item><item><title>Decomposing funnel metrics</title><link>https://maxhalford.github.io/blog/funnel-decomposition/</link><pubDate>Thu, 14 Dec 2023 00:00:00 +0000</pubDate><author>maxhalford25@gmail.com (Max Halford)</author><guid>https://maxhalford.github.io/blog/funnel-decomposition/</guid><description>&lt;h2 id="funnel-metrics-as-products"&gt;Funnel metrics as products&lt;/h2&gt;
&lt;p&gt;I talked about metric decomposition in a &lt;a href="https://maxhalford.github.io/blog/kpi-evolution-decomposition"&gt;previous article&lt;/a&gt;, and how it can be used to explain why metrics change values over time. That article explained how to decompose a sum, as well as a ratio. In this article, I&amp;rsquo;ll explain how to decompose a product.&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;revenue = impressions * click_rate * conversion_rate * spend
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;The decomposition in this article isn&amp;rsquo;t limited to funnels. It can be applied to any metric that is expressed as a product of factors. For instance, at Carbonfact, we decompose the carbon footprint of a clothing line as so:&lt;/p&gt;</description></item><item><title>Answering "Why did the KPI change?" using decomposition</title><link>https://maxhalford.github.io/blog/kpi-evolution-decomposition/</link><pubDate>Wed, 09 Aug 2023 00:00:00 +0000</pubDate><author>maxhalford25@gmail.com (Max Halford)</author><guid>https://maxhalford.github.io/blog/kpi-evolution-decomposition/</guid><description>&lt;p&gt;&lt;strong&gt;Edit&lt;/strong&gt; &amp;ndash; &lt;em&gt;I published a notebook &lt;a href="https://gist.github.com/MaxHalford/9fba0c2d6800d0f0643902bf57b99780"&gt;here&lt;/a&gt; that deals with the case where dimension values may (dis)appear from one period of time to the next. The notebook decomposes a ratio, but the logic is also valid for decomposing a sum.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Edit 2&lt;/strong&gt; &amp;ndash; &lt;em&gt;I&amp;rsquo;ve stumbled on &lt;a href="https://medium.com/@shaozhifei/metric-decomposition-formula-to-understand-metric-trend-e693b7a4c8cf"&gt;this article&lt;/a&gt; by Shao Zhifei which provides a good derivation of the ratio decomposition formula. I contacted Shao Zhifei on LinkedIn, and he told me they heavily use these formulas at &lt;a href="https://www.grab.com/"&gt;Grab&lt;/a&gt;. He also pointed out a typo in the ratio decomposition formula which I have now fixed.&lt;/em&gt;&lt;/p&gt;</description></item><item><title>Graph components with DuckDB</title><link>https://maxhalford.github.io/blog/graph-components-duckdb/</link><pubDate>Sat, 03 Jun 2023 00:00:00 +0000</pubDate><author>maxhalford25@gmail.com (Max Halford)</author><guid>https://maxhalford.github.io/blog/graph-components-duckdb/</guid><description>&lt;h2 id="introduction"&gt;Introduction&lt;/h2&gt;
&lt;p&gt;Graph problems are quite common. However, it&amp;rsquo;s rare to have access to a database offering graph semantics. There are graph databases, such as &lt;a href="https://neo4j.com/"&gt;Neo4j&lt;/a&gt; and &lt;a href="https://spark.apache.org/docs/latest/graphx-programming-guide.html"&gt;GraphX&lt;/a&gt;, but it&amp;rsquo;s difficult to justify setting one of those up. One could simply use &lt;a href="https://networkx.org/"&gt;networkx&lt;/a&gt; in Python. But that only works if the graph fits in memory.&lt;/p&gt;
&lt;p&gt;From a practical angle, the fact is that people are querying data warehouses in SQL. There are many good reasons to write graph algorithms in SQL. And anyway, one may argue that graphs are a special case of the &lt;a href="https://en.wikipedia.org/wiki/Relational_model"&gt;relational model&lt;/a&gt;.&lt;/p&gt;</description></item><item><title>Metric correctness doesn't matter, consistency does</title><link>https://maxhalford.github.io/blog/consistent-metrics/</link><pubDate>Fri, 28 Apr 2023 00:00:00 +0000</pubDate><author>maxhalford25@gmail.com (Max Halford)</author><guid>https://maxhalford.github.io/blog/consistent-metrics/</guid><description>&lt;p&gt;&lt;a href="https://www.un.org/en/dayof8billion"&gt;According to&lt;/a&gt; the United Nations, the 15th of November &lt;a href="https://www.bbc.co.uk/newsround/63632981"&gt;was the day&lt;/a&gt; we crossed 8 billion humans on the planet. How can they be so sure of that? Surely there has to be some margin of error, meaning it could have happened on the 14th or 16th. Then again, does it matter?&lt;/p&gt;
&lt;p&gt;I would argue almost all metrics we look at are incorrect. For instance, I work at a company whose goal is to measure the carbon footprint of clothing items. I can tell you first hand our measurements are stock full of assumptions. In the sustainability world, it&amp;rsquo;s not surprising to get reports like this one:&lt;/p&gt;</description></item><item><title>Are Airbnb guests less energy efficient than their host?</title><link>https://maxhalford.github.io/blog/airbnb-energy-usage/</link><pubDate>Tue, 17 Jan 2023 00:00:00 +0000</pubDate><author>maxhalford25@gmail.com (Max Halford)</author><guid>https://maxhalford.github.io/blog/airbnb-energy-usage/</guid><description>&lt;h2 id="tldr"&gt;TLDR&lt;/h2&gt;
&lt;p&gt;I compared the energy consumption of Airbnb guests versus their host, in the same apartment, during 2022. It appears that guests do in fact consume more energy than hosts. The data I used is available to any Airbnb host. I also open-sourced all the code I wrote for this analysis.&lt;/p&gt;
&lt;h2 id="introduction"&gt;Introduction&lt;/h2&gt;
&lt;p&gt;European energy prices have soared in 2022. It&amp;rsquo;s gone to the point where some Airbnb hosts have become reluctant to rent, believing their guests are too wasteful and cost too much. You can see this by scrolling Airbnb groups on Facebook.&lt;/p&gt;</description></item><item><title>Docker for data science @ HelloFresh Berlin</title><link>https://maxhalford.github.io/blog/docker-for-data-science/</link><pubDate>Thu, 01 Jun 2017 00:00:00 +0000</pubDate><author>maxhalford25@gmail.com (Max Halford)</author><guid>https://maxhalford.github.io/blog/docker-for-data-science/</guid><description/></item><item><title>Predire la disponibilité des Velib' @ Toulouse Data Science Meetup</title><link>https://maxhalford.github.io/blog/forecasting-bicycle-sharing-usage/</link><pubDate>Wed, 30 Mar 2016 00:00:00 +0000</pubDate><author>maxhalford25@gmail.com (Max Halford)</author><guid>https://maxhalford.github.io/blog/forecasting-bicycle-sharing-usage/</guid><description/></item></channel></rss>