<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Arthur Moreau on Medium]]></title>
        <description><![CDATA[Stories by Arthur Moreau on Medium]]></description>
        <link>https://medium.com/@arthur-s-moreau?source=rss-98606cfc84a0------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/2*MGuekVTP-O9oAPdVrqKw2w.png</url>
            <title>Stories by Arthur Moreau on Medium</title>
            <link>https://medium.com/@arthur-s-moreau?source=rss-98606cfc84a0------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 03 Dec 2026 14:50:49 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@arthur-s-moreau/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[If data is petrol…]]></title>
            <link>https://medium.com/geekculture/if-data-is-petrol-a4358b3f2038?source=rss-98606cfc84a0------2</link>
            <guid isPermaLink="false">https://medium.com/p/a4358b3f2038</guid>
            <category><![CDATA[big-data]]></category>
            <category><![CDATA[data-analysis]]></category>
            <category><![CDATA[data]]></category>
            <category><![CDATA[data-engineering]]></category>
            <category><![CDATA[data-science]]></category>
            <dc:creator><![CDATA[Arthur Moreau]]></dc:creator>
            <pubDate>Wed, 26 May 2021 07:14:54 GMT</pubDate>
            <atom:updated>2021-05-26T13:28:26.216Z</atom:updated>
            <content:encoded><![CDATA[<p><strong><em>Data is the new gold. But most of us don’t understand how and why it has been tagged as priceless by big tech companies. Here is a simple oil metaphor explaining how data works and why it is the new black gold.</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Mny74R1gSR1MvBrZRWGTfg.jpeg" /><figcaption>Data is the new black gold. Image by author</figcaption></figure><h3>It flows from its source to our engines</h3><p>Like petrol, data is buried. Under layers of ground, lays the crude oil that humans need to extract. And it is the same for raw data, buried under technological layers. These pockets of valuable commodities are called sources. Petrol has many different kinds of sources, and the data ones are just as diverse. Data can originate, for instance, from the clicks and taps of website users. These generate data flows.</p><p>Both, to be extracted from their sources, require human efforts. Data, as petrol, is invisible until captured. Where petrol is extracted by huge pumps, data is captured by tiny snippets of code.</p><p>The crude oil going out of the source is mostly captured and conveyed by pipelines. These pipelines lead the oil to a refinery, where it is transformed in gasoline, fuels and other by-products. Once the crude oil is refined the liquid outputs, gasoline and diesel fuels are brought to storage places. The rest of the by-products, all sorts of raw plastics, are sold on the market.</p><p>Like crude oil, raw data is brought by pipeline to a transformation place, the Data Warehouse, then stored in a place called a Database. These steps, for data, are known as ETL: Extract-Transform-Load. Indeed the raw data is extracted from the source, transformed into clean data and then loaded in a Database storage. The by-products of data, statistics and aggregation, can also be sold on Data Marketplaces.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-98F-Y-ahGsd2j0zYt4ddg.jpeg" /><figcaption>Data refinery. Image by author</figcaption></figure><p>In these oil storages, some analysts will collect metrics about the petrol — such as quantity, pressure and composition — using powerful tools and subsequently compile them in quality reports. These reports are sent to the head of Engineer who will use it to control and improve the oil flows.</p><p>On a data level, this analysis of the metrics is called Data Analysis. It is captured in excel or Dashboards that are delivered to the management team. Thanks to the up-to-date graphs constantly refreshing with hourly data, the management can get insights to steer the business.</p><p>Back to our petrol, after the storage phase most of the fuels make their way to tank stations and then cars. Cars empowers humans to move. Likewise, data goes from a Database via a distributing system to feed our smartphones and apps. Smartphones empower humans to create and discover. Airbnb uses data to make you discover a city map and its remaining rentals. Snapchat uses data to help you create filters.</p><p>Additionally, a big portion of the gasoline and plastic goes to different industries. The fuels power industrial machines which, molding plastic into different shapes, create products to serve society. In the data version, data goes and flows in every department of the company owning it. For instance, the operational department uses the location and logistic data to deliver purchased products to the right address.</p><p>Fuels also go to Research &amp; Development industries. Companies in these industries are building powerful machines that can automate human work, or make it more efficient. Aeroplanes can move humans faster and further thanks to their complex engines — the result of years of work within the Research &amp; Development industries.. On the data side, this is called Data Science. Scientists experiment to find which algorithm will make the product or process more efficient: the machine does the heavy lifting. But as a plane still needs a pilot, sometimes the algorithm needs a human-in-the-loop to prevent potentially wild and unexpected behavior.</p><h3>The humans behind the curtain</h3><p>There are many jobs to keep the petrol flowing through the pipelines. Once a source has been found, a whole team will install the pump to extract the crude oil out of its cave. Regarding data, it is mostly the Software Engineer or IT team that will do the job of placing the tracking on a website or an app.</p><p>Then the oil goes off the pipe! There an engineer will be installing the whole pipeline network. This big scale work requires thoughtful planning and intense maintenance. This Installation Engineer is, on the numerical side, known as a Data Engineer. They build the pipeline during the whole trajectory of the data from the data source to the app.</p><p>The refined oil next enters storage and its metrics are examined. In the data realm that is the job of a Data Analyst. Their role is to explore the data and aggregate them in graphs or reports in order to bring concise insights. Indeed proper visualizations help the human brain (i.e. the decision makers) to understand the trends and act on them. A manager reading a graph that clearly displays expenditure can reallocate budget more easily than when given a long thread of excel sheets.</p><p>If the company reaches a certain size, this analyst is split into two sub-analysts. One, liking numbers, measuring the petrol pressure and the other, strong in communication skills, being the translator between the management needs and the metrics to be looked at. This would, in the data term, be the number-loving Data Analyst and the outspoken Business Analyst.</p><p>Established oil refineries have all the tools in place and the head of Oil Engineering knows how to read the thermometer. Still, every day, there is an engineer working on new requests such as installing more accurate thermometers or documenting how it measures heat. Similarly, in a company that is experienced working with data, every plots their graphs with access to readily analyzable data. The person behind the curtain taking care of maintaining the one source of data truth is the<a href="https://blog.getdbt.com/what-is-an-analytics-engineer/"> Analytics Engineer</a>.</p><p>Then at last comes the Scientist of the R&amp;D department. These guys also need hectoliters of oil to run their machines. Think about the plane. They need years of trials to build and develop new machines. But when they succeed, their work expands the boundaries of society by creating new opportunities. In the data world, these are the Data Scientists. They are the ones playing with data to create algorithms for the purpose of widening human possibilities.</p><p>But think about this for a moment: in order to make petrol 95–99% pure, mankind had to work to refine its transformation process. Nowadays, thanks to decades of research, we know the standard process to reach 99% purity without much trial-and-error. Data does not have these decades of research. Consequently, the field does not have the standardized steps to make an algorithm 99% accurate at first try. That is why we have Machine Learning Engineers. They are the ones iteratively pushing the accuracy from 80% towards the 99%.</p><h3>Concluding thoughts</h3><p>Both petrol and data ranges are the high-risk/high-potential assets of mankind. Cars, as well as smartphones, are part of the inventions that shaped human history. Everyone is better off with them, but with their uses came abuses. Abuses called Global Warming and Cambridge Analytica.</p><p>Whereas <a href="https://www.esso.ca/en-ca/fuel-journey">petrol’s journey</a> and the threats of CO2 emission are well understood, the journey and threats coming from data are still nascent. We do not yet know the full extent of abuses that can stem from data extraction. But we do know that, as much as the fuel in our rockets, data is mankind’s newest route to reaching new moons.</p><p>Thank you for reading my article! If you loved reading it as much as I loved writing it, please don’t hesitate to have a look at my <a href="https://arthurmoreau.com/">“data meets marketing” blog</a>, where it was originally published.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a4358b3f2038" width="1" height="1" alt=""><hr><p><a href="https://medium.com/geekculture/if-data-is-petrol-a4358b3f2038">If data is petrol…</a> was originally published in <a href="https://medium.com/geekculture">Geek Culture</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Data-driven customer segmentation: how-to with Excel]]></title>
            <link>https://arthur-s-moreau.medium.com/data-driven-customer-segmentation-how-to-with-excel-5efaea70c98?source=rss-98606cfc84a0------2</link>
            <guid isPermaLink="false">https://medium.com/p/5efaea70c98</guid>
            <category><![CDATA[excel]]></category>
            <category><![CDATA[customer-segmentation]]></category>
            <category><![CDATA[marketing]]></category>
            <category><![CDATA[rfm-analysis]]></category>
            <category><![CDATA[data-driven-marketing]]></category>
            <dc:creator><![CDATA[Arthur Moreau]]></dc:creator>
            <pubDate>Thu, 11 Feb 2021 21:59:47 GMT</pubDate>
            <atom:updated>2021-02-15T21:40:26.891Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/603/1*sRz8iRyuCwn-kiAo02-EWw.png" /><figcaption>A colorful example of the final results, in amount of customers</figcaption></figure><p><em>Step-by-step guide to create an actionable data-driven customer segmentation and analyze it by using only with excel or Google sheet.</em> <em>To complete this tutorial, you need data about customer, the time and the amount of their purchases</em> <em>and a good 15 minutes of focus.</em></p><p>Customer segmentation is a crucial information for marketers. Indeed, difficult to make individual communication as soon as you have more than 20 customers, and even harder to spot your best customers in one blink.</p><p>Interestingly enough, the method to do customer segmentation differs widely from one industry to another. In the marketing world, it will often boil down to a post-it session coupled with gut instincts. But from my experience, it doesn’t create insights that are not actionable in day-to-day operations.</p><p>On the other hand, the academic world has, <a href="https://www.sciencedirect.com/science/article/pii/S1877050910003868">since more than 10 years</a>, <a href="https://www.sciencedirect.com/science/article/pii/S1877050910003868">covered data-driven</a> <a href="https://link.springer.com/article/10.1057/dbm.2012.17">segmentation methods</a>. The most known segmentation is the <em>RFM analysis</em>, a classic case-study for young data apprentice, but almost unknown from the top marketing experts.</p><p>So I decided to break the wall between these two silos and create a data-driven method using a tool that the marketers master as much as the data guys: Excel.</p><p>Excel is far to be my favorite tool, but it stays the most used tool for data analytics in the world. As data scientist I challenged myself to walk in the shoes of the marketer by using only Excel, where I would usually use other tools.</p><p>What I though would have been a stroll, was actually a stroll with a twisted ankle through a jungle forest. But now, the path is laid and signposted so following it will indeed be a stroll.</p><p>I will here work with Shopify data but the steps are the same for every e-commerce platform. Arm yourself with an excel, and let’s dive into this 15 minutes stroll.</p><p>Here are the steps:</p><ol><li>Import data</li><li>Clean data</li><li>Merge data</li><li>Transform data</li><li>Plot data</li><li>Analysis</li><li>BONUS: Going further with Machine learning</li></ol><h3>1. Import data</h3><p>Before starting importing the data, it’s important to know what we need. Our goal is to create one RFM profile per user. RFM stands for:</p><ul><li>Recency: when did they buy last</li><li>Frequency: how many orders did they make</li><li>Monetary: How much money did they spend in total</li></ul><p>By compiling these 3 characteristic for each user, we can easily segment them. Now let’s fetch the data we need for this analysis. Importing the right data is an easy and well documented step. For instance, <a href="https://help.shopify.com/en/manual/orders/export-orders">Shopify helps you to download a CSV of your orders and customers.</a> And <a href="https://nl.wordpress.org/plugins/order-import-export-for-woocommerce/">Woocommerce allows it with plugins</a>.</p><p>While creating the export, it’s important to have the following data:</p><p>In the customer file:</p><ul><li>customer_id or id</li><li>order_count</li><li>total_spent (or, for other platform than Shopify, the sum of every euro spent)</li></ul><p>In the order file:</p><ul><li>customer_id</li><li>order_date</li></ul><p>Now we need to put this CSV in a classic Excel format. This can be done easily in Excel and Google Sheet:</p><ul><li>Excel: Data &gt; import CSV</li><li>Google sheet: Open with Google sheet. If you see only rows and one column, Data &gt; split text into columns</li></ul><h3>2. Cleaning data</h3><p>This very important step will avoid have cluttered data and “bad” data. We will perform the same in the two separates sheets.</p><p>First of all, just put the data files in two sheets of one excel. This will greatly simplify the work. So we should have two sheets:</p><ul><li>the “FM” (for Frequency and Monetary) sheet with customer_id, order_count and total_spent</li><li>the “R” (for Recency) with order sheet with customer-id and order_date.</li></ul><h3>2.1 Getting rid of the clutter</h3><p>For the sake of the exercise, we will start by uncluttering the two sheets. Simply open the excel and remove all the columns to only keep:</p><p>For the sake of the simplicity, let’s remove discount, taxes and shipping columns as they are already included in total_spent.</p><p>Be certain that the customer_id is properly linked to the right person. To do so, have a list customer_id and name on the side (for instance, a shopify tab open in the browser) and cross-check to avoid using another id (such as order_id).</p><p>After removing the unnecessary columns, we will remove the missing data:</p><figure><img alt="Sorting ascending and descending in excel" src="https://cdn-images-1.medium.com/max/242/0*UNylrmA4CPCaaO9n.png" /><figcaption>Sorting ascending and descending in excel</figcaption></figure><figure><img alt="The equivalent sorting in Google Sheet" src="https://cdn-images-1.medium.com/max/325/0*96VF3m0Wx3T-wabZ.png" /><figcaption>The equivalent sorting in Google Sheet</figcaption></figure><ul><li>Press A -&gt; Z and Z-&gt;A in each column to make the empty cells appears on top.</li><li>For each columns decide to remove the empty cells/outliers.</li></ul><p>By simply performing this sort ascending/descending, we will unveil the extreme lows and highs. This already gives very valuable business insights. For instance, in my case I quickly realized that:</p><ul><li>We lost money (negative total_spent) on 0.2% of the clients. It’s a marginal amount so I will just delete these rows.</li><li>6.3% of the clients paid 0. That’s to be remove too. It’s worth keeping in mind to re-target them, but let’s keep that out of this analysis.</li><li>0.06% had zero order, but had still paid some money. That’s probably interesting to raise in the team. But again, it’s out of the analysis so I removed it.</li><li>Also, I got rid of your team members. Check in Shopify their customer number and remove them from the list, as it was probably test orders.</li><li>I found one outlier who was 450 times the average order price. I double checked to verify that it was not a mistake but not, it was well a real client.</li></ul><h3>2.2 First data transformation</h3><h4>2.2.1. Recency</h4><p>We’ll first take care of the the 2nd sheet: Recency. Our goal is to transform it and have as results two columns: the customer_id and the date of their last order. In other words, how recently they bought.</p><p><strong>A. Change data type</strong></p><p>At first we will change the data type from number to date. In order to do so start by freezing the first row, that will make the work easier (View&gt;freeze first row)</p><figure><img alt="Excel Freeze function" src="https://cdn-images-1.medium.com/max/363/0*-o8bC5-6Cmmh2hzb.png" /><figcaption>Excel Freeze</figcaption></figure><figure><img alt="Google sheet freeze function" src="https://cdn-images-1.medium.com/max/577/0*78EyTf2HjYhGENBW.png" /><figcaption>Google sheet freeze</figcaption></figure><p>Then we have a small hiccups: Shopify write the data with a +0000 representing the hour offset. For our exercise we will just keep year, month and date, so we need to get rid of it. To remove it use Data&gt; split text to column (detect automatically) to remove the +0000 and the hour.</p><figure><img alt="Excel: text to column" src="https://cdn-images-1.medium.com/max/542/0*uS74DutUMxpTRIsM.png" /><figcaption>Excel: text to column</figcaption></figure><figure><img alt="Google sheet: Split text to column" src="https://cdn-images-1.medium.com/max/325/0*VMqFb47RsqAb_qai.png" /><figcaption>Google sheet: Split text to column</figcaption></figure><figure><img alt="Excel split with space" src="https://cdn-images-1.medium.com/max/342/0*zZQ-nX1rGqoF5ZIe.png" /><figcaption>Excel split with space</figcaption></figure><p>Once this is done, it’s really easy to change the format year-month-day in date format.</p><figure><img alt="In excel’s top ribbon, tab Home, you can change the data format" src="https://cdn-images-1.medium.com/max/309/0*LInl1CDrmEuBttF6.png" /><figcaption>In excel’s top ribbon, tab Home, you can change the data format</figcaption></figure><figure><img alt="Google sheet change format" src="https://cdn-images-1.medium.com/max/646/0*BV26AjOMEJetnRUR.png" /><figcaption>Google sheet change format</figcaption></figure><p><strong>B. Sorting max order</strong></p><p>We will have to create a pivot table for this. Let’s start by select all data. Then press Data&gt;pivot table. We’ll make it in a new sheet</p><figure><img alt="Excel: pivot" src="https://cdn-images-1.medium.com/max/372/0*4-2DiD0SEmFAJTdG.png" /><figcaption>Excel: pivot</figcaption></figure><figure><img alt="Google sheet: Let’s create a pivot table" src="https://cdn-images-1.medium.com/max/321/0*Wg-PpJvm-K3FHXpZ.png" /><figcaption>Google sheet: Let’s create a pivot table</figcaption></figure><p>A pivot table is a table of statistics that summarizes the data. Concretely, we have now all the date of all orders, but just want the latest date per customer.</p><p>For excel, those are two simple steps:</p><figure><img alt="Excel step 1" src="https://cdn-images-1.medium.com/max/230/0*hDyYtiRzznj6LGSh.png" /><figcaption>Excel step 1</figcaption></figure><figure><img alt="Excel step 2" src="https://cdn-images-1.medium.com/max/418/0*qvBF3vsryyY58G5w.png" /><figcaption>Excel step 2</figcaption></figure><p>And for the Google Sheet users, it’s a bit more complex:</p><figure><img alt="First click on Created_at" src="https://cdn-images-1.medium.com/max/290/0*2wEvfemjBBk9vgJO.png" /><figcaption>First click on Created_at</figcaption></figure><figure><img alt="Then summarized by max" src="https://cdn-images-1.medium.com/max/282/0*irMwje6mogSPRnE6.png" /><figcaption>Then summarized by max</figcaption></figure><figure><img alt="This is what you see if you have more than 50 000 customers" src="https://cdn-images-1.medium.com/max/431/0*OviIxaT8lCTxkhcZ.png" /><figcaption>This is what you see if you have more than 50 000 customers</figcaption></figure><p>When we create our pivot table, a panel will appear on the left. We need to format our pivot as follow: <br>- Row: add &gt; customer_id</p><p>For the value is will be slightly harder. We need to have the latest date, or in numerical language, the max date.<br>- Value: max(created_at)</p><p>In case you have more than 50 000 customers, you will see this appearing.</p><p>No big deal. Just scroll until the bottom of the excel sheet and click “add x more rows” depending on the amount of customers.</p><p>And now we see, on the excel or Google Sheet, a date for each user. This is the date of their last order. Congratulations, you have already very valuable information as such! You getting closer to your data-driven customer segmentation.</p><h3>3. Merging the sheets</h3><p>Our final goal is to have one sheet with the 3 dimensions R, F &amp; M per customer. In this step, we will merge all data in one sheet, which requires something slightly more complex that a simple copy-paste.</p><p>Going back to our Recency sheet, we want to get rid of the formula attached to the cells and just work with the values. A simple way to do so is to copy your whole value and then paste the values only. Copy the values in a new sheet and call it “R_values”; it will help us later.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/515/0*uyoAoERv8jC51Yum.png" /><figcaption>Paste value only in Excel</figcaption></figure><figure><img alt="Pasting the values only in Google Sheet" src="https://cdn-images-1.medium.com/max/631/0*_vAoeQOgT71GQhym.png" /><figcaption>Pasting the values only in Google Sheet</figcaption></figure><p>Now we want to merge these two sheets that we have. The great thing is that in both sheet, the “RM” and “F”, we have a customer_id. That’s what we will use as anchor with the VLOOKUP formula.</p><p>We will write this formula in the second cell (as the first cell if for the name of the column) of the 4th column of our customer sheet. It goes as such:</p><pre>= VLOOKUP(A2,R_values!A:B,2)</pre><p>Out of this formula, if you followed the previous steps, don’t have to change anything. Still here what the arguments mean, in order:</p><ol><li><strong>A2</strong> = my first variable (=the first customer_id)</li><li><strong>R_values</strong> = the sheet where we pasted the value from the pivot table. It is followed by<strong>!A:B</strong> which means that we take the 2 first columns.</li><li><strong>2</strong> = the index (= the name of the column of the value to pick, here it’s 2 as the 2nd is the one with the date of the latest order).</li></ol><p>And after we did it for one cell, we just need to double-click on the corner of the cell to extend it for all cell of the column.</p><figure><img alt="Double click on the big blue square to extend the formula." src="https://cdn-images-1.medium.com/max/111/0*bdztOPqLpuO7hTst.png" /><figcaption>Double click on the big blue square to extend the formula.</figcaption></figure><p>All rigth we are all set! We have now one beautiful clean sheet with 4 columns: the customer_id, the order_count, the total_spent and the last one that I named “latest_order”. We are reaching the end.</p><figure><img alt="Your final result should look like that" src="https://cdn-images-1.medium.com/max/633/0*H0eAer0NX-Z6qPDo.png" /><figcaption>Your final result should look like that</figcaption></figure><h3>4. Transforming the data</h3><p>Remember that the goal is to give 3 score per user:</p><ul><li>Monetary score: how much they paid</li><li>Recency score: how recently did they purchase</li><li>Frequency score: how many order did they do</li></ul><p>But this scores, unless grouped together, will stay individual characteristics and not actionable segments. So we will need to create brackets of score and merge them to create a handful a customer segments.</p><h3>4.1 Recency groups</h3><p>We have the date of the latest order, and want to transform that in a score. We will thus convert the latest date in a column representing the amount of day since last order.</p><p>It’s a very simple manipulation: we create a 5th column “Amount of day” where we write in the second cell (starting from the top):</p><p>D2 is here the first cell of the last_order column. We right click on the bottom right corner of the cell to extend it and here were are! Furthermore, we will create 3 clusters of users:</p><ul><li>Recent: if they purchased in the last 3 months</li><li>Former: if they purchased between 3 and 12 months ago</li><li>Past: if they purchased more than a year ago</li></ul><p>Simply paste the following in the 6th column “Recency segments”:</p><pre>= IF(E2 &lt;= 90, &quot;Recent&quot;, IF(AND(E2 &gt; 90, E2 &lt; 365), &quot;Former&quot;, &quot;Past&quot;))</pre><p>Small note for data about EU citizens: After 365 days, it’s even worth looking whether you can still contact them, as the GDPR might prevent you to do so.</p><h3>4.2 Frequency groups</h3><p>As we did for recency, we will create groups of users for the Frequency:</p><ul><li>One-time: if they purchased once</li><li>Repeating: Between 1 and 3 purchases</li><li>Recurring: Above 3 purchases</li></ul><pre>= IF(B2 = 1, &quot;One-time&quot;, IF(AND(B2 &gt; 1, B2 &lt;= 3), &quot;Repeating&quot;, &quot;Recurring&quot;))</pre><p>Just take care to verify that the column B is well the one for ORDERS_COUNTS and that you cleaned well the customers with 0 purchases.</p><h3>4.3 Monetary groups</h3><p>This section will highly depends on the products your are selling. Whether you are selling a unique items or a collection will create huge differences. As such it’s up to you to decide what the categories are. Here is an example:</p><pre>= IF(B2 &lt;= 10, &quot;Small buyer&quot;, IF(AND(B2 &gt; 10, B2 &lt;= 50), &quot;Convinced user&quot;, &quot;Top customer&quot;))</pre><h3>4.4 Pivot: From individual score to grouped view</h3><p>The next step is to transform this individual data in a grouped view. As we don’t need the individual data per customer but well the aggregation of the different groups, we will sort it out with another pivot.</p><p>It’s up to your business choice to create a pivot table using Recency on one side and with Frequency or Monetary on the other (or both one after the other). Unfortunately Excel and Google sheet don’t allow 3 dimensions graphs, so we can’t plot R, F &amp; M in one graph. I would recommend to use Recency and Frequency as they are more actionable.</p><p>Here are the settings you need to use:</p><figure><img alt="Excel: how to pivot" src="https://cdn-images-1.medium.com/max/294/0*oWKeqeomoJyMPz8n.png" /><figcaption>Excel: how to pivot</figcaption></figure><figure><img alt="Google sheet: this is your input for the pivot" src="https://cdn-images-1.medium.com/max/350/0*dI5ZhySG2Vj-xQw0.png" /><figcaption>Google sheet: this is your input for the pivot</figcaption></figure><p>I personally like very much to have values only. It allows to work on the data without risking that a change will wreck our calculation. So once I have all this values from the pivot, I copy-pasted (values only) it in a last sheet called “Final results”.</p><h3>5. Plotting the data</h3><p>We are now at the very exciting moment where you can see the reality hiding behind the numbers! Our final sheets has a 3×3 grid looking as such:</p><figure><img alt="Finally our data-driven customer segmentation appears!" src="https://cdn-images-1.medium.com/max/377/0*zHDRXYISK7Mgotyh.png" /><figcaption>Finally our data-driven customer segmentation appears!</figcaption></figure><p>And Voila! here is our graph plotting our customer segmentation! Playing a bit with the graph parameters will give you such a picture.</p><figure><img alt="A colorful data-drive customer segmentation ready for actions!" src="https://cdn-images-1.medium.com/max/603/0*JPp0XQOe6seV_M1M.png" /><figcaption>A colorful data-drive customer segmentation ready for actions!</figcaption></figure><p>Note: I will pretend that I made this graph by plotting our data when in reality I colored the background and typed my answer in. But who would see the difference right?</p><h3>6. Analysis</h3><p>Now what does this beautiful graph says?</p><p><em>Red alert:</em> There 24 customers that you need to call now! If they leave the boat, that’s the bottom line who will drown.</p><p><em>Loyal:</em> There are 6 persons which you may want to send a business present (pick a random occasion for it), but don’t seem to require more attention.</p><p><em>Sleeper:</em> 483, that’s the amount of email with coupon that you will send. And hopefully you can bring them back in the promising group.</p><p><em>Promising:</em> These 232, they are just to be watched. And why not sending a small emails with news time to time.</p><p><em>One time buyer:</em> From the 4890 ones who gave their email consent, send them love! And why not a bit a retargeting, they will be cheaper to reconvert that new users anyway.</p><h3>7. BONUS: going further with machine learning</h3><p>I have touch quickly on what excel cannot do. For instance a 3D graph, or a clustering of more than two dimensions. Here they are:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/597/0*KsI904wERPeuvOtm.png" /></figure><p>This beautiful above example shows what Machine Learning can do for marketing! You can see here the 5 groups of users, split by the algorithm and plotted on a 3D graph. Great Data Scientists cover <a href="https://towardsdatascience.com/data-driven-growth-with-python-part-2-customer-segmentation-5c019d150444">this (more technical) project already</a>, in case you feel like coding it through.</p><p>Why is that so much more exciting? Because of the new insights! Look at the red groups of users, who bought recently for little money VS the yellows which are the users to be kept at all costs! Difficult to have a more actionable data-driven customer segmentation, you just have to define 5 ways to approach this groups!</p><p>I hope you had as much pleasure doing this exercise as I had to create it and write it down. <br>If you are interested in more articles in the topic of “Data for Growth”, don’t hesitate to register to my <a href="http://arthurmoreau.com/">newsletter</a>.<br>If you would like to work with me don’t hesitate to contact me on <a href="https://www.linkedin.com/in/arthur-moreau-data-driven/">Linkedin</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5efaea70c98" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Forecasting web traffic with Python and Google Analytics]]></title>
            <link>https://medium.com/data-science/forecasting-web-traffic-with-python-and-google-analytics-fb066659ae8f?source=rss-98606cfc84a0------2</link>
            <guid isPermaLink="false">https://medium.com/p/fb066659ae8f</guid>
            <category><![CDATA[forecasting-models]]></category>
            <category><![CDATA[hands-on-tutorials]]></category>
            <category><![CDATA[api]]></category>
            <category><![CDATA[google-analytics]]></category>
            <category><![CDATA[python]]></category>
            <dc:creator><![CDATA[Arthur Moreau]]></dc:creator>
            <pubDate>Thu, 15 Oct 2020 16:06:51 GMT</pubDate>
            <atom:updated>2020-12-04T18:08:41.983Z</atom:updated>
            <content:encoded><![CDATA[<h4><a href="https://towardsdatascience.com/tagged/hands-on-tutorials">Hands-on Tutorials</a></h4><h4>Showing the future to business managers: A step-by-step to create a time series prediction of your web traffic plotted as a GIF.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*j8LjgYr1r1xPrJkr.gif" /><figcaption>The end result: a beautiful graph plotting how bad will my December’s traffic be.</figcaption></figure><p>SolarPanelCompany decided to hire their first Data Scientist: me. I was quite excited by the challenge of having to build everything from scratch. My goal was to get a first quick win to show my value to the team.</p><p>In the first week, a marketing manager came to your desk panicking: “Look!” he says by pointing at the screen of his laptop “On Google Analytics, I see our traffic went down during the last month! Can your Prediction Data Learning stuff do something to save the business?”.</p><p>“Alright,” I think “that’s not the real question here.” So I rephrase: “Are you asking me to show whether we have a downwards trend or just a seasonal effect?”. He stares blankly. “Are you asking me to verify when we can hope that it will go back upwards? — Yes! Exactly that! I have a meeting with the Marketing Director tomorrow. I let you work on that!”</p><p>If this situation happened to you, or if you want to create the visual forecasting of your own web traffic, you are on the right page! Here is the <strong>step-by-step guide</strong> to creating a prediction of the number of visitors to your website based on your Google Analytics data and, as a bonus, make it a likable GIF for the business guys. In short, we’ll create a time series model with the Prophet package.</p><p>This guide includes 3 steps:</p><ol><li>Calling your Google Analytics API data with Python</li><li>Building your model with Prophet</li><li>Creating a GIF of your prediction (because it’s fun)</li></ol><h3>1. Connecting to your Google Analytics API</h3><p><em>Needed for this step: admin right to a Google Analytics account</em>.<em> If you don’t have any, you can use a </em><a href="https://support.google.com/analytics/answer/6367342?hl=en"><em>demo Google Analytics account</em></a><em> and simply import the data in a csv.</em></p><p>This not an easy step, but Google created a lot of documentation to help you go through. I will here present the step-by-step guide to fetch the traffic. If you are interested in other metrics (such as goals, pageviews, etc.) you need to have a look in the extensive official <a href="https://developers.google.com/analytics/devguides/config/mgmt/v3">Google’s Management API documentation</a>.</p><p>Let’s import our packages:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/cf4e29c32f642e44408f79a9a271d4f1/href">https://medium.com/media/cf4e29c32f642e44408f79a9a271d4f1/href</a></iframe><p>The first package is our eternal friend Pandas. The two last package are from Google and allow you to call the Google Analytics API.</p><p>If you don’t have access to the Google API yet, you need to activate that on your side. The below videos explains all the steps to do so.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FXpx--7g6FKk%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DXpx--7g6FKk&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FXpx--7g6FKk%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/e6bdd0fff313e8cbcb2799e06cbb79b7/href">https://medium.com/media/e6bdd0fff313e8cbcb2799e06cbb79b7/href</a></iframe><p>So let’s start the fun. Our first piece of code is calling the key and the right view. Note that the view number can be found in your Google Analytics account under “setting&gt;view”</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/12d70251c749179e85cfb3cc584e56d4/href">https://medium.com/media/12d70251c749179e85cfb3cc584e56d4/href</a></iframe><p>In the above part, the first line doesn’t change, but the 2nd and the 3rd have to be changed with your own access keys.</p><p>Now we will use the code from Google API’s documentation. If you don’t understand it all, it doesn’t matter: copy-pasting it will do the job if you modified properly the paragraph above.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/60391c2b8749dbea47f4635f84081d02/href">https://medium.com/media/60391c2b8749dbea47f4635f84081d02/href</a></iframe><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/1a31bac2f8831fb779a03e949c839bf4/href">https://medium.com/media/1a31bac2f8831fb779a03e949c839bf4/href</a></iframe><p>We can see above the mention ‘metrics’. On my side, as I wanted to do a time series, I cared only about the traffic dimension but also imported the Pageviews for later analysis.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/1083baad04b748ed2fab6eb1a86b7e45/href">https://medium.com/media/1083baad04b748ed2fab6eb1a86b7e45/href</a></iframe><p>These block of codes are the standard ones given by Google for people willing to fetch their data.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/c8ca061bab19997350eb364febe6a826/href">https://medium.com/media/c8ca061bab19997350eb364febe6a826/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/265/0*yUzRcnnvt7EspsaM.png" /></figure><p>Ok right, now you have your data in the DataFrame dfanalytics. Congratulations! you successfully called the Google API, the first step is achieved.</p><h3>2. Forecasting your web traffic</h3><p>So we have the data. It took already a bit of time but now is the fun part: predicting the web traffic of SolarPanelCompany.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*LrmEWlpZ5BWCIm6N" /><figcaption>Photo by <a href="https://unsplash.com/@mwilson078?utm_source=medium&amp;utm_medium=referral">MICHAEL WILSON</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>To start this forecasting of the Google Analytics traffic, we need to start importing our packages. We will use Facebook’s Prophet here. This great tool is super easy to use as it uses the same syntax as the package scikit. Facebook themselves use them for all their time series forecast, be it for web traffic or other.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/f257301a2e1400dddf853ee880189e8a/href">https://medium.com/media/f257301a2e1400dddf853ee880189e8a/href</a></iframe><p>Let’s first explore a bit and check how our data is doing. A simple plot does the job.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/120b3566d6e1b1c0f94b2c36a25a26f9/href">https://medium.com/media/120b3566d6e1b1c0f94b2c36a25a26f9/href</a></iframe><figure><img alt="Web traffic of the solar panel company plotted." src="https://cdn-images-1.medium.com/max/965/0*MuxDZPabURgxBA6R.png" /></figure><p>We can already see a strong seasonality in the data. Indeed, this is the data about solar panels. The seasonality is thus expected: it grows smoothly from February to July, as the sun get more and more intense. Then, in August people know it’s too late to enjoy the sun and the line goes down.</p><p>Back to our code, let’s check what the prophet has to say. Facebook’s prophet requires you to change the name your two columns:</p><ul><li>the <strong>value</strong> column needs to be called <strong>‘y’</strong></li><li>the <strong>timestamp</strong> needs to be <strong>‘ds’</strong> and be a DateTime variable.</li></ul><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/66a2cd70a7d8ad6642ccf33e880c7f31/href">https://medium.com/media/66a2cd70a7d8ad6642ccf33e880c7f31/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/119/0*3qRrUtXh_1i7tuJ8.png" /></figure><h4>2.1 Missing data</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/965/0*jAgBb6RcE6KEfbfa.png" /></figure><p>Although Facebook claims that Prophet is well resistant against missing data and outliers, it’s never bad to get rid of them. Especially in our case: let’s say that the tracking of the website crashed for one day or two, you don’t want this to influence.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/f71db5304a2de3a77f01224f218bfa37/href">https://medium.com/media/f71db5304a2de3a77f01224f218bfa37/href</a></iframe><p>If you have some missing data, as I had, you will input them in a new DataFrame. You also need to assign a value to it. I personally used the 7 days moving average.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/06380576c8df3447db971f2960b2fc03/href">https://medium.com/media/06380576c8df3447db971f2960b2fc03/href</a></iframe><p>Then we concat the frameworks together and put a cap and a floor. The floor is “0” as you know you won’t have negative traffic. On the other hand, the cap is purely “human-in-the-loop” work, so based on your good judgment. This cap and floor will help create the boundaries of the model.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/525e7d0f681005d8f85037b467b9699b/href">https://medium.com/media/525e7d0f681005d8f85037b467b9699b/href</a></iframe><h4>2.2 EDA</h4><p>That will be quick as we don’t have so much features; only the value of the observation itself.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/2c9c7f79dec53aa32bacbdb976d67f76/href">https://medium.com/media/2c9c7f79dec53aa32bacbdb976d67f76/href</a></iframe><figure><img alt="Web traffic ready for forecasting: the missing data have been replaced" src="https://cdn-images-1.medium.com/max/1024/0*lZyAojcmeLcxTm0J.png" /></figure><p>We see that there are no more outliers that the missing data, we can keep on.</p><h4>2.3 Forecasting our web traffic: the training</h4><p>Training the model with Prophet is really easy. The team copied the mechanism used is scikit packages: .fit() and .predict()</p><h4>2.3.1 Creating a model</h4><p>So first we create the model. There are numerous variations that can be added. I will explain my choices below.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/84db5b4f387958775f8057731d39fd2f/href">https://medium.com/media/84db5b4f387958775f8057731d39fd2f/href</a></iframe><ul><li>Changepoint_prior_scale: to cope with the underfitting. Increasing makes the trends more flexible (so visually broadening the end funnel)</li><li>Changepoint_range: By default, Prophet changes the slope of the trend only of the first 80% of the data. I here set 0.9 for it to include 90% of the data.</li><li>seasonality_mode=’multiplicative’ as parameters, because the seasonality grows in influence. We clearly see that our business is growing following a multiplicative trend and not a linear one.</li><li>yearly.seasonality = 20. It was 10 but I want more. This number represents <a href="https://en.wikipedia.org/wiki/Fourier_transform">Fourier’s Order</a>.</li></ul><p>If you want to adapt your model under different criteria, I recommend have a look in the <a href="https://facebook.github.io/prophet/">Facebook’s Prophet Github.</a></p><h4>2.3.2 Building the forecast timestamp set.</h4><p>Until now, we have trained our model on our previous data. In order to forecast future web traffic, we first need to create future timestamps. Here I will create 60 days, so two months in the future.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/edf1f19a7187c8030bc4a0845f74a539/href">https://medium.com/media/edf1f19a7187c8030bc4a0845f74a539/href</a></iframe><h4>2.3.3 Predicting the future</h4><p>Here we go. In the next two lines, we will finally forecast our website traffic from Google Analytics.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/3ae81c0437a704385b3529e328af68f4/href">https://medium.com/media/3ae81c0437a704385b3529e328af68f4/href</a></iframe><figure><img alt="Forecasted web traffic. The light blue part is the forecast." src="https://cdn-images-1.medium.com/max/712/0*5PWGA7VS1KL9-a0y.png" /></figure><p>And Voilà! We can see the beauty of my traffic jumping off the cliff in November and December.</p><h4>2.3.4 Analyzing components</h4><p>Now Prophet has another great function: it can show the different components in a graph.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/7b734d21d688cd22a07040b3473e9ab7/href">https://medium.com/media/7b734d21d688cd22a07040b3473e9ab7/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/0*XZgiH1LP0puoxOQH.png" /></figure><p>There are already some interesting conclusions:</p><ul><li>The overall trend show a decline. This is to be taken with a grain of salt, knowing that my growth is multiplicative, and thus the Fall 2020 push the trends downwards heavily.</li><li>The weekly trend: Thursday to Saturday is the worst moment. Sunday is a great moment if I want to advertise.</li><li>Yearly: that very insightful. We can see the peak on the first of August. Also, we can see that Christmas searches do not bring much revenue. So the fruitful period is April to the end of October.</li></ul><p>That’s already some great insights that I can give back to the marketing manager. Not only I can advise on the day where they should spend more ads budget, but I can also confirm that, yes, it’s normal to see a down in our traffic. And it will recover only in February.</p><p>Also interesting is to see the overall trends compare to the data. We can here see when the trend changes.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/254167381f19b477a540efcde8e23c55/href">https://medium.com/media/254167381f19b477a540efcde8e23c55/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/577/0*JyYEfScCvHg2GrD_.png" /><figcaption>The red line horizontal line is the trend. The red dotted line are the point where the trend changes.</figcaption></figure><h4>2.4 Testing the model</h4><p>Great, now we have done most of the work to predict our Google Analytics traffic. But as rigorous Data Scientist, we also want to test the model.</p><p>The testing for time series is slightly different than for traditional models. We need to work with a rolling window: a rolling windows means using 60 days of data and assess how well it predicted against the next 30 days of data.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/677/0*3H08dtqseals746m.png" /></figure><p>In this graph above for instance, the red part is use to predicts the green part. After cross-validation, the red part will move forward in time to take the next 60 days and again, predicts the next 30 days. This is the concept of the rolling windows. There are enough articles<a href="https://medium.com/making-sense-of-data/time-series-next-value-prediction-using-regression-over-a-rolling-window-228f0acae363"> speaking about rolling windows</a>, so I won’t extend on that.</p><p>Coding-wise, it’s written as follow:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/ce8ed7da41aa87029d437e44a5dac37a/href">https://medium.com/media/ce8ed7da41aa87029d437e44a5dac37a/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/415/0*2FoixgNYn_PpzU1h.png" /></figure><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/3e6215838a5c243ffbc93d67cc3590f1/href">https://medium.com/media/3e6215838a5c243ffbc93d67cc3590f1/href</a></iframe><figure><img alt="RSMSE plotted over the horizon" src="https://cdn-images-1.medium.com/max/512/0*_ujBxwRxzgqOenBB.png" /><figcaption>RMSE plotted over the horizon</figcaption></figure><p>And here we are. We now have the RMSE plotted against the horizon in day. As we can see, the further the horizons, the bigger the error.</p><p>Now for the sake of your own work, you can play with the hyperparameters of the model to try to push this down. As we are using this graph for marketing purposes and not for engineering ones, such an RMSE is good enough.</p><h4>3. Visualization</h4><p>So in the first part, I fetched my data and in the second part, I created the model. Now, it’s time to make it nice so that the Marketing Manager and the CMO are excited about it. Human-truth: having something pleasant to look at makes it more valuable, so time to make my work valuable.</p><p>For pure attention purposes, I had the fun to create a GIF. This kind of animation can really hook on the attention, and thus the interest from the stakeholders to my project.</p><h4>3.1 Data plotting</h4><p>Let’s start by importing the packages:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/4ec62cd2e2a1c17a1c8edb773659f07b/href">https://medium.com/media/4ec62cd2e2a1c17a1c8edb773659f07b/href</a></iframe><p>We want it catchy, so we will directly start with a stylish element: the dark background.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/de708d0eab7dc2e03b394c30c56933cb/href">https://medium.com/media/de708d0eab7dc2e03b394c30c56933cb/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/495/0*k8Ll2a04Ie-jAA3o.png" /><figcaption>web traffic data on a black background</figcaption></figure><p>Very nice effect. Let’s now plot our forecast.</p><h4>3.2 Plotting the prediction as a GIF</h4><p>We first need to create one dataframe containing both our data and our prediction.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/29abef6bf41e36775f2b762bb7ff9cd6/href">https://medium.com/media/29abef6bf41e36775f2b762bb7ff9cd6/href</a></iframe><p>Ok that was the easy part, now we will have the big block to create our GIF. To pursue here, be sure to have installed PillowWriter or Imagemagick, these are the ones which will transform your image in GIF.</p><p>The difference between a classic <em>fig, ax</em> matplotlib operation is that we will need to create function to animate the diagram.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/e6b39faf4f3581f93ee905294bef6e91/href">https://medium.com/media/e6b39faf4f3581f93ee905294bef6e91/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*CHhERBPfiUJJDJo1.gif" /></figure><p>The operation ax.clear() is super important. If you fail to put it, like I did, the animation will create a new graph on top of the previous one. Not terrible, except if.. each new graph has a new color. The final animation will be a rapidly blinking graph changing color every quarter of second. Enough to kill epileptic people.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/720/0*Ff1IvQNkks2hLWk4.gif" /><figcaption>An artsy failure: I miss 90% of my data AND create a “party” graph making people visually sick.</figcaption></figure><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/9b8ee2cbf1c4e0c9051e761268505de5/href">https://medium.com/media/9b8ee2cbf1c4e0c9051e761268505de5/href</a></iframe><p>Note that if you are working in a notebook, you won’t see the animation in your graph. You have to download the ‘animation_video.gif’ created to actually see the animation.</p><p>Here you are, proud of your long working hours and ready to rock the stage with your stunning animation. You can now tell how does the future of your business looks like!</p><h3>Conclusion</h3><p>After fetching the data from Google Analytics API, I could plot a time series of our future web traffic in a GIF.</p><p>This visually appealing results helped the marketing manager and the CMO understand that yes, it was normal if the traffic would go down in winter. And yes, it would grow back in Spring, when the sun comes back and people think about solar energy investment.</p><p>Guess which company starting to invest more in their data team.</p><h3>Going further</h3><p>Your business manager doesn’t understand how a prediction works and how you work? You might be interested by <a href="https://medium.com/@arthur.s.moreau/how-to-explain-predictive-modeling-to-business-managers-ed9a0b3a9ebf">How to explain predictive modelling to managers</a></p><h3>Appendix</h3><p>Jupyter notebook: <a href="https://github.com/ArthurMro/Prediction_marketing/blob/master/Prophet_GA_cs_info.ipynb">https://github.com/ArthurMro/Prediction_marketing/blob/master/Prophet_GA_cs_info.ipynb</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fb066659ae8f" width="1" height="1" alt=""><hr><p><a href="https://medium.com/data-science/forecasting-web-traffic-with-python-and-google-analytics-fb066659ae8f">Forecasting web traffic with Python and Google Analytics</a> was originally published in <a href="https://medium.com/data-science">TDS Archive</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Growth Hacking: beyond the bullsh*t]]></title>
            <link>https://arthur-s-moreau.medium.com/growth-hacking-beyond-the-bullsh-t-95b52c8f922a?source=rss-98606cfc84a0------2</link>
            <guid isPermaLink="false">https://medium.com/p/95b52c8f922a</guid>
            <category><![CDATA[growth-hacking]]></category>
            <category><![CDATA[growth-hacking-marketing]]></category>
            <category><![CDATA[seth-godin]]></category>
            <dc:creator><![CDATA[Arthur Moreau]]></dc:creator>
            <pubDate>Wed, 03 Jun 2020 13:46:35 GMT</pubDate>
            <atom:updated>2021-01-17T15:52:40.856Z</atom:updated>
            <content:encoded><![CDATA[<p><em>Graduated from the Growth Tribe Academy, I believe that Growth Hacking delivers value to the world. But what distinguishes the Growth Hacking bullshit from the valuable Growth Hacking?</em></p><figure><img alt="Growth hacking slap" src="https://cdn-images-1.medium.com/max/508/0*NA9mMoK0v48bXyZ4.jpg" /></figure><h3>‘Growth hacking is bullsh*t’</h3><p>“How We Got 11.3 Million Pageviews without the Growth Hacking Bullshit”. That’s how <a href="https://medium.com/swlh/how-we-got-11-3-million-pageviews-without-the-growth-hacking-bullshit-5e0456dcbe3">Ali Mese</a> punched his opinion on Growth Hackers’ nose. Which happens the first result shown when you type “Growth Hacking” on Medium.</p><p>And he is not the only one. Scrolling down after searching “Growth Hacking” on Medium, you’ll find <a href="https://medium.com/startup-grind/growth-hacking-for-assholes-26f653dc1e52">Growth Hacking for Assholes</a>, or <a href="https://medium.com/@baratunde/let-me-tell-you-why-im-mad-at-growth-hacking-again-58aa6aa3fea5">Let me tell you why I am mad at growth hacking. Again.</a> And to be honest, they have a point.</p><p>I mean, who likes to be forced to like, share, or invite new friends when you discovered the product 30 seconds ago. It’s coercive power. You are forcing the “yes” of the users.</p><p>Metrics can give a direction, but can also make growth hackers blind. A good example is the classic “download the app” on each page of the website visited through your mobile.<br>So how do users react? Some give in to pressure and download the app, but most go away from the website. Internally the team is happy as they see the metrics “download the app” going up. But they are blind to the “side”-effect: the big loss in website traffic.</p><p>Growth Hacking is controversial. As Marketing is. A blog was even created as <a href="https://www.everyonehatesmarketers.com/">https://www.everyonehatesmarketers.com/</a>. People hate marketers because they feel marketers want to influence them against their interests. Indeed that’s sometimes what marketing is.</p><h3>The worst of marketing</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/720/1*KFRPKEKSqJUzNiZT8koMiw.jpeg" /><figcaption>classic evil marketing: cigarette recommended by doctors</figcaption></figure><p>Smoking is a classic example of evil Marketing. The picture is perfect: big companies with big money, selling a product bad for health, and cleansing their image with doctors. Paying to influence the public opinion for the worst.</p><p>And that’s not something from the past. McDonald just replaced the doctor by Athletes: big money spent to create an association, in the consumer’s mind, between a healthy figure and an unhealthy product.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/425/0*annZyIfx3IwE4UB_.jpg" /><figcaption>Mc Donald official sponsor of the 2006 Winter Olympic</figcaption></figure><blockquote><em>‘We marketers love to destroy beautiful things.’</em></blockquote><blockquote><em>Ali Mese</em></blockquote><p>Destroying beautiful things, like health, but for which purpose? To sell, at any cost. Some big bucks were poured in this kind of campaigns, to change the global opinion.</p><p>It all starts with the idea that people need to consume more, not better. It’s a marketing that pushes a project in the hands of the consumers, pushing until people buy. Mass-marketing doesn’t care about what people want, it cares about its shareholder’s benefit.</p><blockquote><em>“Over 90% of tech company content continue to be egocentric, focused on them (products, capabilities, company) instead of the customer (and the benefits that their solutions enable).” — </em><a href="https://blogs.gartner.com/todd-berkowitz/20171218_ten-fearless-predictions-for-b2b-sales-and-marketing-i/"><em>Gartner</em></a></blockquote><p>I believe that there is more to marketing that this one-sided egocentric tool of mass-consumption…</p><h3>A different marketing</h3><blockquote><em>A marketer is curious about other people, their struggles, their dreams, and their beliefs</em></blockquote><blockquote><em>Seth Godin — </em>This is Marketing</blockquote><p>Seth Godin sees marketing through a very different lens. For him, marketing is about serving people. It is an altruistic idea of serving a specific crowd.</p><h4>Mass vs startup marketing</h4><p>In opposition to mass-marketing is startup marketing. The startup scene was deeply influenced but Seth Godin’s approach. Why? because in the startup scene, you don’t have millions to spend in changing people’s conception. You need to find what people want, what truly answers their problems.</p><p>If mass-marketing is pushing product in the hands of customers, pull marketing is the one where comes to you because you offfer the solution to their problems.</p><h4>How to: tell a story</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*VamPIhdbr9_RxfP5.jpg" /></figure><p>Nowadays, storytelling is a new keyword. But again, mass-marketing storytelling stays egocentric mass-marketing. Real storytelling is about a genuine connection between people.</p><p>“Marketers need to tell a compelling story that resonates with the people they seek to serve.” That’s how Seth Godin sees marketing.</p><p>Ali Mese follow is aligned with this mindset: he tells us to sell an emotion. But for an emotion to work, you need to spend time to create the connection. ‘We spend long hours, often a few days, on a single story.’ says Ali.</p><p>Getting people to read your story, a long-form essay, or a blog post, gives you those few priceless minutes to make an in-depth, intellectual connection with anyone around the world.</p><p>Marketing is about spending time understanding them, and their struggles. It’s about delivering value to the people we seek to serve. And Growth hacking is just a sub-field of marketing.</p><h3>The true value of Growth Hacking</h3><blockquote><em>A growth hacker is a person whose true north is growth. Everything they do is scrutinized by its potential impact on scalable growth.</em></blockquote><blockquote><em>Sean Ellis — “inventor” of the Growth Hacking</em></blockquote><h4>Grow through love</h4><p>So a Growth Hacker purpose is to grow. As every marketer, a growth Hacker seeks to change people. And as for marketers, they can do it from a mass-marketing perspective, or from a “serving the customer” point of view.</p><p>In my view, a good Growth Hacker is someone who cares so much about the customers so much that they strive to make the user experience optimal, experiments by experiments. The true growth is done by building product users love.</p><blockquote><em>Love brings growth, not the other way around.</em></blockquote><p>This is what I believe: growth hacking purposes is to grow the love for the product. Fellow Growth Hackers, don’t be blinded by metrics: remember that only user love matters.</p><h4>A personal belief</h4><p>Here is a personal story, showing how I work with my belief. As I was working for a parking app, we worked on delivering more value for the users: <br>- Traditionally, we were used to sending a generic email with a list of parking lots in the user city. It was a way of communicating where people could park with us.<br>- But we wanted to offer more value to the customer with personalized emails. So we build an experimental campaign based on an in-depth analysis of the user’s parking logs. Thanks to the analysis, we could send emails offering the cheapest place to park near their usual destination.</p><p>The results: a huge success! For some users, it meant paying less than 50% of what they were used to pay. We received emails back to thank us! It’s was a first-time for our company!</p><p>So a bit of work from our part, and we could offer the customers a cheaper deal, one that was adapted to their needs. As our parking app has a subscription model, that didn’t decrease our financial revenue. I am proud to say that we succeeded in our role of serving the users!</p><h3>Conclusion: is growth hacking only bullshit?</h3><p>Growth Hacking bullshit is a thing. It’s out there, used by people who want to blindly push metrics without regard for the customers’ love. Growth Hacking as Marketing can be used for the best or the worst. And often, it’s for the worst.</p><p>The key to making good Growth Hacking is to take the time needed to understand the people you seek to serve. Seek to serve your tribe, and serve them genuinely. As a marketer or a Growth hacker alike, true growth comes from a connection with the user.</p><p>Diving more on the topic:</p><p><a href="https://medium.com/swlh/how-we-got-11-3-million-pageviews-without-the-growth-hacking-bullshit-5e0456dcbe3">Ali Mese</a> is a great writer and a personal inspiration.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=95b52c8f922a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to explain predictive modeling to business managers.]]></title>
            <link>https://arthur-s-moreau.medium.com/how-to-explain-predictive-modeling-to-business-managers-ed9a0b3a9ebf?source=rss-98606cfc84a0------2</link>
            <guid isPermaLink="false">https://medium.com/p/ed9a0b3a9ebf</guid>
            <category><![CDATA[business-intelligence]]></category>
            <category><![CDATA[simplification]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[predictive-modeling]]></category>
            <category><![CDATA[machine-learning]]></category>
            <dc:creator><![CDATA[Arthur Moreau]]></dc:creator>
            <pubDate>Mon, 23 Mar 2020 22:09:36 GMT</pubDate>
            <atom:updated>2020-05-22T13:59:57.867Z</atom:updated>
            <content:encoded><![CDATA[<p><em>Or in other words, how I failed to explain predictive modeling to my boss, learned from multiple trials and simplified the concept in order to convince my boss to invest in it.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*aAVlMwExNJgq1PgT" /><figcaption>Photo by <a href="https://unsplash.com/@franckinjapan?utm_source=medium&amp;utm_medium=referral">Franck V.</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>“It looked really cool but I didn’t understand half”.</p><p>Sh*t…</p><p>He is the only one who cared about giving feedback. Probably the others understood even less.</p><p>All the managers have now left the room. I am alone with the flickering “Questions?” slide taunting me. Of course, they had no questions, I made my presentation “The business benefit of Machine Learning” way too complex.</p><p>Well, at least I looked like a smart guy… I guess. But without an understanding of the project by the key managers, there is no way I’ll get the resources needed.</p><p>So I took a deep breath and got back to work. As a Machine Learning fanatic, it was difficult to believe that my company didn’t tap in its tremendous potential yet. Even worst, they didn’t understand the potential yet.</p><p>Falling heavily on my chair, I started typing again, accepting that many efforts would be needed to push this new idea on the agenda. Since then I spent the hours and here I am again.</p><h3>My first step in Machine Learning</h3><p><em>If you can’t explain it simply, then you don’t understand it well enough.<br>- Albert Einstein -</em></p><p>After months of diving into the Machine Learning course of the great teacher Andrew Ng and juggling with the data of my company, I finally got it: a predictive modeling. I was super excited!</p><p>Since the first time I clicked on the “run” of the algorithm, I still get goosebumps of excitation while the results appear! I love it so much: for once, no more guesswork, no opinion of people pretending to be expert! Only the unique truth provided by the machine! And working with the marketing department, guesswork was a daily feed.</p><p>But getting excited is not enough. You also need to understand it deeply. Understand it so much that you can simplify and explain it to the business because the business needs to take the decision. You need to climb the mountain, then go down on the other side to come back on the level of other people.</p><p>Explaining Machine Learning to anyone, to marketing and salespeople, or to people with zero technical background? Yes, it’s possible! Whether you want to understand Machine Learning yourself or want to make other people understand: here is the simplest metaphor of Machine Learning. I polished it by pitching it again and again in front of multiple audiences.</p><p>Once upon a timer was a runner…</p><h3>The race</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*U1iUxfjM8L8XZbyu" /><figcaption>Photo by <a href="https://unsplash.com/@bradencollum?utm_source=medium&amp;utm_medium=referral">Braden Collum</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>A drop of sweat rolls down the forehead and bursts on the ground. The runners are in position, tense, waiting for the starting shot. It’s a warm day in May, the sun is shining. The crowd holds its breath, and you are there, in the grandstand, nervous and excited.</p><p>You are an amateur of athletics and often attend races. But still one is even more special than before: you organized it with your team! <br>You even got the help of an intern, who you tasked to conduct the runner registration process at the entrance. For statistical purposes, you ask him to measure “important traits” of each runner without giving clear guidance. “Those stats are not so important, but may have some use later”, you think.</p><p>Boom! The sound of the departure tears you away from your dream! The runners leap out of the starting line. They slide through the 400 meters. The tension reaches its climax. Aaand here he is! The winner of the race! You go down to cheer and celebrate the victory with your team. What a beautiful day in May!</p><p>A few days later, closing the administration of the race in your office, you start looking at the stats. Damn! The intern measured only three things: the weight, the leg muscle size and the… hair length?! Okay, you might not keep this intern, but anyway, you still have this data and the time of each runner to pull out some stats.</p><p>After a few hours, using the measure of the intern and the speed of the runners, you reached some conclusions:<br>- <strong>Weight:</strong> Neither being too skinny nor too heavy is good. There is an ideal weight, and the closer they are to this weight, the faster they are.<br>- <strong>Leg muscle size:</strong> Here it’s obvious, the more, the better.<br>- <strong>Hair length: </strong>Obvious again; it doesn’t influence their speed at all. You can drop this data.</p><p>So the first analysis is done, but you are wondering whether it is correct. You decide to challenge yourself by attending another race and betting against a friend. Each of you will pick a different runner. Maybe these stats can make you earn a few bucks!</p><p>Second race, you are here to test your model! Before the race starts, you inspect the runner closely and pick your winner: ideal weight and the biggest legs. Your friend picked one too heavy, what a fool! You go sit on the grandstand, confident of your choice.</p><p>One hour later, sipping your luxurious cocktail bought with your friend’s money, you realized that you can actually make use of this formula again and again. Maybe even make a living by predicting the winner for every race. Finally, this intern didn’t do such a bad job…right?</p><p>By the way, if you have followed until here, you have successfully understood the core concept behind one Machine Learning technique: the predictive modeling. Let’s connect the dots with our race story.</p><h3>The Machine and the runner</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Pz0TepbDu5RlDVcN" /><figcaption>Photo by <a href="https://unsplash.com/@nicolasthomas?utm_source=medium&amp;utm_medium=referral">Nicolas Thomas</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Machine Learning works exactly like the race analysis we did. We first built a model with the data, then we tested it to see whether it is future-proof.</p><p>Let’s go back to the first race. At first, we measured data: weight, leg muscle size, and hair length. Then, at the end of the first race, we compiled the data: 1. hair length was not a useful data category, 2. the best is to be average weight and 3. the more muscle, the better. <br>This is called, in Machine Learning terms, training a model. We already have insights about the first set of data, but not sure if the result can be trusted for new data.</p><p>During the second race, we test the model: we bet on the runner who has an average weight and the most muscle. If he wins, we know our model was built correctly. If he doesn’t, we go back to the training phase and try to build a new model: maybe it’s not so good to have too much leg muscle. <br>This is called, in Machine Learning terms, testing the model. In this phase, it’s essential to use new data to be sure that the insights fit new cases.</p><p>To summarize in one image:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mNuo7MEGTyISAMK814svwQ.png" /></figure><p>And here we are! We now have a future-proof model that will help to forecast the winner of the 3rd race and beyond!</p><p>Congrats! You have understood the simplest metaphor of a Machine Learning model: a predictive algorithm! You can now carry the message in your company to push the investment in this field.<br>Think about the huge business potential: You can predict which customers will churn soon, which will become your most loyal customers and which will pay for the soon-to-be-released feature!</p><p>As a side note, for the people ready to start their witch hunt against the Machine: The machine is no fortune teller, and cannot predict exactly who will take what action. But it can give a likelihood of an event happening in the future. As for a runner, we could “only” say he is 90% likely to win the race. But it’s enough to bet some money.</p><p>Be the one who brings innovation to your company!</p><p>Thank you for reading! I commit to simplifying more Machine Learning concepts for business people. So if you feel excited about how simple Machine Learning can be explained, don’t hesitate to <a href="https://medium.com/@arthur.s.moreau">follow me</a>, let a clap or discover more on my personal <a href="http://arthurmoreau.com/">blog about machine learning for marketing</a></p><p>In the same tone, I cannot leave without mentioning Cassie Kozyrkov, Head of Decision Intelligence at Google, who inspired me by her abilities to simplify Machine Learning, and deserves to be mentioned for <a href="https://medium.com/hackernoon/why-businesses-fail-at-machine-learning-fbff41c4d5db">her great writing skills</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ed9a0b3a9ebf" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>