<?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 Igor Surzhyk on Medium]]></title>
        <description><![CDATA[Stories by Igor Surzhyk on Medium]]></description>
        <link>https://medium.com/@cleitus?source=rss-9dce1914b2d4------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*H0c-bjKGUrOdHlK8ds3l-A.jpeg</url>
            <title>Stories by Igor Surzhyk on Medium</title>
            <link>https://medium.com/@cleitus?source=rss-9dce1914b2d4------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 19 Nov 2026 20:38:56 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@cleitus/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[Can Machine Learning Predict the Next Offshore Inventory Shortage?]]></title>
            <link>https://medium.com/@cleitus/can-machine-learning-predict-the-next-offshore-inventory-shortage-edbbfe962467?source=rss-9dce1914b2d4------2</link>
            <guid isPermaLink="false">https://medium.com/p/edbbfe962467</guid>
            <category><![CDATA[predictive-analytics]]></category>
            <category><![CDATA[warehouse-management]]></category>
            <category><![CDATA[supply-chain-management]]></category>
            <category><![CDATA[oil-and-gas]]></category>
            <category><![CDATA[data-science]]></category>
            <dc:creator><![CDATA[Igor Surzhyk]]></dc:creator>
            <pubDate>Sun, 01 Nov 2026 11:31:01 GMT</pubDate>
            <atom:updated>2026-11-01T11:31:01.728Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bjCeBHoiBjd3bnT38A-mcQ.png" /></figure><p><em>Data Science on the Warehouse Floor — Article #2</em></p><p><strong>From SAP transaction history to predictive analytics: can a simple machine learning model help offshore warehouses anticipate shortages before they disrupt operations?</strong></p><h3>The Problem: A Warehouse Full of Data, but Not Enough Answers</h3><p>Imagine an offshore oil installation in the North Atlantic.</p><p>Every week, supply vessels deliver equipment, spare parts, chemicals and consumables. Meanwhile, maintenance teams continuously request materials for routine operations and unexpected repairs.</p><p>The warehouse team knows what is currently available. SAP provides stock balances, material movements and purchase order information.</p><p>But one important question remains:</p><p><strong>Which materials are most likely to run out before the next replenishment arrives?</strong></p><p>Traditional inventory management relies on reorder points, safety stock and historical consumption. These methods work well in many situations, but offshore logistics introduces additional uncertainty.</p><p>What if consumption suddenly increases? What if a supplier delivers late? What if rough seas delay a scheduled vessel?</p><p>This is where machine learning might offer additional value.</p><h3>1. From SAP Data to Predictive Features</h3><p>Machine learning starts with data, not algorithms.</p><p>In SAP, warehouse operations continuously generate information that can be used for inventory analysis.</p><p>For example:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/400/1*iKqBjjkStlQlJzU1D2phwg.png" /></figure><p>Transaction availability and equivalent reporting tools depend on the SAP system and configuration.</p><p>By combining these sources, we can construct a dataset describing inventory conditions at specific points in time.</p><p>Consider a simplified example:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1003/1*cldyvGGP7caEWolx12ToMg.png" /></figure><p>These are fictional figures.</p><p>Even this small table suggests several potentially useful relationships.</p><p>A material with low stock, high consumption and a long replenishment time may face greater shortage risk. Frequent supplier delays could increase that risk further.</p><p>However, machine learning needs more than four observations. A useful model would require historical records covering many materials and multiple time periods.</p><h3>2. What Exactly Are We Trying to Predict?</h3><p>Before choosing an algorithm, we need to define the business problem.</p><p>Suppose our objective is to predict whether a material will experience a stockout during the next 30 days.</p><p>This becomes a binary classification problem:</p><ul><li><strong>0:</strong> No stockout within 30 days</li><li><strong>1:</strong> At least one stockout within 30 days</li></ul><p>For each historical observation, we calculate features using information available at that time.</p><p>Possible features include current stock, recent consumption, supplier lead time, previous delivery delays, outstanding purchase orders and maintenance reservations.</p><p>The target variable is calculated afterward, using the actual inventory history over the following 30 days.</p><p>This distinction is important.</p><p>A predictive model must not use information from the future to predict the past.</p><h3>3. Building a Simple Machine Learning Model in Python</h3><p>For a first experiment, we can use logistic regression.</p><p>Despite its name, logistic regression is commonly used for classification. It estimates the probability of an event based on several input variables.</p><p>Suppose we have already prepared a historical dataset called inventory_history.csv.</p><p>Each row represents a material at a particular observation date, with a known stockout outcome over the following 30 days.</p><pre>import pandas as pd<br><br>from sklearn.linear_model import LogisticRegression<br>from sklearn.metrics import (<br>    classification_report,<br>    roc_auc_score<br>)<br>from sklearn.pipeline import make_pipeline<br>from sklearn.preprocessing import StandardScaler<br><br>df = pd.read_csv(<br>    &quot;inventory_history.csv&quot;,<br>    parse_dates=[&quot;date&quot;]<br>)<br><br>df = df.sort_values(&quot;date&quot;)<br><br>features = [<br>    &quot;stock&quot;,<br>    &quot;usage_30d&quot;,<br>    &quot;lead_time&quot;,<br>    &quot;supplier_delays_90d&quot;<br>]<br><br># Split by date, not randomly<br>cutoff = df[&quot;date&quot;].quantile(0.8)<br><br>train = df[df[&quot;date&quot;] &lt; cutoff]<br>test = df[df[&quot;date&quot;] &gt;= cutoff]<br><br>X_train = train[features]<br>y_train = train[&quot;stockout_next_30d&quot;]<br><br>X_test = test[features]<br>y_test = test[&quot;stockout_next_30d&quot;]<br><br>model = make_pipeline(<br>    StandardScaler(),<br>    LogisticRegression(<br>        max_iter=1000,<br>        class_weight=&quot;balanced&quot;<br>    )<br>)<br><br>model.fit(X_train, y_train)<br><br>probabilities = model.predict_proba(<br>    X_test<br>)[:, 1]<br><br>predictions = (<br>    probabilities &gt;= 0.5<br>).astype(int)<br><br>print(classification_report(<br>    y_test, predictions<br>))<br><br>print(<br>    &quot;ROC AUC:&quot;,<br>    roc_auc_score(y_test, probabilities)<br>)</pre><p>This is a simplified educational example. It assumes clean data, sufficient observations in both classes and correctly constructed historical targets.</p><p>In a real implementation, we would also need to prevent overlapping prediction windows from leaking future outcomes into training. For a 30-day target, an appropriate gap between training and testing periods is one possible safeguard.</p><p>The result is not a guaranteed prediction. It is an estimated probability based on patterns learned from historical data.</p><h3>4. What Would the Predictions Look Like?</h3><p>Imagine that a trained model produces the following results:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/400/1*6hZgqb0SS2Gm_tnZ2VcA3Q.png" /></figure><p><em>Illustrative outputs only, not results from the Python example.</em></p><p>The valve assembly appears to have the highest predicted risk.</p><p>But why?</p><p>Perhaps its long replenishment time, low inventory and history of delayed deliveries resemble previous stockout situations.</p><p>The hydraulic seal may also require attention because of its relatively high consumption.</p><p>The industrial filter, meanwhile, appears less exposed.</p><p>These predictions could help materials coordinators prioritize investigations, review open purchase orders or reconsider replenishment plans.</p><p>However, <strong>a 91% prediction is only useful if the model is reasonably well calibrated and validated on genuinely unseen data.</strong></p><h3>5. Machine Learning vs. Traditional Inventory Calculations</h3><p>Here comes an important question.</p><p>Do we actually need machine learning?</p><p>Consider a traditional inventory coverage calculation:</p><p><strong>Days of Supply = Current Stock / Average Daily Consumption</strong></p><p>If a material has 10 days of stock coverage and a replenishment lead time of 25 days, the potential problem is already visible.</p><p>No machine learning is necessary.</p><p>Machine learning becomes more interesting when several factors interact:</p><ul><li>Consumption patterns change over time.</li><li>Supplier reliability differs significantly.</li><li>Maintenance schedules create irregular demand.</li><li>Delivery times fluctuate.</li><li>Materials exhibit seasonal or project-related consumption.</li></ul><p>A predictive model might discover useful combinations of these variables that are difficult to capture with a single formula.</p><p>But that does not mean it will always outperform a traditional method.</p><p>The correct approach is to compare both on the same historical test periods.</p><p>If a simple reorder-point calculation performs equally well, its transparency and lower maintenance costs may make it the better solution.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dZjPghDqIKSfnTQ5uHAvTA.png" /><figcaption><strong>Traditional Forecasting vs. Machine Learning:</strong> Two approaches to managing offshore inventory risk. Traditional methods emphasize simplicity and transparency, while machine learning can incorporate multiple variables to identify more complex patterns. The 82% shortage probability is illustrative.</figcaption></figure><h3>6. Why Accuracy Alone Is Not Enough</h3><p>Imagine a warehouse where 98% of material observations do not result in stockouts.</p><p>A model that always predicts “no shortage” would achieve 98% accuracy.</p><p>Impressive?</p><p>Not particularly.</p><p>It would fail to identify every actual shortage.</p><p>For offshore materials management, other evaluation measures may be more useful:</p><ul><li><strong>Recall:</strong> How many actual stockouts did the model identify?</li><li><strong>Precision:</strong> How many predicted shortages actually occurred?</li><li><strong>False alarms:</strong> How often did the model unnecessarily flag materials?</li><li><strong>Warning time:</strong> How many days before a shortage did the alert appear?</li></ul><p>There is also an economic dimension.</p><p>Missing a shortage involving a critical component could be far more expensive than generating an unnecessary warning for a low-value consumable.</p><p>Consequently, prediction thresholds should reflect operational consequences rather than being fixed at 50% for every material.</p><h3>7. The Offshore Challenge: Rare but Critical Materials</h3><p>One of the biggest difficulties is predicting demand for rarely used spare parts.</p><p>A critical valve may remain untouched for several years.</p><p>Then a single equipment failure creates an urgent requirement.</p><p>A model trained primarily on consumption history may struggle to predict such events because there is little meaningful demand history.</p><p>This is where engineering and maintenance information becomes essential.</p><p>Equipment reliability, failure modes, maintenance plans and operational criticality may provide more useful signals than historical goods issues alone.</p><p>In some cases, a reliability-based stocking policy may be preferable to machine learning.</p><p>The objective is not to predict every equipment failure perfectly. It is to make informed decisions about the consequences of material unavailability.</p><h3>8. From Predictions to Warehouse Decisions</h3><p>A prediction by itself does not improve warehouse performance.</p><p>The real value appears when the prediction leads to an appropriate action.</p><p>For example, a high-risk alert could trigger a review of:</p><ol><li>Available and reserved stock.</li><li>Outstanding purchase orders and confirmed delivery dates.</li><li>Alternative materials or approved substitutes.</li><li>Upcoming maintenance requirements.</li><li>Offshore vessel schedules and available transportation capacity.</li></ol><p>Over time, these alerts could be incorporated into an Excel or Power BI dashboard, providing warehouse personnel with a prioritized view of materials requiring attention.</p><p>Importantly, the system should explain why an item has been flagged.</p><p>A warehouse specialist needs actionable information, not simply a mysterious number generated by an algorithm.</p><h3>Bottom Line</h3><p>Machine learning has genuine potential in offshore materials management, particularly where demand, supplier performance and logistics conditions interact in complicated ways.</p><p>But sophisticated algorithms are not automatically superior to simple inventory calculations.</p><p>The most effective approach combines <strong>SAP transaction history, statistical analysis, maintenance information and practical warehouse experience.</strong></p><p>Machine learning can help identify patterns. Experienced professionals determine what those patterns mean and which actions are operationally appropriate.</p><p><strong>The goal is not to build an algorithm that predicts every shortage. It is to give warehouse teams enough reliable warning to prevent the shortages that matter most.</strong></p><p><em>Data Science on the Warehouse Floor explores how practical analytics, industrial experience and modern technology can improve warehouse operations, supply chains and materials management.</em></p><p><em>Previous in series: </em><a href="https://medium.com/@cleitus/the-50-spare-part-that-could-cost-an-oil-rig-500-000-b4e843ceb15b"><em>The $50 Spare Part That Could Cost an Oil Rig $500,000</em></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=edbbfe962467" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The $50 Spare Part That Could Cost an Oil Rig $500,000]]></title>
            <link>https://medium.com/@cleitus/the-50-spare-part-that-could-cost-an-oil-rig-500-000-b4e843ceb15b?source=rss-9dce1914b2d4------2</link>
            <guid isPermaLink="false">https://medium.com/p/b4e843ceb15b</guid>
            <category><![CDATA[oil-and-gas]]></category>
            <category><![CDATA[logistics]]></category>
            <category><![CDATA[warehouse-management]]></category>
            <category><![CDATA[sap]]></category>
            <category><![CDATA[data-science]]></category>
            <dc:creator><![CDATA[Igor Surzhyk]]></dc:creator>
            <pubDate>Sat, 10 Oct 2026 23:21:04 GMT</pubDate>
            <atom:updated>2026-10-10T23:21:04.499Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NPE7nALWv_sXIPzHqiUqVw.png" /></figure><p><em>Data Science on the Warehouse Floor — Article #1</em></p><p><strong>How a simple inventory shortage can become an expensive offshore logistics problem, and what data science can do to prevent it.</strong></p><h3>When a Small Part Becomes a Big Problem</h3><p>Imagine an offshore oil platform operating hundreds of miles from the nearest supply base.</p><p>During routine maintenance, technicians discover that a critical hydraulic component needs replacement. The part itself costs just $50.</p><p>Unfortunately, the offshore warehouse has none available.</p><p>The component is sitting in an onshore warehouse, but the next scheduled supply vessel will not arrive for another four days. Helicopter transportation may be possible, subject to operational restrictions, weather and cargo suitability.</p><p>Meanwhile, the equipment cannot safely return to service.</p><p>If the resulting disruption costs $125,000 per day, four days of downtime could represent a $500,000 loss.</p><p>This is a hypothetical scenario, not a documented incident. Actual costs depend heavily on the equipment, production impact and operating conditions.</p><p>Nevertheless, it illustrates an important principle:</p><p><strong>In offshore operations, the financial importance of a material is not necessarily related to its purchase price.</strong></p><p>And this is exactly where data science can make a difference.</p><h3>The Problem with Traditional Inventory Management</h3><p>Many industrial warehouses rely on established reorder points, minimum stock levels and the experience of materials coordinators.</p><p>These methods are useful, but offshore supply chains introduce additional uncertainty:</p><ul><li>Supplier lead times can fluctuate.</li><li>Weather can interrupt scheduled deliveries.</li><li>Maintenance activities can unexpectedly increase demand.</li><li>Equipment failures can create urgent requirements.</li><li>Limited offshore storage space makes excessive inventory expensive.</li></ul><p>A warehouse may have thousands of material numbers in SAP, making it difficult to evaluate every item manually.</p><p>But what if we could identify potentially critical materials before they become unavailable?</p><h3>Step 1: Turn SAP Transactions into Useful Data</h3><p>SAP already contains much of the information needed for inventory analysis.</p><p>Depending on the system and configuration, relevant transactions include:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/652/1*cCnWTuIreI7Q3TPWCcnrgw.png" /></figure><p>In SAP S/4HANA, equivalent Fiori applications or analytical reports may also be available.</p><p>By combining stock balances, historical consumption, purchasing information and maintenance requirements, we can create a simple inventory-risk dataset.</p><p>Consider the following fictional offshore inventory:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/649/1*hNpTRaeb96Q8G4vigvzqJg.png" /></figure><p>At first glance, the hydraulic seal appears most concerning because its consumption is relatively high.</p><p>But the pressure sensor and valve assembly have significantly longer replenishment times.</p><p>How do we compare them objectively?</p><h3>Step 2: Calculate Inventory Coverage</h3><p>We can begin with average daily consumption:</p><p><strong>Daily Consumption = 90-Day Usage / 90</strong></p><p>Then calculate how many days the available inventory could theoretically cover:</p><p><strong>Days of Supply = Current Stock / Average Daily Consumption</strong></p><p>Using Excel:</p><pre>=B2/(C2/90)</pre><p>Assuming column B contains stock and column C contains 90-day usage.</p><p>The results are:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/644/1*pueJUC1D-ONvZXG_a1XtuQ.png" /></figure><p>Now the situation looks different.</p><p>The hydraulic seal has only ten days of estimated coverage against a 21-day replenishment time.</p><p>The valve assembly has 30 days of coverage, but its normal replenishment time is 60 days.</p><p>Both deserve attention.</p><p>However, this calculation assumes relatively stable consumption. For intermittent critical spare parts, historical averages alone can be misleading.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*638MzivOhrd-KFHHNDoBbA.png" /></figure><h3>Step 3: Build a Simple Python Risk Model</h3><p>Python allows us to automate the calculation across hundreds or thousands of materials.</p><pre>import pandas as pd<br><br>data = {<br>    &quot;material&quot;: [<br>        &quot;Hydraulic Seal&quot;,<br>        &quot;Pressure Sensor&quot;,<br>        &quot;Industrial Filter&quot;,<br>        &quot;Valve Assembly&quot;<br>    ],<br>    &quot;stock&quot;: [4, 3, 25, 2],<br>    &quot;usage_90d&quot;: [36, 9, 90, 6],<br>    &quot;lead_time&quot;: [21, 45, 14, 60]<br>}<br><br>df = pd.DataFrame(data)<br><br>df[&quot;daily_usage&quot;] = df[&quot;usage_90d&quot;] / 90<br><br>df[&quot;days_of_supply&quot;] = (<br>    df[&quot;stock&quot;] / df[&quot;daily_usage&quot;]<br>)<br><br>df[&quot;risk&quot;] = (<br>    df[&quot;days_of_supply&quot;] &lt; df[&quot;lead_time&quot;]<br>)<br><br>print(df[[<br>    &quot;material&quot;,<br>    &quot;days_of_supply&quot;,<br>    &quot;lead_time&quot;,<br>    &quot;risk&quot;<br>]])</pre><p>This basic model identifies materials whose estimated inventory coverage is shorter than their replenishment lead time.</p><p>It does not predict an equipment failure or guarantee a shortage. It simply highlights materials that warrant closer examination.</p><p>A production-ready model would also need to consider open purchase orders, reservations, safety stock, outstanding deliveries and scheduled maintenance demand.</p><h3>Step 4: Add Offshore-Specific Risk Factors</h3><p>This is where the analysis becomes more interesting.</p><p>A typical warehouse might focus primarily on consumption and supplier lead time.</p><p>An offshore warehouse must also consider the availability of transportation.</p><p>Suppose a material has 20 days of inventory coverage and a supplier lead time of 15 days.</p><p>On paper, everything looks fine.</p><p>But what happens if the next vessel is delayed by seven days?</p><p>The effective replenishment time could become 22 days, exceeding the remaining inventory coverage.</p><p>A simple scenario calculation can illustrate this:</p><pre>df[&quot;weather_delay&quot;] = [7, 7, 7, 7]<br><br>df[&quot;effective_lead_time&quot;] = (<br>    df[&quot;lead_time&quot;] +<br>    df[&quot;weather_delay&quot;]<br>)<br><br>df[&quot;offshore_risk&quot;] = (<br>    df[&quot;days_of_supply&quot;] &lt;<br>    df[&quot;effective_lead_time&quot;]<br>)</pre><p>Here, the seven-day delay is an illustrative assumption, not a weather forecast.</p><p>In reality, supplier lead time and offshore transportation time should be modeled separately to avoid double-counting delays.</p><p>More advanced models could use historical vessel schedules, delivery performance and seasonal weather disruptions to estimate a range of possible replenishment dates.</p><h3>Step 5: Prioritize by Consequence, Not Just Quantity</h3><p>There is one more important consideration.</p><p>Not every stockout has the same consequence.</p><p>Running out of a commonly available cleaning product is different from running out of a component required to restore safety-critical equipment.</p><p>A practical risk model should therefore incorporate:</p><p><strong>Inventory Risk + Operational Criticality + Replenishment Uncertainty</strong></p><p>For example:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/849/1*ivjgcFpE5oxj-ykVUDITuw.png" /></figure><p>These priorities are illustrative and would need to be validated against the organization’s actual maintenance and criticality classifications.</p><p>Data science helps identify the potential problem. Engineering, maintenance and materials-management professionals determine its operational significance.</p><h3>From Excel Reports to Predictive Inventory Management</h3><p>The next stage could involve machine learning.</p><p>With sufficient historical data, a forecasting model might estimate:</p><ul><li>Future material consumption</li><li>Supplier delivery variability</li><li>Probability of stockouts within a defined period</li><li>Unusual demand associated with maintenance activities</li></ul><p>However, machine learning is not always the best starting point.</p><p>A well-designed Excel dashboard or Python script can already provide considerable value, especially when it identifies risks that were previously hidden in thousands of SAP records.</p><p>For expensive and rarely used critical spares, reliability-based analysis and equipment failure history may be more appropriate than conventional demand forecasting.</p><p>The objective should always be better operational decisions, not algorithmic complexity.</p><h3>Bottom Line</h3><p>Offshore materials management is about much more than counting parts and maintaining stock balances.</p><p>It is about ensuring that the right material is available at the right location before its absence becomes an operational problem.</p><p>SAP provides the transaction history. Excel makes the information accessible. Python helps automate the analysis. And experienced warehouse professionals provide the context that numbers alone cannot capture.</p><p><strong>The real value of data science is not predicting that a $50 part will cause a $500,000 problem. It is helping prevent that problem from happening in the first place.</strong></p><p><em>Data Science on the Warehouse Floor explores how practical analytics, industrial experience and modern technology can improve warehouse operations, supply chains and materials management.</em></p><p><em>Next in the series: Can Machine Learning Predict the Next Offshore Inventory Shortage?</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b4e843ceb15b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How Data Science Can Improve Materials Management in Offshore Oil & Gas Industry]]></title>
            <link>https://medium.com/@cleitus/how-data-science-can-improve-materials-management-in-offshore-oil-gas-industry-011adca35447?source=rss-9dce1914b2d4------2</link>
            <guid isPermaLink="false">https://medium.com/p/011adca35447</guid>
            <category><![CDATA[oil-and-gas]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[sap]]></category>
            <category><![CDATA[material-management]]></category>
            <dc:creator><![CDATA[Igor Surzhyk]]></dc:creator>
            <pubDate>Sun, 27 Sep 2026 01:30:09 GMT</pubDate>
            <atom:updated>2026-09-27T01:30:09.239Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/599/1*LS_H7JBtY-h9QS1ebhwGCg.jpeg" /></figure><p>Offshore materials management has an unusual problem: the warehouse and the customer can be separated by hundreds of miles of ocean.</p><p>Onshore, discovering that a critical component is missing may mean arranging an urgent delivery. On an offshore installation, the same shortage can involve vessel schedules, helicopter capacity, weather restrictions and potentially expensive operational delays.</p><p>This makes offshore logistics an interesting area for data science. And the solution does not necessarily require sophisticated artificial intelligence. A combination of <strong>SAP data, Excel and relatively simple Python analysis</strong> can already provide valuable operational insights.</p><h3>From SAP Transactions to Data</h3><p>Every warehouse operation creates data.</p><p>Goods receipts, material issues, transfers, returns and adjustments gradually build a history of how materials move through the supply chain. In SAP environments, common movement types can include:</p><ul><li><strong>101</strong> — Goods Receipt against a purchase order</li><li><strong>261</strong> — Goods Issue to an order</li><li><strong>311</strong> — Transfer between storage locations</li></ul><p>The exact process depends on the SAP configuration and organization, but the underlying analytical opportunity is similar.</p><p>Instead of viewing these transactions individually, we can aggregate them by material, location and time period.</p><p>Imagine an Excel table:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/544/1*u5xkCXVRU8u9MX-3ziGWBA.png" /></figure><p>Immediately, the table tells us more than the stock quantity alone.</p><p>Having six units of something does not automatically mean inventory is low. Having fifty units does not automatically mean inventory is healthy. Stock only makes sense in relation to consumption, replenishment time and operational criticality.</p><h3>A Simple Reorder Model</h3><p>Python can turn this information into a basic risk indicator.</p><pre>import pandas as pd<br><br>df[&quot;daily_usage&quot;] = df[&quot;usage_90d&quot;] / 90<br><br>df[&quot;reorder_point&quot;] = (<br>    df[&quot;daily_usage&quot;] * df[&quot;lead_time&quot;]<br>    + df[&quot;safety_stock&quot;]<br>)<br><br>df[&quot;shortage_risk&quot;] = (<br>    df[&quot;stock&quot;] &lt; df[&quot;reorder_point&quot;]<br>)<br><br>print(<br>    df[[&quot;material&quot;, &quot;stock&quot;,<br>        &quot;reorder_point&quot;, &quot;shortage_risk&quot;]]<br>)</pre><p>This is not machine learning. It is simple arithmetic.</p><p>But operationally, it answers an important question:</p><p><strong>Which materials could reach a dangerous inventory level before normal replenishment arrives?</strong></p><p>For an offshore installation, the calculation could be improved further by incorporating the frequency of supply vessels, weather-related delays, minimum order quantities and alternative materials.</p><h3>Not Every Material Is Equally Important</h3><p>Consumption is only one dimension.</p><p>A frequently used cleaning product and an infrequently used critical valve should not necessarily receive the same inventory strategy.</p><p>One useful approach is to combine <strong>usage, lead time and criticality</strong>.</p><p>For example:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/546/1*cAx5keiF0gbdDDYmBBINew.png" /></figure><p>This is where operational knowledge becomes essential.</p><p>A model can identify unusual consumption, but an experienced materials specialist may know <em>why</em> it happened: planned maintenance, a turnaround, equipment failure, project activity or simply an incorrect SAP movement.</p><p>Data science should therefore support warehouse specialists rather than attempt to replace their judgement.</p><h3>Detecting Abnormal Consumption</h3><p>Historical SAP data can also reveal unusual changes.</p><p>Suppose a material normally has monthly consumption of:</p><p><strong>8 → 10 → 9 → 11 → 8 → 9 units</strong></p><p>and suddenly jumps to:</p><p><strong>31 units</strong></p><p>That deserves investigation.</p><p>A simple rolling calculation in Python can flag such cases:</p><pre>df[&quot;avg_usage&quot;] = (<br>    df[&quot;monthly_usage&quot;]<br>    .rolling(6)<br>    .mean()<br>)<br><br>df[&quot;deviation&quot;] = (<br>    df[&quot;monthly_usage&quot;]<br>    / df[&quot;avg_usage&quot;]<br>)<br><br>df[&quot;alert&quot;] = df[&quot;deviation&quot;] &gt; 2</pre><p>The spike might represent genuine demand. It might also indicate an unusual maintenance event, duplicate posting, incorrect quantity or another process issue.</p><p>Either way, the data tells us <strong>where to look first</strong>.</p><h3>From Reactive to Predictive Materials Management</h3><p>The biggest opportunity is moving from:</p><blockquote><em>“We are running out of this material.”</em></blockquote><p>to:</p><blockquote><em>“Based on consumption, lead time and the next offshore supply window, this material may become critical in three weeks.”</em></blockquote><p>More advanced models could eventually incorporate maintenance schedules, purchase-order history, equipment failure patterns, seasonal offshore activity and even weather-related logistics disruptions.</p><p>But sophisticated models should come later.</p><p>The first step is often much simpler: <strong>connect SAP transaction history with operational warehouse knowledge and ask better questions of the data.</strong></p><p>For offshore oil and gas, where a relatively inexpensive missing component can create disproportionately expensive logistical or operational consequences, even a simple analytical warning system can be valuable.</p><p>The best materials-management analytics may therefore not be the model with the most complicated algorithm.</p><p>It may be the one that identifies the right material <strong>before somebody offshore discovers that it is missing.</strong></p><h3>Bottom Line</h3><p>Data science in offshore materials management is not about replacing experienced warehouse professionals with algorithms. It is about combining their operational expertise with data-driven insights to make better decisions.</p><p>By integrating SAP data, Excel and Python, companies can identify potential shortages, optimize inventory levels, anticipate supply chain disruptions and reduce unnecessary logistics costs.</p><p>In offshore operations, the real value of data science is not simply predicting what might happen. It is providing enough time to act before it happens.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=011adca35447" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[From Transactions to Insights: Enhancing SAP WM with Python, R, and Excel]]></title>
            <link>https://medium.com/@cleitus/from-transactions-to-insights-enhancing-sap-wm-with-python-r-and-excel-5270d9aa227a?source=rss-9dce1914b2d4------2</link>
            <guid isPermaLink="false">https://medium.com/p/5270d9aa227a</guid>
            <category><![CDATA[excel]]></category>
            <category><![CDATA[sap]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[warehouse-management]]></category>
            <dc:creator><![CDATA[Igor Surzhyk]]></dc:creator>
            <pubDate>Sun, 22 Mar 2026 09:31:00 GMT</pubDate>
            <atom:updated>2026-03-22T09:31:00.581Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/832/1*TRDSrwXFX_jfx4cbdI0eZA.jpeg" /></figure><p>Warehouse Management in SAP WM is the backbone of many supply chain operations.</p><p>It ensures that inventory is tracked, bins are managed, and goods movements are executed efficiently. However, while SAP WM excels at processing transactions, it is not inherently designed for advanced analytics or predictive decision-making. This is where data analysts, equipped with Python, R, and Excel, can unlock significant value.</p><p>A modern data analyst can transform SAP WM data into actionable insights by combining these tools into a seamless workflow.</p><p>Python plays a critical role in automation and data integration. SAP WM data is often exported manually or accessed via interfaces such as RFC or APIs. With Python, analysts can automate this process and prepare datasets for analysis.</p><p>For example, a simple Python script can extract and analyze stock data to identify slow-moving inventory:</p><pre>import pandas as pd<br><br># Load SAP WM<br>export df = pd.read_csv(&quot;sap_wm_stock.csv&quot;)<br><br># Identify slow-moving items (no movement in last 90 days)<br>df[&#39;last_movement_date&#39;] = pd.to_datetime(df[&#39;last_movement_date&#39;])<br>slow_moving = df[df[&#39;last_movement_date&#39;] &lt; (pd.Timestamp.today() - pd.Timedelta(days=90))]<br><br>print(slow_moving[[&#39;material&#39;, &#39;storage_bin&#39;, &#39;quantity&#39;]])</pre><p>This kind of automation allows warehouse managers to proactively act on aging stock, reducing holding costs and freeing up space.</p><p>While Python is excellent for data handling, R shines in statistical analysis and forecasting. Using historical SAP WM data, analysts can predict future demand and optimize inventory levels.</p><p>For instance, forecasting product demand in R can be done using time series models:</p><pre>library(forecast)<br><br># Load historical<br>demand data demand &lt;- ts(read.csv(&quot;demand_history.csv&quot;)$quantity, frequency = 12)<br><br># Fit ARIMA model<br>model &lt;- auto.arima(demand)<br><br># Forecast next 6 months<br>forecast_values &lt;- forecast(model, h = 6)<br><br>print(forecast_values)</pre><p>With these forecasts, businesses can adjust safety stock levels and avoid both stockouts and overstocking - two of the most common warehouse challenges.</p><p>Excel, on the other hand, remains indispensable for communication and decision-making. While Python and R handle backend processing, Excel provides a familiar interface for stakeholders.</p><p>A typical workflow might involve exporting cleaned and enriched data into Excel, where pivot tables and dashboards are used to track key performance indicators such as:</p><ul><li>Inventory turnover</li><li>Order picking efficiency</li><li>Storage utilization</li></ul><p>For example, a pivot table can quickly summarize stock by storage type or highlight bottlenecks in picking operations, enabling managers to make fast, informed decisions without needing technical expertise.</p><p>The real power emerges when these tools are combined. Imagine a daily automated pipeline:</p><ul><li>Python extracts and cleans SAP WM data overnight</li><li>R generates demand forecasts and optimization metrics</li><li>Excel dashboards are refreshed and distributed to managers each morning</li></ul><p>This integrated approach transforms SAP WM from a transactional system into a decision-support platform. It reduces manual effort, improves accuracy, and enables proactive rather than reactive warehouse management.</p><p>In practice, such integration can lead to tangible improvements. Companies can optimize warehouse space by identifying underutilized bins, improve picking efficiency by analyzing travel times, and reduce excess inventory through better forecasting.</p><p>In conclusion, the combination of Python, R, and Excel empowers data analysts to extend the capabilities of SAP WM far beyond its core functions. As supply chains become increasingly data-driven, the ability to bridge operational systems with analytical tools is no longer optional - it is a key competitive advantage.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5270d9aa227a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Using AI in CPG Data Forecasting: Real-World Lessons from Nielsen Data]]></title>
            <link>https://medium.com/@cleitus/using-ai-in-cpg-data-forecasting-real-world-lessons-from-nielsen-data-2ebbd28be99e?source=rss-9dce1914b2d4------2</link>
            <guid isPermaLink="false">https://medium.com/p/2ebbd28be99e</guid>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[data-visualization]]></category>
            <category><![CDATA[cpg]]></category>
            <category><![CDATA[data-science]]></category>
            <dc:creator><![CDATA[Igor Surzhyk]]></dc:creator>
            <pubDate>Mon, 02 Feb 2026 21:31:01 GMT</pubDate>
            <atom:updated>2026-02-02T21:31:01.493Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lieZh5Pq7pBO14mPOgjBLQ.png" /></figure><p>Forecasting demand in Consumer Packaged Goods (CPG) has never been simple. Sales are shaped by promotions, pricing, distribution, seasonality, and competitive pressure — all interacting at once. Traditional forecasting methods often fail to capture this complexity, especially at SKU–store level.</p><p>AI is increasingly becoming the backbone of modern CPG forecasting, particularly when working with <strong>Nielsen POS and panel data</strong>.</p><h4>Why Traditional Models Struggle with Nielsen Data</h4><p>Nielsen datasets are rich but messy. They include weekly sales, price, promotion flags, distribution metrics (ACV, TDP), and product hierarchies across thousands of SKUs and retailers. Classical time-series models typically assume stable patterns, but in reality:</p><ul><li>Promotions distort baseline demand</li><li>Distribution changes drive false “growth” signals</li><li>Price elasticity varies by retailer and pack size</li></ul><p>For example, a price reduction visible in Nielsen POS data may appear to boost demand, while in reality the uplift comes from expanded distribution or feature support.</p><h3>How AI Improves Forecast Accuracy</h3><p>AI models are well-suited to extracting signal from noisy Nielsen data:</p><p><strong>1. Separating Baseline and Promo Lift</strong><br> Machine learning models can learn the true baseline demand by accounting for temporary promo effects. In Nielsen data, this helps distinguish sustainable demand from one-off feature-and-display spikes.</p><p><strong>2. Modeling Distribution Effects Explicitly</strong><br> By incorporating ACV and TDP as features, AI can correctly attribute sales growth to distribution gains rather than overestimating consumer demand.</p><p><strong>3. Capturing Price Sensitivity at Scale</strong><br> AI can model different price elasticities across retailers, regions, and pack sizes — something nearly impossible to do manually with thousands of time series.</p><p><strong>4. Smarter New Product Forecasts</strong><br> Using similarity across Nielsen product hierarchies (brand, subcategory, price tier), AI can generate reliable early forecasts for new SKUs with limited history.</p><h3>A Practical Example</h3><p>In a typical Nielsen-based FMCG setup, an AI model might forecast weekly sales at SKU–retailer level using:</p><ul><li>Historical unit sales</li><li>Base price and promo depth</li><li>Feature/display flags</li><li>ACV distribution</li><li>Seasonal and holiday signals</li></ul><p>The result is a more stable baseline forecast, clearer promo uplift estimates, and better scenario planning for pricing or distribution changes.</p><h3>AI Still Needs Humans</h3><p>AI does not replace planners. It provides a statistically sound baseline forecast, while humans handle future events, strategy shifts, and business judgment. The best results come from collaboration, not automation alone.</p><h3>Final Thought</h3><p>With the scale and complexity of Nielsen data, AI is no longer optional for CPG forecasting. When applied thoughtfully, it transforms raw POS data into actionable, forward-looking insights — helping CPG teams plan with confidence instead of guesswork.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2ebbd28be99e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[A/B Testing with Python and Excel]]></title>
            <link>https://medium.com/@cleitus/a-b-testing-with-python-and-excel-664aa8e1757f?source=rss-9dce1914b2d4------2</link>
            <guid isPermaLink="false">https://medium.com/p/664aa8e1757f</guid>
            <category><![CDATA[data-analysis]]></category>
            <category><![CDATA[a-b-testing]]></category>
            <category><![CDATA[statistics]]></category>
            <category><![CDATA[excel]]></category>
            <category><![CDATA[python]]></category>
            <dc:creator><![CDATA[Igor Surzhyk]]></dc:creator>
            <pubDate>Fri, 16 May 2025 08:32:26 GMT</pubDate>
            <atom:updated>2025-05-16T08:32:26.445Z</atom:updated>
            <content:encoded><![CDATA[<p>A/B testing is a powerful statistical method used to compare two versions of a product or service to determine which performs better. Whether you’re optimizing a marketing email, testing website layouts, or analyzing customer behavior, A/B testing provides data-driven guidance.</p><p>At its core, A/B testing compares two groups:</p><ul><li>Group A (control): The existing version.</li><li>Group B (treatment): The variant you want to test.</li></ul><p>You evaluate the performance of each based on a conversion metric, like <strong>click-through rate</strong> (CTR) or purchase rate.</p><p>Let’s assume you ran a marketing campaign:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/990/1*h335saHdQ1i9Dnr4534MdQ.png" /></figure><p>Conversion rates:</p><p>Group A: 120/1000 = 12%</p><p>Group B: 160/1050 ≈ 15.2%</p><p>Now let’s test if the difference is statistically significant.</p><h4>A/B Testing in Python</h4><p><strong>Step 1: Setup</strong></p><pre>import numpy as np<br>from statsmodels.stats.proportion import proportions_ztest<br>import matplotlib.pyplot as plt<br><br># Data<br>conversions = np.array([120, 160])<br>samples = np.array([1000, 1050])</pre><p><strong>Step 2: Run the Test</strong></p><pre>stat, pval = proportions_ztest(conversions, samples)<br>print(f&quot;Z-statistic: {stat:.2f}&quot;)<br>print(f&quot;P-value: {pval:.4f}&quot;)</pre><p><strong>Step 3: Interpret</strong></p><p>If the <strong>p-value</strong> &lt; 0.05, we reject the null hypothesis and conclude there’s a significant difference between Group A and B.</p><p><strong>Visualization in Python</strong></p><pre>labels = [&#39;Group A&#39;, &#39;Group B&#39;]<br>rates = conversions / samples<br><br>plt.bar(labels, rates, color=[&#39;skyblue&#39;, &#39;lightgreen&#39;])<br>plt.ylabel(&#39;Conversion Rate&#39;)<br>plt.title(&#39;A/B Test Conversion Comparison&#39;)<br>plt.ylim(0, 0.2)<br>plt.grid(axis=&#39;y&#39;, linestyle=&#39;--&#39;, alpha=0.7)<br>plt.show()</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/594/1*-cDrQZIIXJqnacqbYGEydg.png" /><figcaption>Group B outperforming Group A</figcaption></figure><h4><strong>A/B Testing in Excel</strong></h4><p>Let’s setup our data:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/814/1*X-0vrgmtzROdMnkGa0xtYw.png" /></figure><p>Calculating Pooled Rate Proportion:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/820/1*v3Ts8rlYEJzs0L6S7zBWbA.png" /><figcaption>the sum of conversions divided by the sum of users</figcaption></figure><p>Calculating Standard Error:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/819/1*_dqIgDZy25dnxQPFO5YxBA.png" /></figure><p>Calculating Z-Score:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/817/1*ka820BH2HULydP7JIi806A.png" /><figcaption>conversion rates diff divided by standard error</figcaption></figure><p>Calculating P-value:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/428/1*GC128VudzWKb2PU_TUlObA.png" /></figure><p>After making calculations we got the results:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/503/1*2mSbT4aubIl0azqQ6YLIjg.png" /><figcaption>if p-value &lt; 0.05 we consider it as a statistically significant result</figcaption></figure><h4><strong>Conclusion</strong></h4><p>A/B testing is essential for data-driven decision-making. Python provides flexibility, scalability, and statistical depth, while Excel is great for small-scale, manual analysis. Mastering both can significantly enhance your analytical skills.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=664aa8e1757f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Processing FMCG/CPG Data on Python and Excel with Examples]]></title>
            <link>https://medium.com/@cleitus/processing-fmcg-cpg-data-on-python-and-excel-with-examples-fc83f3dfc93f?source=rss-9dce1914b2d4------2</link>
            <guid isPermaLink="false">https://medium.com/p/fc83f3dfc93f</guid>
            <category><![CDATA[data-analysis]]></category>
            <category><![CDATA[excel]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[fmcg]]></category>
            <category><![CDATA[cpg]]></category>
            <dc:creator><![CDATA[Igor Surzhyk]]></dc:creator>
            <pubDate>Sat, 22 Mar 2025 10:02:43 GMT</pubDate>
            <atom:updated>2025-03-22T10:02:43.523Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/670/1*FeY6f_tJP_TnuFl3HsVARg.png" /></figure><p>Fast-Moving Consumer Goods (FMCG) and Consumer Packaged Goods (CPG) industries rely heavily on data analysis for decision-making.</p><p>Effective processing and visualization of sales, inventory, and customer data can help companies optimize supply chains, improve marketing strategies, and predict future trends. This guide will demonstrate how to handle FMCG/CPG data using Python and Excel with practical examples.</p><h3>1. Overview of FMCG/CPG Data</h3><p>FMCG/CPG data typically includes:</p><ul><li><strong>Sales Data</strong>: Information about products sold, quantities, revenues, and profit margins.</li><li><strong>Inventory Data</strong>: Stock levels, replenishment rates, and warehouse data.</li><li><strong>Customer Data</strong>: Purchase patterns, demographic details, and preferences.</li><li><strong>Market Data</strong>: Competitor pricing, promotions, and market trends.</li></ul><h3>Challenges in FMCG/CPG Data Processing</h3><ul><li>High volume and velocity of data.</li><li>Integration of data from multiple sources.</li><li>Need for real-time insights.</li></ul><h3>2. Using Python for FMCG/CPG Data Processing</h3><p>Python offers powerful libraries for data analysis, such as Pandas, NumPy, and Matplotlib. Let’s explore some common tasks.</p><h3>2.1 Data Cleaning</h3><p>Cleaning data is the first step in any analysis.</p><pre>import pandas as pd<br><br># Load data<br>data = pd.read_csv(&#39;sales_data.csv&#39;)<br><br># Check for missing values<br>print(data.isnull().sum())<br><br># Fill or drop missing values<br>data.fillna(0, inplace=True)</pre><h3>2.2 Data Aggregation</h3><p>Aggregate data to analyze sales trends.</p><pre># Aggregate sales by product<br>sales_by_product = data.groupby(&#39;Product&#39;)[&#39;Sales&#39;].sum()<br>print(sales_by_product)</pre><h3>2.3 Visualization</h3><p>Visualize data to gain insights.</p><pre>import matplotlib.pyplot as plt<br><br># Plot sales by product<br>sales_by_product.plot(kind=&#39;bar&#39;)<br>plt.title(&#39;Sales by Product&#39;)<br>plt.xlabel(&#39;Product&#39;)<br>plt.ylabel(&#39;Sales&#39;)<br>plt.show()</pre><h3>3. Using Excel for FMCG/CPG Data Processing</h3><p>Excel is widely used for data analysis in FMCG/CPG industries due to its accessibility and user-friendly interface.</p><h3>3.1 Pivot Tables</h3><p>Pivot tables are a powerful tool to summarize data.</p><ol><li>Select your dataset.</li><li>Go to the <strong>Insert</strong> tab and click on <strong>PivotTable</strong>.</li><li>Drag fields to the Rows, Columns, and Values areas to analyze data.</li></ol><h3>3.2 Conditional Formatting</h3><p>Highlight trends or outliers with conditional formatting:</p><ol><li>Select the data range.</li><li>Go to the <strong>Home</strong> tab and click on <strong>Conditional Formatting</strong>.</li><li>Choose rules like “Greater Than” or “Data Bars.”</li></ol><h3>3.3 Formulas</h3><p>Use formulas for calculations:</p><ul><li><strong>SUM</strong>: =SUM(A1:A10) to total sales.</li><li><strong>AVERAGE</strong>: =AVERAGE(B1:B10) for average sales.</li><li><strong>IF</strong>: =IF(C1&gt;100,&quot;High&quot;,&quot;Low&quot;) for conditional logic.</li></ul><h3>4. Combining Python and Excel</h3><p>Python can complement Excel by automating repetitive tasks and handling larger datasets.</p><h3>Example: Exporting Python Analysis to Excel</h3><pre># Export aggregated data to Excel<br>sales_by_product.to_excel(&#39;sales_by_product.xlsx&#39;, sheet_name=&#39;Sales Summary&#39;)</pre><h3>Example: Reading Excel Files in Python</h3><pre># Read Excel file<br>data = pd.read_excel(&#39;inventory_data.xlsx&#39;)<br>print(data.head())</pre><h3>5. Practical Use Case: Sales Forecasting</h3><h3>Step 1: Data Preparation</h3><p>Load and clean historical sales data.</p><pre># Load sales data<br>data = pd.read_csv(&#39;historical_sales.csv&#39;)<br><br># Extract relevant columns<br>data = data[[&#39;Date&#39;, &#39;Sales&#39;]]<br>data[&#39;Date&#39;] = pd.to_datetime(data[&#39;Date&#39;])<br>data.set_index(&#39;Date&#39;, inplace=True)</pre><h3>Step 2: Apply a Forecasting Model</h3><p>Use the ARIMA model for time series forecasting.</p><pre>from statsmodels.tsa.arima.model import ARIMA<br><br># Fit ARIMA model<br>model = ARIMA(data[&#39;Sales&#39;], order=(1, 1, 1))<br>results = model.fit()<br><br># Forecast future sales<br>forecast = results.forecast(steps=30)<br>print(forecast)</pre><h3>Step 3: Export Forecasts to Excel</h3><pre># Save forecast to Excel<br>forecast.to_excel(&#39;sales_forecast.xlsx&#39;, sheet_name=&#39;Forecast&#39;)</pre><h3>6. Conclusion</h3><p>Processing FMCG/CPG data efficiently is key to making informed business decisions. Python’s flexibility and Excel’s accessibility provide a robust toolkit for analyzing and visualizing data. Combining these tools enables businesses to unlock valuable insights and maintain a competitive edge.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fc83f3dfc93f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Understanding Data Normalization with Python]]></title>
            <link>https://medium.com/@cleitus/understanding-data-normalization-with-python-e05080abdf3a?source=rss-9dce1914b2d4------2</link>
            <guid isPermaLink="false">https://medium.com/p/e05080abdf3a</guid>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[python]]></category>
            <dc:creator><![CDATA[Igor Surzhyk]]></dc:creator>
            <pubDate>Fri, 20 Dec 2024 11:02:36 GMT</pubDate>
            <atom:updated>2024-12-20T11:02:36.330Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Uu2Euj9bZ8T4Uua8XlNYYQ.jpeg" /></figure><p>Data normalization is a preprocessing technique crucial in data analysis and data science, used to rescale data values within a consistent range, making datasets comparable across different scales. It improves model performance, particularly for algorithms sensitive to data scale, like k-nearest neighbors and neural networks.</p><h4>Why Normalize Data?</h4><p>Data normalization ensures that each feature contributes proportionally to the model, without being disproportionately dominant due to differences in magnitude. For example, in a dataset containing both age (0–100) and income (in thousands), without normalization, the income feature may overshadow the age feature, potentially biasing the model.</p><p>There are several normalization techniques, each suitable for specific use cases:</p><ol><li>Min-Max Normalization (Rescaling)</li><li>Z-Score Normalization (Standardization)</li><li>Decimal Scaling Normalization</li></ol><h4>1. Min-Max Normalization (Rescaling)</h4><p>This technique scales values to a fixed range, typically<strong> [0,1]</strong>. It can be calculated using the formula:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/282/1*mOB6ppWmkdk1ULsKwMPMjw.jpeg" /><figcaption>where x is the original value</figcaption></figure><p><strong>Implementation in Python:</strong></p><pre>import numpy as np<br>from sklearn.preprocessing import MinMaxScaler<br>import matplotlib.pyplot as plt<br><br># Generating sample data<br><br>data = np.array([[120], [90], [180], [150], [200], [160]])<br><br># Applying Min-Max normalization<br><br>scaler = MinMaxScaler()<br>normalized_data = scaler.fit_transform(data)<br><br># Plotting the results<br><br>plt.figure(figsize=(10, 5))<br>plt.plot(data, label=&#39;Original Data&#39;)<br>plt.plot(normalized_data, label=&#39;Min-Max Normalized Data&#39;)<br>plt.legend()<br>plt.title(&#39;Min-Max Normalization&#39;)<br>plt.xlabel(&#39;Sample&#39;)<br>plt.ylabel(&#39;Value&#39;)<br>plt.show()</pre><p>The <strong>MinMaxScaler</strong> scales the values to a range of<strong> [0,1]</strong>, allowing each feature to have an equal impact on the model.</p><h4>2. Z-Score Normalization (Standardization)</h4><p>Standardization is another popular normalization technique, where values are rescaled based on their mean and standard deviation. The formula is:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/193/1*nGRLkAt9ZhUVWqZ-hL0Caw.png" /><figcaption>x is the original value, μ is the mean and σ is the standard deviation of the dataset</figcaption></figure><p>This method results in a distribution with a mean of 0 and a standard deviation of 1.</p><p><strong>Implementation in Python:</strong></p><pre>from sklearn.preprocessing import StandardScaler<br><br># Applying Z-Score normalization<br><br>scaler = StandardScaler()<br>standardized_data = scaler.fit_transform(data)<br><br># Plotting the results<br><br>plt.figure(figsize=(10, 5))<br>plt.plot(data, label=&#39;Original Data&#39;)<br>plt.plot(standardized_data, label=&#39;Z-Score Normalized Data&#39;)<br>plt.legend()<br>plt.title(&#39;Z-Score Normalization&#39;)<br>plt.xlabel(&#39;Sample&#39;)<br>plt.ylabel(&#39;Value&#39;)<br>plt.show()</pre><p>Standardization is especially useful for algorithms like Support Vector Machine (SVM) and logistic regression, which assume normal distribution.</p><h4>3. Decimal Scaling Normalization</h4><p>In decimal scaling, values are divided by a power of 10 so that the values range within a defined range (e.g.,<strong> [−1,1]</strong>). The formula is:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/179/1*8AtJzF4-STitPtI5xeMGJw.png" /><figcaption>where j is the smallest integer such that ∣x′∣&lt;1</figcaption></figure><p><strong>Implementation in Python:</strong></p><pre># Applying Decimal Scaling<br><br>j = np.ceil(np.log10(np.max(np.abs(data))))<br>decimal_scaled_data = data / (10 ** j)<br><br># Plotting the results<br><br>plt.figure(figsize=(10, 5))<br>plt.plot(data, label=&#39;Original Data&#39;)<br>plt.plot(decimal_scaled_data, label=&#39;Decimal Scaled Data&#39;)<br>plt.legend()<br>plt.title(&#39;Decimal Scaling Normalization&#39;)<br>plt.xlabel(&#39;Sample&#39;)<br>plt.ylabel(&#39;Value&#39;)<br>plt.show()</pre><h4>When to Use Which Normalization?</h4><ul><li><strong>Min-Max Normalization</strong> is suitable when the data does not have extreme outliers and when preserving the relationships among values is important.</li><li><strong>Z-Score Normalization</strong> is more robust when there are outliers, as it standardizes values based on deviation rather than scaling.</li><li><strong>Decimal Scaling</strong> is relatively uncommon but can be useful for datasets requiring scaling within a specific range quickly.</li></ul><h4>Summary</h4><p>Normalization helps transform data into a format suitable for machine learning, improving model accuracy and convergence. Python libraries like scikit-learn provide straightforward implementations, enabling quick and efficient data normalization to optimize model performance.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e05080abdf3a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Introduction to FMCG/CPG Data]]></title>
            <link>https://medium.com/@cleitus/introduction-to-fmcg-cpg-data-478c107923fe?source=rss-9dce1914b2d4------2</link>
            <guid isPermaLink="false">https://medium.com/p/478c107923fe</guid>
            <category><![CDATA[cpg]]></category>
            <category><![CDATA[data-analysis]]></category>
            <category><![CDATA[data]]></category>
            <category><![CDATA[fmcg]]></category>
            <category><![CDATA[forecasting]]></category>
            <dc:creator><![CDATA[Igor Surzhyk]]></dc:creator>
            <pubDate>Tue, 05 Nov 2024 12:02:18 GMT</pubDate>
            <atom:updated>2024-11-05T12:02:18.355Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/612/1*CjkHhFB1YNLgvS9I8YyC5w.jpeg" /></figure><p>In today’s world, the Fast-Moving Consumer Goods (FMCG) and Consumer Packaged Goods (CPG) industries play a crucial role in delivering essential items to consumers. With increasing competition, these industries are more data-driven than ever, using data analysis to better understand consumer trends, optimize supply chains, manage inventory, and drive marketing strategies. In this text, we’ll explore how data analysis for FMCG/CPG can be done effectively.</p><h4>Understanding FMCG/CPG Data</h4><p>The FMCG and CPG sectors encompass products that are sold quickly and at relatively low cost, such as food, beverages, snacks, home cleaning goods, toiletries, and over-the-counter drugs. The data generated in this sector is vast and multifaceted, covering everything from point-of-sale (POS) data and inventory metrics to customer feedback and promotional effectiveness. Key types of FMCG/CPG data include:</p><ul><li><strong>Sales data</strong>: Tracks quantities sold, revenue generated, and geographical distribution of sales.</li><li><strong>Inventory data</strong>: Monitors stock levels, turnover rates, and storage efficiency.</li><li><strong>Consumer data</strong>: Includes demographic information, buying behaviors, and preferences.</li><li><strong>Marketing data</strong>: Covers advertising reach, response rates, and promotional impact.</li></ul><h4>Importance of FMCG/CPG Data Analysis</h4><p>Data analysis in FMCG/CPG domain helps brands understand consumer preferences, forecast demand, optimize pricing, manage inventory, and improve marketing strategies. A few core objectives in such data analysis include:</p><ol><li><strong>Sales Analysis:</strong> Tracking sales trends and understanding what drives volume in different channels, seasons, or regions.</li><li><strong>Consumer Behavior:</strong> Identifying what factors influence buying behavior, enabling brands to tailor marketing and promotions.</li><li><strong>Supply Chain Optimization:</strong> Ensuring availability of products at the right place and time, reducing stockout and overstocking.</li><li><strong>Competitive Analysis:</strong> Monitoring market share and pricing in relation to competitors to adjust strategies effectively.</li></ol><h4>Key Metrics in FMCG/CPG Data Analysis</h4><p>Analyzing FMCG data revolves around tracking certain critical metrics:</p><ul><li><strong>Sales Volume (or Sales Units):</strong> Total units sold over a specific period.</li><li><strong>Revenue (Sales Value):</strong> Total income generated from product sales, often analyzed by region, product line, or distribution channel.</li><li><strong>Market Distribution:</strong> A metric describing the distribution of a certain product in the network (for example, the number of outlets selling this product).</li><li><strong>Market Share:</strong> The brand’s share of total sales within the category, important for competitive benchmarking.</li><li><strong>Promotional Effectiveness:</strong> Evaluating the impact of discounts, campaigns, and other marketing efforts on sales volume and revenue.</li><li><strong>Inventory Turnover:</strong> Measures how quickly stock is sold and replaced, providing insights into supply chain efficiency.</li><li><strong>Customer Lifetime Value (CLV):</strong> The projected revenue from a customer over the entire relationship, helping target high-value segments.</li></ul><h4>Preliminary Conclusion</h4><p>Analyzing FMCG/CPG data helps companies make data-driven decisions in production, pricing, promotions, inventory management, and customer engagement. With effective data analysis practices, FMCG companies can meet consumer expectations, gain competitive advantage, and optimize business performance in a rapidly changing market.</p><p><em>To be continued</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=478c107923fe" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Understanding Correlation Function with Examples]]></title>
            <link>https://medium.com/codex/understanding-correlation-function-with-examples-b39364687f5c?source=rss-9dce1914b2d4------2</link>
            <guid isPermaLink="false">https://medium.com/p/b39364687f5c</guid>
            <category><![CDATA[python]]></category>
            <category><![CDATA[excel]]></category>
            <category><![CDATA[mathematics]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[correlation]]></category>
            <dc:creator><![CDATA[Igor Surzhyk]]></dc:creator>
            <pubDate>Wed, 16 Oct 2024 10:11:01 GMT</pubDate>
            <atom:updated>2024-10-17T11:27:35.417Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*GMnIcT8R1-uRTTCQuULe8Q.png" /></figure><p>The correlation function measures the strength and direction of a linear relationship between two variables.</p><p>Correlation helps in identifying whether an increase in one variable corresponds to an increase or decrease in another. Correlation coefficients range between -1 and 1, where 1 signifies a perfect positive correlation, -1 a perfect negative correlation, and 0 no correlation.</p><p>Here we are going to talk about <strong>Pearson correlation</strong> and provide examples how to run it in Python and MS Excel.</p><p>Pearson correlation is the most widely used type. It measures the linear relationship between two continuous variables.</p><p>For two variables 𝑋 and 𝑌, the Pearson correlation 𝑟 is calculated as:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/298/1*LRnEnniqUnuqKuv1dc560A.png" /></figure><p>Using <strong>Python</strong>, the Pearson correlation can be computed easily with libraries like Pandas</p><pre>import pandas as pd<br><br># Sample data<br><br>data = {&#39;x&#39;: [2, 4, 8, 16, 32], &#39;y&#39;: [12, 24, 36, 48, 60]}<br>df = pd.DataFrame(data)<br><br># Calculate Pearson correlation<br>  <br>correl = df[&#39;x&#39;].corr(df[&#39;y&#39;])<br>print(f&quot;Pearson correlation: {correl}&quot;)</pre><p>This code computes the Pearson correlation between two columns x and y, providing a direct measure of their relationship.</p><p>In <strong>Excel</strong>, you can calculate correlation using the CORREL function:</p><ol><li>Enter your data into two columns, say A and B.</li><li>In a new cell, use the formula:<br>=CORREL(A1:A5, B1:B5)</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/349/1*pfw47OBLjSOkhToghRDInQ.png" /></figure><p>This function will output the correlation coefficient between the two sets of values. For current data points our coefficient is <em>9.33E-01</em>.</p><p>Interpretation of the output is the next:</p><ul><li><strong>Positive correlation</strong> (closer to 1): As one variable increases, the other increases.</li><li><strong>Negative correlation</strong> (closer to -1): As one variable increases, the other decreases.</li><li><strong>Zero correlation</strong>: No relationship.</li></ul><p><strong>Summary. </strong>Understanding correlation is crucial for data analysis, helping identify relationships between variables. Both Python and Excel offer simple methods for calculating correlation. While Python is better for large datasets and advanced analytics, Excel provides an easy-to-use interface for basic analysis.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b39364687f5c" width="1" height="1" alt=""><hr><p><a href="https://medium.com/codex/understanding-correlation-function-with-examples-b39364687f5c">Understanding Correlation Function with Examples</a> was originally published in <a href="https://medium.com/codex">CodeX</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>