<?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 Navdeep Singh on Medium]]></title>
        <description><![CDATA[Stories by Navdeep Singh on Medium]]></description>
        <link>https://medium.com/@navdeepsinghmalhi?source=rss-e2780104dc6d------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*dmbNkD5D-u45r44go_cf0g.png</url>
            <title>Stories by Navdeep Singh on Medium</title>
            <link>https://medium.com/@navdeepsinghmalhi?source=rss-e2780104dc6d------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 05 Dec 2026 05:40:49 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@navdeepsinghmalhi/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[Picking Optimisation]]></title>
            <link>https://medium.com/godtlevert/production-optimization-algorithm-ee0143b89f57?source=rss-e2780104dc6d------2</link>
            <guid isPermaLink="false">https://medium.com/p/ee0143b89f57</guid>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[data-driven]]></category>
            <category><![CDATA[production]]></category>
            <category><![CDATA[optimization]]></category>
            <dc:creator><![CDATA[Navdeep Singh]]></dc:creator>
            <pubDate>Mon, 12 Dec 2022 12:13:44 GMT</pubDate>
            <atom:updated>2022-12-12T23:36:46.352Z</atom:updated>
            <content:encoded><![CDATA[<p>Written by <a href="https://medium.com/u/e2780104dc6d">Navdeep Singh</a> &amp; <a href="https://medium.com/u/cac4ff1083e6">Thibault Daoulas</a></p><p>Credit to: Ståle Berg &amp; Marie-Noel Chantavong</p><h3>Intro</h3><p><strong>The meal kit business</strong></p><p>LMK group delivers meal kits to around 30K households in Norway, Sweden &amp; Denmark every week. Customers can choose between default meal kits where dishes are selected for them or choose their dishes from a pool of 50–80 dishes every week. This allows us to deliver tailor-made and personalised dinner experiences for Nordic households.</p><p>Let’s say we have 50 new dishes every week, varying the number of portions and number of dinners per week gives us potentially over 2 million unique combinations of meal kits. This increased flexibility for our customers naturally puts pressure on the production and purchasing that must purchase the right amount of ingredients from our suppliers and pack these meal kits.</p><p>These tailor-made meal kits are getting packed on their own production line, the “free-pick” line. On this line, the ingredients for every week are placed in certain positions. This placement was done manually by people with experience to make sure that the production went smoothly and efficiently. When the production starts, the cart boards are made by a machine and sent down the line for printing on the box and printing of menu leaflets before they reach the “free-pick” line. The cart boxes are getting filled with the right ingredients as they are moving on the line. Each box stops at every station and gets filled up with the right ingredients and then is sent to the next station.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*E6h_LpUOAWdoe-5sbpDHdA.png" /><figcaption>Figure 1: Line and station illustration</figcaption></figure><p><strong>Challenges</strong></p><p>The main challenge, in this case, was to minimise the queue time that appeared on the line. That happened when the person at the next station was taking more time to put in the ingredients than the person behind him. That person must wait and that is how the queue appears and slows up production. This happened because it is difficult to estimate the workload on each station manually based on how many picks there are on each station after the placement.</p><p>The other challenges were to place fragile, heavy, or special ingredients in the right places at the line. We don’t want fragile ingredients to get squashed by the heavier ones, and therefore they must be placed at the end, and the heavy ones at the beginning.</p><p>This placement of ingredients was done by the line leaders, who have the most experience and domain knowledge when it comes to production. When the cutoff came, the ingredients list is generated, and they start placing the ingredients. Once a week. They did it with two aspects in mind; Fast production and protecting the ingredients. Even though it was placed by experts, some ingredients were misplaced from time to time, and the workload per station didn’t become equal either. That is very difficult to do 100% correctly when you have 200–300 ingredients that must be placed on equal amounts of slots, with several constraints.</p><h3>Approach</h3><p><strong>Observation phase</strong></p><p>To ensure we address the challenges with the greatest impact on the meal kit packing process, we observed full packing cycles on-site and interviewed stakeholders to gather information from different angles, including employees picking ingredients on the supply chain, and delivering ingredients, as well as chain supervisors and logistics managers.</p><p>This allowed us to understand and formalize performance measures and translate perceived bottlenecks into hypotheses to test on hard data. Having a data representation of the challenges would open the path to data-driven methods and maximize the targeted performance.</p><p>In the present case, the main performance measure to maximize was the number of meal kits packed over time.</p><p>Gathering feedback from stakeholders, we made an initial list of observations, hypotheses to validate, and best practice recommendations:</p><ul><li>Walking back and forth between ingredients is inefficient and puts a strain on workers, which leads to physical and mental fatigue over time</li><li>Since workers wait for incoming boxes at the left side of their respective station, ingredients placed towards the left are packed faster</li><li>Large-sized ingredients, when packed far down the line, often lead to disruption due to all ingredients not fitting; the box is then put aside, and packing must be restarted</li><li>Fragile ingredients packed late on the line may be damaged</li></ul><p><strong>Data exploration</strong></p><p>Examining the physical setup on-site and exploring the available data helped us define the scope of the solution. We started with a several week-batch of historical data containing the following information:</p><ul><li>Ingredient (reference, name, weight, category)</li><li>Time when scanned</li><li>Ingredient position on the line</li><li>Stations setup</li><li>Meal box the ingredient belongs to</li></ul><p>Scanning time and order data allowed us to define several performance metrics for meal box packing, while the position on the line and station setup allowed us to test hypotheses around the relative positions of ingredients on the shelves.</p><p><strong>Formalize hypotheses and test</strong></p><p>While station setup, via trial and error, eventually led to equally sized stations of 16 slots for dry ingredients and 24 slots for cold ingredients, historical data required cleaning and imputation to create a common baseline to test the hypotheses.</p><p>To test hypotheses, our approach was to create features as a proxy to the assumptions to test and train a supervised model that would learn the relationships between these features and the performance metrics, allowing us to validate the impact of the features and decide on which ones to optimize.</p><p><strong>Design setup — Transform hypotheses into features</strong></p><p>One of the first pieces of feedback we received was that workers were walking too much back and forth between slots, affecting their physical condition over time and their efficiency. A first hypothesis to test was therefore whether ingredients near each other tended to be picked faster, both early on during a shift and later in the shift due to cumulated fatigue.</p><p>Instead of looking at the time packed per box, we used the time spent packing ingredients on one station as our performance indicator. The cleaning of this data consisted of removing periods where lunch or other breaks occurred.</p><p><strong>Feature 1: Connectivity</strong></p><p>We created a feature that represents how much a worker on a station must walk to fetch different ingredients for a given box. Based on the Moore Neighborhood, we defined a feature proportional to how connected ingredients are for any given order on a station. As illustrated in Figure 1, neighboring ingredients will belong to one cluster, whereas non-neighboring ingredients will belong to 2 distinct clusters. The hypothesis to test was therefore the positive correlation between the packing time and the number of clusters in one station, given the equal number of unique ingredients.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*d4SIQA-PVEErvKTlMvau6w.png" /><figcaption>Figure 2— Station with 2 clusters of ingredients to pick from for one order</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bLWo4wgNRl7uGFFwOa9xBw.png" /><figcaption>Figure 3 - Schematic view of ingredients shelves and clusters of ingredients. 1 person is assigned 1 station.</figcaption></figure><p><strong>Feature 2: Leftness</strong></p><p>To test the effect of positioning ingredients towards the beginning of a station, we created a feature “leftness” per ingredient, a linear coefficient from 0 to 1, where 1 is an ingredient placed as far left as possible on a station, and 0 is at the far right. A station is then assigned a leftness score based on the average leftness of each picked ingredient on this station.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*I0ZyxHi1azWVQKqKZtXOkg.png" /><figcaption>Figure 4 — Schematic view of ingredients leftness and stations leftness score</figcaption></figure><p>We then built a supervised learning model to test the hypotheses that connectivity and leftness contribute to greater packing throughput per station, where the target is the time spent packing ingredients on one station based on scanning timestamps, and the features being the number of clusters, leftness, number of unique ingredients, ingredients weight, station size. Adding features such as station weight and station size allowed us to make different training sets per group of comparable stations to isolate the effect of the features we intend to control, namely connectivity and leftness.</p><p>For all clusters of training sets, using linear regression, random forest, and xgboost modeling with the SHAP framework, the number of clusters did have consistently a positive impact on packing time, while leftness had a negative correlation.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/832/1*vLrX03bd3OoXvC_bx2BiQw.png" /><figcaption>Figure 5 — Features impact on packing time in one data cluster</figcaption></figure><p>Unsurprisingly, station leftness and the number of clusters showed a strong negative correlation, as a great leftness value implies that ingredients are clustered together towards the beginning of a station. We, therefore, chose to focus on the leftness feature per station and maximize it under provided constraints. In other terms, to reach a global maximum leftness, ingredients with the highest quantities were to be stacked towards the left of each station.</p><p><strong>List constraints (organizational &amp; physical)</strong></p><p>Now that we had a feature to optimize, we had to set constraints and best practices after the observation phase and suggested improvements to embed in the design of the algorithm:</p><p>- Fragile ingredients to be placed towards the end of the line</p><p>- Large-size ingredients to be placed towards the start of the line</p><p>- Heavier ingredients to be placed on the lower shelf</p><p>- Priority groups: some ingredients must be placed last, such as pizza dough, no matter their weight, fragility, cold status, or amount, for better fit due to their shape</p><p>- If all dry ingredients do not fit in the dry area, they need to be placed at the start of the cold area</p><p>- If there are too few unique dry ingredients, therefore, leaving empty slots on the dry side, cold ingredients are imported from the cold side</p><p>- Each station has a provided capacity, allowing trainees or employees with reduced capacity to process their respective stations without affecting the overall flow on the line. This capacity per station varies over weeks, lines, and stations and is provided at the program execution time, i.e., when new orders data come into the system</p><p>- Stations may have a varying number of slots, provided at execution time</p><p>Optimize features under defined constraints</p><p>Defining constraints in the algorithmic sense means setting rules to where ingredients can be placed and reducing or filtering the domain of possibilities. While some rules can be directly applied like fragile ingredients going to the furthest down available slots, large ingredients to the first 3 stations or heavier ingredients being placed on the lower shelf, setting a constraint based on station capacity required an optimization approach. Indeed, any given set of ingredients and their quantities, given some constraints, do not guarantee that the exact desired number of picked ingredients per station can be reached.</p><p>To summarize, at this point:</p><p>What we know:</p><ul><li>Unique ingredients and their properties (big, fragile, heavy, etc.)</li><li>Available slots and properties (for big ingredients, for fragile, for heavy, etc.)</li><li>Maximum number of ingredients to fit on each station</li></ul><p>What we want:</p><ul><li>Match ingredients and slots properties (fragile ingredients in fragile slots, etc.)</li><li>Fit the number of ingredients in each station as close as possible to the maximum capacity calculated</li><li>Place ingredients so that each station’s leftness coefficient is highest as possible</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/916/1*TecjcGPnmq3XwwqLmeLLSA.png" /><figcaption>Figure 6— Example of a map of available slots given the constraint that a slot should be free, not reserved for a light ingredient, not for fragile, and not for large-size ingredients</figcaption></figure><p>This challenge looks a lot like the bin-packing problem with conditions on ingredients properties to identify the bins to choose from. In a nutshell, the bin-packing problem is a situation where we want to use the smallest number of bins or containers with limited capacity, to pack groups of objects of varying sizes.</p><p>In our case, we opted for the First Fit Decreasing algorithm implementation, which is a great compromise between efficiency and precision to reach the targeted station capacity.</p><p>Essentially, for us this means:</p><ul><li>Sorting the ingredients by decreasing the amount</li><li>Sorting the available slots by decreasing remaining station capacity and leftness</li><li>Filtering available slots based on properties of the next ingredient to place</li><li>Iterate until the last ingredient is placed</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*r6nu4FYhUHap6mpG5AcuMA.png" /><figcaption>Figure 7 — Example 1st fit descending: batch of 600 ingredients goes in the station with the greates capacity. Next batch of 500 ingredients goes in the slot belonging to the station with greates capacity, and with greatest leftness.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*z9jFNsDT5WZY_8jfcf5khg.png" /><figcaption>Figure 8 — Effect of bin packing optimization: even spread of load per station, where 1st station has 50% capacity and the last station 75%. Colors represent the ingredients’ priority groups. The second half of the stations are located in the cold area of the warehouse.</figcaption></figure><p><strong>Execute, feedback, iterate</strong></p><p>Once the implementation of the algorithm was in place and tested on historical data, we were able to compare the difference between the setup made and the one suggested by the algorithm. Both on historical data and for a couple of weeks, where the suggestion was only given to the line manager for review, improvements were noticed at first glance:</p><ul><li>The amount of ingredients is more evenly spread over the stations</li><li>No more anomalies where large-size ingredients could be placed late on the line</li><li>Distribution of highly demanded ingredients is a lot more organized towards the left of each station rather than seemingly random distributions</li><li>Better division of heavy and lightweight ingredients between lower and upper shelf</li><li>Fragile ingredients are consistently placed toward the end</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZtS3OuvLm35DbSuYaScjCA.png" /><figcaption>Figure 9 — Ingredients quantity distribution over slots by ascending order. Stations are recognizable as ingredients in quantity are placed towards the left of each. Dark blue bars show the fragile, dry ingredients, now consistently placed last.</figcaption></figure><p>After two weeks of simulation and adjustments after feedback from the warehouse, the output from our model was taken for production. On Wednesday morning, as a list of orders, ingredients and quantities entered the system, the algorithm was run to read and produce a CSV file with the assigned slot for each ingredient in under 8 seconds. Line managers then only had to distribute the ingredients to their assigned position and start the packing procedure.</p><h3>Results</h3><p><strong>Productionalize</strong></p><p>To further streamline the process, we integrated the optimization application with the picking application production used so it would require no manual intervention from the development team. All the line managers had to do was to trigger the optimization via a button on their picking platform, which executed our python application and populated their forms they could just print out and distribute in the production center. Should a trainee, employee with limited capacity, or packing crew be understaffed, they could manually adjust the station’s capacity and rerun the optimization application.</p><p><strong>Feedback from direct stakeholders</strong></p><p>Although data speaks the truth, the most tangible feedback comes from people’s perceptions. In our case, the two main groups of stakeholders we could gather feedback from were workers on the packing line and warehouse managers. While the latter informed us of the process of integrating our new tool into their workflow, the former could give us direct feedback on the impact of our optimization.</p><p>The Monday following the first weekend packing our optimized setup, these were some of the comments we received from the production manager and people working on the packing line:</p><ul><li>“Saturday (last shift) finished earlier than usual”</li><li>“People are more stationary; they walk less back and forth”</li><li>“On average they were packing around 10 more boxes per hour”</li><li>“Less weight to carry from upper shelves”</li></ul><p>While some final adjustments were needed regarding new fragile ingredients, the first data-driven setup for meal kit packing could be considered successful so far. Now hopefully the data will follow and confirm that indeed the impact was positive on the packing production.</p><p>Performance measure</p><p>One challenge with data is that there are many moving pieces, thus making it difficult to establish a baseline. For us, this meant varying scanning device systems, station sizes, or personnel. After some discussions with production managers, we took their usual performance indicator and compared two weeks in with optimization versus two weeks prior. The ultimate KPI is the speed of packing full boxes, in the first 2 weeks we went from 197 to 212 meal kits packed per hour.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/758/1*txsfPf__kk2LELfZAqNwlg.png" /><figcaption>Figure 10 — Average boxes packed per hour per day. From From 2020–10–08 with optimized ingredient placement.</figcaption></figure><p><strong>Conclusion</strong></p><p>Even though the improvement measured of around 10% increased packing productivity might not appear drastic, it does have a significant impact when a large number of employees are involved in the process. However, an immediately perceptible yet more difficult-to-measure impact has been the improved working conditions and reduced physical strain on employees, who now both work shorter hours on the line, carry lighter weights, and need to walk less back and forth through their shifts. Stressful situations related to rightly preordered ingredients, queues, and repacking have also reduced, leading to better working conditions overall.</p><p>Building the placement optimization tool took about a month from scratch to being fully integrated into existing workflows, so there is great room for improvement, but it opened the opportunity for further improvements with minimal effort across production centers.</p><p>Finally, beyond the desired improvements, the tool now gives better control over the packing flow and gives the knobs for line managers to adjust stations, for example for trainees, people with reduced capacity, or reduced staff.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ee0143b89f57" width="1" height="1" alt=""><hr><p><a href="https://medium.com/godtlevert/production-optimization-algorithm-ee0143b89f57">Picking Optimisation</a> was originally published in <a href="https://medium.com/godtlevert">Cheffelo  — Tech &amp; Data</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Recommendation Engine — with a twist of flavour]]></title>
            <link>https://medium.com/godtlevert/recommendation-engine-with-a-twist-of-flavour-463dd6e2f09e?source=rss-e2780104dc6d------2</link>
            <guid isPermaLink="false">https://medium.com/p/463dd6e2f09e</guid>
            <category><![CDATA[ui]]></category>
            <category><![CDATA[recommendation-system]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[foodtech]]></category>
            <category><![CDATA[ai]]></category>
            <dc:creator><![CDATA[Navdeep Singh]]></dc:creator>
            <pubDate>Thu, 02 Sep 2021 08:06:18 GMT</pubDate>
            <atom:updated>2021-09-02T08:06:18.327Z</atom:updated>
            <content:encoded><![CDATA[<h3><strong>Recommendation Engine — with a twist of flavour</strong></h3><p>Written by <a href="https://medium.com/u/d07b9d5ccff">Niladri Banerjee</a></p><p><strong>Introduction</strong></p><p>Food, such a wonderful delight!</p><p>Food, such a delightful sight!</p><p>Food that makes an imagination take flight,</p><p>Food that lightens up the day bright!</p><p>Our lives are all about food. Good, timely, nutritious food is vital not only to us as humans for survival, but it is also essential for our well-being! Here at LMK Group, food is what we do! On a daily basis!</p><p>And not just provide food. That many people and indeed businesses worldwide are involved in.</p><p>Our mission, however, is to make everyday lives simpler. By making it easier to plan, obtain and cook delicious meals loved by everyone in the family while at the same time making sustainable production a non-negotiable priority.</p><p>It is precisely for these reasons developing an AI-driven recommendation engine for our customers was no mean task! There is no plug-n’-play system out there that considers the unique business model of our meal kit system and is ready to deploy out of the box!</p><p>So, in this blog, we will go through some of the salient features of our recommendation engine that make it so unique and that helps fulfil our goal of making everybody’s daily lives, a little bit simpler and enjoyable!</p><p><em>P.S If a general introduction to recommendation engines is what you are looking for, there are plenty of great resources, e.g., check out </em><a href="https://en.wikipedia.org/wiki/Recommender_system"><em>here</em></a><em>, </em><a href="https://towardsdatascience.com/what-are-product-recommendation-engines-and-the-various-versions-of-them-9dcab4ee26d5"><em>here</em></a><em> and </em><a href="https://towardsdatascience.com/introduction-to-recommender-systems-6c66cf15ada"><em>here</em></a></p><p><strong>Materials &amp; methods</strong></p><p>Like many recommendation engines out there, the first and foremost priority is to ‘know thy customer’. Because indeed we wanted to make personalisation a top priority- to recommend dishes and meals based on what we personally like and prefer! So how did we go about it?</p><p>Well, we did this by making a taste profile for every active customer based on past orders. This involved a fair amount of data munging and wrangling.</p><p>There were complex business rules to adhere to, intricate JOINS to perform and a good measure of Pythonic magic to whip into shape the data that forms the base for our recommendation engine.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JhtZnJI98Zd5KiNKGBcXxg.png" /><figcaption>The real matrix is what you are staring at…</figcaption></figure><p>While the business rules might be boring to write much about, they actually acted as useful constraints. Talk about making lemonade out of lemons!</p><p>We at LMK Group are all about sustainability and planning. Thus, our weekly menus take into account the seasonal fresh produce, availability of ingredients and various logistics measures to minimise food wastage. Additionally, there are rules pertaining to the specific variety of dishes to provide for the customer each week. Thus, our recommendation engine deviates from the classic e-commerce-based recommendation engines.</p><p>At its core however, the overall principle follows a content-based approach to recommending dishes to each customer for each week using past orders data, ingredients and taxonomies of each dish in addition to the seasonal recipes available. The end result is not that different than chopping, cutting and grinding the raw materials needed to make a lip-smacking dish!</p><p>Without going into too much technical details, the overall flow of steps can be summarised into the following steps:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dTOQ6gLnrUvWI_zN1ZWD5A.png" /><figcaption>From a distance…everything looks so simple!</figcaption></figure><p>Thus, every week each of our customers get 8 dishes to choose from. Why this number one may ask? Well again it comes down to business rules such as basket sizes and a trade-off between drowning a customer with a flood of options, in which case it would not be personalised at all or the other extreme- giving way too few options!</p><p>The above flow chart however is just on the model side, which consists of many matrix operations. Getting the recommendations out to the customer while he/she browses on the website/app is a whole different ball game. That is where the dark art of productionising machine-learning models comes into the picture! Speaking of pictures, take a look below to get a bird’s eye view of the various steps and interconnected pathways involved in serving the recommendations!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IAG1VRYuBOPimq5CI8s9NQ.png" /><figcaption>The flow</figcaption></figure><p>As we can see, delivering a machine-learning end product to the masses, i.e., the ‘consumable’ requires an orchestration of considerable number of processes across various systems in both backend and frontend infrastructures. And this will vary from company to company and use-case to use-case of course!</p><p>In our case, the broad route basically involves delivering the recommendations to the customer on the website through Segment, which is a customer data platform that is a pretty powerful tool for coordinating the final display of items to the customer. This data is pumped from a PostgreSQL database that obtains its data in a JSON format from our Azure SQL Database. All of this coordinated through pipelines and stored procedures triggered from Azure Data Factory.</p><p><strong>Workform</strong></p><p>The way we like to work with Data &amp; AI products in LMK Group is to “Nail it, then scale it”. Get the minimum viable product to production as fast as possible and learn. When you are sewing data components in a data product together is when one really exposes the faults in the solution. This pushes the platform team to orchestrate everything with precision, the frontend team to make smooth customer facing UI and it forces the digital experience team to think about UX from the customers perspective. Especially for recommendation engine products the UI really influences the results of the data product.</p><p>This approach is one of many approaches we have tried and tested. We also work with person-based approaches, association rules, ML ++. We also have different types of products we can recommend spread across 4 brands in 3 countries. In other words, this blogpost highlights a small amount of work we are doing across our company, but also a very nice introduction of our ways of work.</p><p><strong>Results</strong></p><p>Okay, enough talk about the technical implementation, does our recommendation engine work? Does it help push the needle when it comes to tempting customers with dishes customised to each and every one of them? Preliminary analysis says YES!</p><p>The following is a graph from one of the cohorts we tested the recommendation engine on, and we were quite pleased that customers receiving the personalised recommendations not only purchased more recommendations, but more customers were purchasing! This was a very welcome news from the viewpoint of customer engagement and satisfaction!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wurNGmqFYsmoHWB5Z_93cg.png" /><figcaption>Some very interesting results!</figcaption></figure><p><strong>Discussion &amp; Conclusion</strong></p><p>So, what can we conclude about the recommendation engine? Well for starters, the good news is that it is working! The plan going forward would then be to expand to all the companies under the umbrella of LMK Group.</p><p>The other big advantage is that this application supports our chefs. With the recommendation engine, one part of their workload gets automated leaving them free to focus on doing what they know best….making delicious lip-smacking dishes for all of us to savour upon!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/437/1*p5BcHP_V9E2D5LHpW1Igng.png" /><figcaption><em>Delicious meals…coming right your way!</em></figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=463dd6e2f09e" width="1" height="1" alt=""><hr><p><a href="https://medium.com/godtlevert/recommendation-engine-with-a-twist-of-flavour-463dd6e2f09e">Recommendation Engine — with a twist of flavour</a> was originally published in <a href="https://medium.com/godtlevert">Cheffelo  — Tech &amp; Data</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[A quick and easy way to get going with CLV]]></title>
            <link>https://medium.com/godtlevert/a-quick-and-easy-way-to-get-going-with-clv-27bfa019ebdd?source=rss-e2780104dc6d------2</link>
            <guid isPermaLink="false">https://medium.com/p/27bfa019ebdd</guid>
            <category><![CDATA[marketing]]></category>
            <category><![CDATA[customer-lifetime-value]]></category>
            <category><![CDATA[analytics]]></category>
            <category><![CDATA[data-science]]></category>
            <dc:creator><![CDATA[Navdeep Singh]]></dc:creator>
            <pubDate>Mon, 16 Aug 2021 08:29:01 GMT</pubDate>
            <atom:updated>2021-08-16T08:29:01.802Z</atom:updated>
            <content:encoded><![CDATA[<p>Written by <a href="https://medium.com/u/af10e37175ee">Peder Kraugerud</a> &amp; <a href="https://medium.com/u/d07b9d5ccff">Niladri Banerjee</a></p><p>Back in the spring of 2020 our newly hired group CMO asked us in data science and analytics to calculate the customer lifetime value (CLV) for of each of our brands. A natural enquiry for a newly appointed CMO that would like to get a quick overview of our customers, their value and performance. CLV can be used for many purposes but fundamentally it shows how valuable a customer is to a company and what drives value. It is an important metric to understand company performance and if we as a company are making sound investment decisions. i.e., are we acquiring customers that are valued above their acquisition cost?</p><p><strong>What approach to choose? Do not overthink, just get going!</strong></p><p>Up until our new CMO’s request CLV had mostly been calculated on an ad-hoc basis and definitions were not agreed upon across the company. To proceed we needed an approach we felt gave an informative view of our customers and an approach all relevant departments would agree on. We aligned definitions and how we would work with CLV between the tech, commercial and finance departments. Lastly, we needed a relatively simple approach to quickly get going. We realised that the project would languish if we overcomplicated our approach early on. And by choosing a relatively straightforward method we could quickly share results with our CMO and discuss how to continue to develop our CLV project. We landed on the approach below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hjjsjD_ycZtd-EN9Okb7fQ.png" /></figure><p>Lifetime value is the result of multiplying average transaction value, order frequency and lifespan (1 / churn rate). Then to calculate customer lifetime value, we chose to use a variable contribution margin. This is because we want to use the CLV to evaluate our investment decisions (customer acquisition). We want to understand if the customers we acquire are valued above their acquisition cost and provide an acceptable rate of return on investment. To do so we want to include all extra costs associated with acquiring new customers. Like food costs, other COGS (cost of goods &amp; services), production (meal kit production) and logistics costs. And we want to exclude all fixed costs that we would incur regardless of the customer was acquired or not, like real estate rentals and overhead. Then to understand how customer behaviour and value have development over time we have calculated our CLV on a 12-month rolling basis. When visualising CLV, and its parameters, it is then easy to understand performance over time.</p><p>Lastly, we calculated CLV for all customers in our chosen time horizon. This CLV value for all customers is a great metric to understand your company’s (or brand’s) overall performance but it is misleading when evaluating any investment decision relating to new customer acquisition, at least given how typical cohorts develop in our industry with high initial churn rates but long tail relationships lasting years. To do this we needed to further segment our data, only looking at new customer that have signed up during the last 12-months. The was further segmented by sales channel as the customer acquisition cost between for example web channels and telemarketing are significantly different and have different cohort behaviour.</p><p><strong>From ad-hoc to automation</strong></p><p>With the expansion of our Data Science team, the journey from ad-hoc reports to automation could truly start! This process involved onboarding the data scientist to the concepts of CLV and general marketing and finance jargon followed by a better understanding of business rules and logic. The result is a CLV report generated in JupyterLab once a month.</p><p>Presently the CLV report analyses all the brands within our group for a) all customers b) new customers c) Web entry channel d) Telemarketing entry channel. The process broadly works by fetching live data once a month from our SQL database, data munging and cleaning followed by applying a broad set of custom functions adjusted to each company.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/970/1*0zDBl0QQ61m100lbXP4wMw.png" /><figcaption>The initial setup of the notebook</figcaption></figure><p>Amongst the libraries used, the most important one was datetime, both the module and the method! And that is a bit of a pain point in the sense both the module and the method are named the same and can become very confusing if not careful with the code structure!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/448/1*epRf16XDOnvIIuYA4Nk6eA.png" /><figcaption>Same? Note same.</figcaption></figure><p>The reason both needed to be imported was due to the different functions each of them provide access to e.g., strptime is a classmethod in datetime while timedelta belongs just to the class datetime only!</p><p>Amongst the custom functions written the most important ones relate to calculation of delivery weeks (which are specific to business rules). Thus the prebuilt functions available to calculate needed to be tweaked. To automate this process custom functions considering year, if the year has leap weeks and whether a year begins on Thursdays needed to be considered. Who would have thought that a calendar can be that complicated!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/956/1*Y7l8dnd-OWSKM9xguoEY6g.png" /><figcaption><em>A simple function to spit out the last delivery week numbers for a month, that under the hood isn’t so simple!</em></figcaption></figure><p>When all is said and done however, a simple one-liner computes the CLV for a given company, month and whether we want info on new customers as well.</p><p><strong>Value to operational marketing</strong></p><p>This report gives a retrospective overarching look at the customer base and its value. It can have strategic implications and gives a nice overview of how the customer base is changing.</p><p>As far as operational value for marketing, we often do more ad-hoc deep dives that give marketing and CRM more tools to customise their content to the right audience at the right time. The typical activities can be to do Kaplan-Meier analysis to understand the retention behaviour of different segments or make Shap values to help them understand their real drives for marketing activities. Shap values breaks down the effects of variables in a ML model and makes it easier for us to interpret the impact of each variable. <a href="https://www.kaggle.com/dansbecker/shap-values">You can read more about it here.</a></p><p>This is a back-and-forth job where we have a mix of people with different knowledge and skillset working together over time to pinpoint needs, hypotheses and resulting actions based on data. That could be marketing representatives, CRM experts, Analysts and Data Scientists</p><p>Going forward we have two goals for this project. The first one is to increase accuracy of how we calculate parameters used in the CLV calculation. Like testing out the Kaplan Meier estimator, Traditional ML, Gaussian approaches or among other alternatives, to estimate customer’s retention rate. The other one is to the bridge the gap even more between the marketing- and data science experts, as we think that is the key to really extract more value from our data to our business units. The more our analysts know about specific marketing activities, and thus more our marketing department gets comfortable using data and advanced analytics, the project will hit a new gear.</p><p><strong>CLV part 2 — Future work</strong></p><p>Looking even further ahead we have plans for expanding the project as we have learned more about what type of approach fits a subscription-based ecommerce company best. We aim to predict the CLV of each individual customer in our customer base so we can operationalise the metric across our business. The purpose will be to give our customer service and marketing teams another metric to understand and segment our customers by. It will be a system om models running at different times predicting the CLV of customers as they progress through the onboarding journey. What they do, what they order and what they receive (campaigns) in the onboarding face can often be a good indicator of whether somebody will be a loyal customer or not. More to come.</p><p><strong>Charts</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zND5vZYntFuqw8m2nDhqhA.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=27bfa019ebdd" width="1" height="1" alt=""><hr><p><a href="https://medium.com/godtlevert/a-quick-and-easy-way-to-get-going-with-clv-27bfa019ebdd">A quick and easy way to get going with CLV</a> was originally published in <a href="https://medium.com/godtlevert">Cheffelo  — Tech &amp; Data</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>