<?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 Agba Frank Onwuchekwa on Medium]]></title>
        <description><![CDATA[Stories by Agba Frank Onwuchekwa on Medium]]></description>
        <link>https://medium.com/@frankgodwin796?source=rss-58de6c90983c------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*5gUIctuX_AMomz5jLCpSAQ.jpeg</url>
            <title>Stories by Agba Frank Onwuchekwa on Medium</title>
            <link>https://medium.com/@frankgodwin796?source=rss-58de6c90983c------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 29 Nov 2026 14:29:55 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@frankgodwin796/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[ The Day I Stopped Looking at Microsoft Fabric as a Collection of Tools]]></title>
            <link>https://medium.com/@frankgodwin796/the-day-i-stopped-looking-at-microsoft-fabric-as-a-collection-of-tools-8607dd936e00?source=rss-58de6c90983c------2</link>
            <guid isPermaLink="false">https://medium.com/p/8607dd936e00</guid>
            <category><![CDATA[data-engineering]]></category>
            <category><![CDATA[analytics-engineering]]></category>
            <category><![CDATA[data-analytics]]></category>
            <category><![CDATA[microsoft-fabric]]></category>
            <category><![CDATA[data-architecture]]></category>
            <dc:creator><![CDATA[Agba Frank Onwuchekwa]]></dc:creator>
            <pubDate>Wed, 26 Aug 2026 08:01:03 GMT</pubDate>
            <atom:updated>2026-08-26T08:01:03.705Z</atom:updated>
            <content:encoded><![CDATA[<h4>My transition from Data Analytics to Analytics Engineering is changing the way I think about data.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*62XJqpjLbg62nxf-JE-tBw.png" /></figure><p>For a long time, I looked at analytics from the place where most analysts naturally start.</p><p><strong>How do I get the data?</strong></p><p>How do I clean it?</p><p>How do I calculate the KPI?</p><p>How do I build the dashboard?</p><p>How do I turn the numbers into something the business can understand?</p><p>Those questions are still important.</p><p>But as I transition from <strong>Data Analytics into Analytics Engineering</strong>, I am beginning to ask a different class of questions.</p><blockquote><em>💭 Where should this data live?<br>🔐 Who should have access to it?<br>📈 What happens when the data grows significantly?<br>🔄 Should we copy the data or reference it?<br>🏢 How should different teams work with the same data?<br>⚡ How do we build an environment that remains performant as the organization grows?</em></blockquote><p>And perhaps the most important question:</p><blockquote><strong><em>How will the technical decisions we make today affect the organization’s ability to make decisions tomorrow?</em></strong></blockquote><p>That is where Microsoft Fabric has started becoming much more interesting to me.</p><p>I am not learning Fabric simply because it is another tool to add to my resume.</p><p>I am learning it because I want to understand <strong>what happens before the dashboard.</strong></p><h3>🔎 From Dashboards to the Systems Behind Them</h3><p>As a Data Analyst, I have spent a lot of time thinking about the final layer of the analytics process.</p><p>📊 The dashboard.</p><p>📈 The KPI.</p><p>💡 The insight.</p><p>🎯 The recommendation.</p><p>But the quality of that final output depends heavily on everything underneath it.</p><p>A beautifully designed dashboard cannot compensate for:</p><p>❌ Duplicated data<br>❌ Poor governance<br>❌ Inconsistent business logic<br>❌ Inefficient storage<br>❌ Unclear ownership<br>❌ An architecture that cannot scale</p><p>This realization is one of the reasons I became interested in <strong>Analytics Engineering</strong>.</p><p>Analytics Engineering sits at an interesting intersection.</p><p>It connects the <strong>engineering side of data</strong> with the <strong>analytical side of the business</strong>.</p><p>You are not simply moving data from one place to another.</p><p>You are thinking about how data should be:</p><p><strong>Structured.<br>Transformed.<br>Governed.<br>Optimized.<br>Trusted.<br>Made available for decision making.</strong></p><p>And that changes how I am looking at Microsoft Fabric.</p><p>Instead of asking:</p><blockquote><em>❌ </em>“What does this feature do?”</blockquote><p>I am increasingly asking:</p><blockquote><em>✅ </em><strong><em>“What organizational problem does this feature solve?”</em></strong></blockquote><p>That question changes everything.</p><h3>🏢 Understanding Fabric Through an Organizational Lens</h3><p>One of the first areas I have been studying is the architecture around:</p><p><strong>Tenant → Capacity → Workspace → Domain → OneLake</strong></p><p>At first glance, these can look like administrative or technical concepts.</p><p>But they influence something much bigger:</p><p><strong>How an organization structures ownership, security, compute and data.</strong></p><p>A Fabric tenant sits within an organization’s Microsoft environment, while capacities provide the compute resources used by Fabric workloads. Workspaces provide collaborative environments for Fabric items, while domains can help organize workspaces around business areas.</p><p>The important lesson for me is this:</p><blockquote><em>🧠 </em><strong><em>Architecture is also an organizational decision.</em></strong></blockquote><p>Imagine a company with:</p><p>💰 Finance<br>📦 Operations<br>🛒 Sales<br>📣 Marketing</p><p>If every team creates its own disconnected data environment, the organization can quickly end up with:</p><p><strong>Sales Revenue</strong><br><strong>Finance Revenue</strong><br><strong>Marketing Revenue</strong><br><strong>Operations Revenue</strong></p><p>And suddenly, the company has four different answers to what should be a very simple question:</p><blockquote><strong><em>“How much revenue did we make?”</em></strong></blockquote><p>The technical problem has now become a <strong>business problem</strong>.</p><p>That is why concepts such as workspace organization, domains, governance and shared data platforms matter.</p><p>They are not just Fabric administration.</p><p>They are mechanisms for creating a more reliable analytical organization.</p><h3>🌊 OneLake Changed How I Think About Data Duplication</h3><p>One of the concepts that has particularly caught my attention is <strong>OneLake</strong>.</p><p>Microsoft describes OneLake as a unified data lake for the organization, providing a common storage layer across Fabric workloads.</p><p>The idea sounds simple.</p><p>But the organizational implications are significant.</p><p>Consider a company where five teams need access to the same customer data.</p><p>The traditional approach can eventually become:</p><p><strong>Copy → Transform → Store → Share → Copy again → Transform again</strong></p><p>Now imagine doing that across hundreds of datasets.</p><p>The organization has not only created additional storage requirements.</p><p>It has created <strong>data synchronization problems</strong>.</p><p>Which copy is correct?</p><p>Which one is most recent?</p><p>Who owns it?</p><p>What happens when the source changes?</p><p>How do we know every downstream copy has been updated?</p><p>This is where a unified data layer becomes interesting.</p><p>OneLake is designed to provide a common organizational data lake across Fabric, helping reduce data silos and unnecessary duplication.</p><p>And this made me think about something beyond the technology:</p><blockquote><em>💡 </em><strong><em>Good data architecture is partly about reducing unnecessary decisions.</em></strong></blockquote><p>If analysts do not have to constantly ask:</p><p><strong>“Which copy of this data is the correct one?”</strong></p><p>they can spend more time asking:</p><p><strong>“What does this data actually tell us?”</strong></p><p>That is valuable to an organization.</p><h3>🔗 Shortcuts Made Me Rethink What “Moving Data” Means</h3><p>Another concept I am exploring is <strong>OneLake Shortcuts</strong>.</p><p>My first instinct was to think about data movement.</p><p>But shortcuts introduced a different architectural question:</p><blockquote><strong><em>“Do we actually need to move the data?”</em></strong></blockquote><p>A shortcut can reference data in another location without creating another physical copy of the source data.</p><p>That can be useful when organizations want to make data available across environments while reducing unnecessary duplication.</p><p>Think about the potential organizational impact:</p><p>💾 Less unnecessary duplication</p><p>🔄 Fewer synchronization processes</p><p>💰 Potentially lower storage requirements</p><p>🛡️ Fewer copies that need to be governed</p><p>🏗️ Simpler data architecture</p><p>This is where I am beginning to understand something important about Analytics Engineering:</p><blockquote><strong><em>The job is not simply to make data available.</em></strong></blockquote><blockquote><strong><em>The job is to make data available in a way that is sustainable.</em></strong></blockquote><h3>🔄 Mirroring: Separating Operational and Analytical Workloads</h3><p>Then there is <strong>Mirroring</strong>.</p><p>This introduces another important architectural question.</p><p>Imagine an organization running a transactional database that handles thousands or millions of operational transactions.</p><p>At the same time, analysts need to calculate:</p><p>📊 Daily transaction volume</p><p>👥 Customer activity</p><p>💰 Revenue</p><p>🚨 Fraud indicators</p><p>⚙️ Operational performance</p><p>If analytical queries constantly compete with the operational workload, there is a potential conflict.</p><p>The system that exists to <strong>run the business</strong> is also being asked to support the system that exists to <strong>analyze the business</strong>.</p><p>That is not necessarily a good architectural pattern.</p><p>Mirroring can make source data available within OneLake with low latency, depending on the supported source and scenario.</p><p>The bigger lesson for me is not simply:</p><blockquote>“Fabric has a mirroring feature.”</blockquote><p>It is:</p><blockquote><em>🧠 </em><strong><em>How should analytical workloads consume operational data without unnecessarily affecting the systems that run the business?</em></strong></blockquote><p>That is a much more interesting question.</p><p>And that is the kind of problem I want to become better at solving.</p><h3>🏞️ Lakehouse: Where My Analyst Mindset Meets Engineering</h3><p>The <strong>Lakehouse</strong> concept is probably where my existing analyst background starts connecting most directly with what I am learning.</p><p>A Fabric Lakehouse combines flexible file based storage with structured Delta tables.</p><p>The Files area can contain different types of files, while the Tables area provides structured analytical tables using Delta Lake.</p><p>This matters because real organizations rarely have only clean relational tables.</p><p>They have:</p><p>📄 CSV files<br>🧾 JSON<br>📦 Parquet<br>🖼️ Images<br>📝 Application logs<br>🗄️ Operational databases<br>📡 Streaming data<br>📊 Structured business data</p><p>The challenge is not simply:</p><blockquote><strong><em>“Where can we store all of this?”</em></strong></blockquote><p>The bigger question is:</p><blockquote><strong><em>“How should all of this move from raw information into trustworthy analytical assets?”</em></strong></blockquote><p>That is much closer to the problem I want to solve as an Analytics Engineer.</p><h3>⚙️ Delta Lake Is More Important Than I Initially Thought</h3><p>Another part of my learning has been understanding why <strong>Delta Lake</strong> is so important within the Fabric ecosystem.</p><p>At first, I saw Delta as another technical component.</p><p>But it represents something much more important.</p><p>Delta Lake provides a transactional layer that supports capabilities such as ACID transactions and allows different analytical engines to work with the same underlying data.</p><p>Think about a modern analytics environment.</p><p>You might have:</p><p>🐍 Spark transforming data</p><p>🗃️ SQL querying data</p><p>📊 Power BI consuming data</p><p>🔄 Data Factory moving data</p><p>And multiple workloads interacting with the same analytical foundation.</p><p>The value is not simply having multiple tools.</p><p>The value comes from having an environment where those tools can <strong>work together around a consistent data foundation</strong>.</p><p>That is one of the architectural ideas I am beginning to appreciate:</p><blockquote><em>🔥 </em><strong><em>The goal is not to build isolated tools.</em></strong></blockquote><blockquote><strong><em>The goal is to build an ecosystem where the tools work together.</em></strong></blockquote><h3>🧑🏽‍💻 The SQL Analytics Endpoint: Connecting Engineering and Analytics</h3><p>Coming from a Data Analytics background, this is particularly interesting to me.</p><p>A Fabric Lakehouse provides a SQL Analytics Endpoint that allows users to query the Lakehouse’s Delta tables using T SQL in a read only environment.</p><p>Think about what this creates.</p><p>👨🏽‍💻 Engineers can work with the underlying data.</p><p>🧑🏽‍💼 Analysts can use familiar SQL.</p><p>📊 Power BI can consume analytical data.</p><p>🏢 The organization can work from a shared data foundation.</p><p>This creates an important bridge between the engineering and analytics worlds.</p><p>And it reinforces an idea I find increasingly important:</p><blockquote><strong><em>Good architecture should not force everyone in an organization to work the same way.</em></strong></blockquote><p>Engineers can use engineering tools.</p><p>Analysts can use SQL.</p><p>Business users can consume reports.</p><p>But everyone can work from a governed analytical foundation.</p><h3>⚡ Data Optimization Is Not Just a Technical Exercise</h3><p>Another area I have started exploring is <strong>Delta table optimization</strong>.</p><p>This includes concepts such as:</p><p>🔹 Compaction<br>🔹 V Order<br>🔹 Partitioning<br>🔹 Liquid clustering</p><p>At first, these sound like purely technical performance topics.</p><p>But performance eventually becomes a <strong>business problem</strong>.</p><p>If a dashboard takes 30 seconds to load, people wait.</p><p>If it takes five minutes, people stop using it.</p><p>If analytical workloads require excessive compute, costs can increase.</p><p>If poorly designed tables force queries to process unnecessary data, the organization eventually pays for that inefficiency.</p><p>V Order, for example, is a write time optimization intended to improve downstream read performance for analytical workloads.</p><p>Partitioning can also be valuable for particular workloads, while current Fabric guidance discusses newer approaches such as liquid clustering for certain read performance scenarios.</p><p>This has changed the way I think about performance.</p><p>Previously, I might have asked:</p><blockquote><em>❌ </em><strong><em>“How can I make this query faster?”</em></strong></blockquote><p>I am now starting to ask:</p><blockquote><em>✅ </em><strong><em>“How should the data be designed so that the query does not have to do unnecessary work in the first place?”</em></strong></blockquote><p>That is an engineering mindset.</p><h3>🧠 The Bigger Lesson</h3><p>The most interesting part of this transition so far is that I am realizing that <strong>Analytics Engineering is not about leaving analytics behind.</strong></p><p>It is about going deeper.</p><p>As a Data Analyst, I learned to ask:</p><h3>What happened?</h3><h3>Why did it happen?</h3><h3>What should the business do?</h3><p>As I move toward Analytics Engineering, I am adding another layer:</p><blockquote><strong><em>Can we build the data foundation that allows the organization to answer those questions reliably, repeatedly and at scale?</em></strong></blockquote><p>That is the shift I am interested in.</p><p>I do not want to learn Microsoft Fabric simply so I can say:</p><blockquote>“I know Microsoft Fabric.”</blockquote><p>I want to understand how its architecture can help an organization:</p><p>✅ Reduce unnecessary data duplication<br>✅ Improve analytical performance<br>✅ Protect operational systems<br>✅ Create clearer ownership<br>✅ Improve governance<br>✅ Make trusted data easier to discover<br>✅ Support different analytical workloads<br>✅ Help people make better decisions</p><p>Because there is something I will always believe strongly:</p><blockquote><em>📊 A dashboard is not the final product.</em></blockquote><blockquote><strong><em>Better decisions are.</em></strong></blockquote><p>And better decisions require more than a good visualization.</p><p>They require a <strong>good data foundation</strong>.</p><h3>🚀 From Data Analyst to Analytics Engineer</h3><p>This transition is therefore becoming less about collecting new tools and more about changing the way I think.</p><p>I am moving from:</p><p><strong>“How do I analyze this data?”</strong></p><p>toward:</p><p><strong>“How should this data be designed, governed and delivered so that the organization can analyze it reliably?”</strong></p><p>From:</p><p><strong>“How do I build the dashboard?”</strong></p><p>toward:</p><p><strong>“What data architecture makes this dashboard trustworthy?”</strong></p><p>From:</p><p><strong>“How do I make this query faster?”</strong></p><p>toward:</p><p><strong>“How should the data be designed so that unnecessary work is avoided?”</strong></p><p>And from:</p><p><strong>“What does this technology do?”</strong></p><p>toward:</p><p><strong>“What business problem does this technology help solve?”</strong></p><p>That is the mindset I want to develop.</p><p>Not just the ability to use another platform.</p><p>But the ability to understand the <strong>relationship between data architecture, engineering decisions and business outcomes.</strong></p><h3>🌱 Documenting the Journey Differently</h3><p>I am documenting this transition from <strong>Data Analyst to Analytics Engineer</strong> not as a list of tutorials completed.</p><p>I want to document:</p><p>🔹 The concepts I am learning<br>🔹 The architectural decisions behind them<br>🔹 The organizational problems they solve<br>🔹 The trade offs involved<br>🔹 The impact on cost and performance<br>🔹 The implications for governance and scalability<br>🔹 And, most importantly, how all of this eventually affects business decision making</p><p>Because I believe that is where the real growth happens.</p><blockquote><strong><em>I do not just want to understand the technology.</em></strong></blockquote><blockquote><strong><em>I want to understand why the organization needs it.</em></strong></blockquote><p>And perhaps that is the biggest shift happening in my journey right now.</p><p>The next time I look at a dashboard, I do not just want to understand the chart.</p><p>I want to understand the <strong>architecture behind the chart.</strong></p><p>I want to understand where the data came from.</p><p>How it moved.</p><p>Why it was stored that way.</p><p>Who owns it.</p><p>How it was transformed.</p><p>How it was optimized.</p><p>And whether the organization can trust it.</p><p>Because ultimately:</p><h3>🚀 Good analytics starts with good data.</h3><h3>And good data starts with good engineering.</h3><h3>👋 This is only the beginning.</h3><p>I am documenting my transition from <strong>Data Analytics → Analytics Engineering</strong>, one architectural concept and one real world business problem at a time.</p><p>If you are also working around <strong>Data Analytics, Analytics Engineering, Microsoft Fabric, Data Engineering or Modern Data Platforms</strong>, I would love to hear how you approach these problems.</p><p><strong>What would you prioritize first when designing an analytics platform for a growing organization?</strong></p><p>#DataAnalytics #AnalyticsEngineering #MicrosoftFabric #DataEngineering #OneLake #DataArchitecture #DataAnalyticsJourney #Microsoft #DataPlatform</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8607dd936e00" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Beyond Dashboards: Using Data Analytics to Improve Logistics Performance ]]></title>
            <link>https://medium.com/@frankgodwin796/beyond-dashboards-using-data-analytics-to-improve-logistics-performance-249fcacac29b?source=rss-58de6c90983c------2</link>
            <guid isPermaLink="false">https://medium.com/p/249fcacac29b</guid>
            <category><![CDATA[power-bi]]></category>
            <category><![CDATA[logistics]]></category>
            <category><![CDATA[supply-chain]]></category>
            <category><![CDATA[data-analytics]]></category>
            <category><![CDATA[business-intelligence]]></category>
            <dc:creator><![CDATA[Agba Frank Onwuchekwa]]></dc:creator>
            <pubDate>Fri, 21 Aug 2026 17:38:55 GMT</pubDate>
            <atom:updated>2026-08-21T17:38:55.606Z</atom:updated>
            <content:encoded><![CDATA[<h4>How I used Power BI to connect customer behavior, shipment value, carrier performance, warehouse capacity, and operational risk</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Lllnq6kEI6iuIz0OfwE4lw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*60-FXz0gjwzktCrvEAiB3g.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*N07CVfYd9bRafHFnKowCQg.png" /></figure><p>Logistics is not simply about moving goods from point A to point B.</p><p>Behind every shipment are questions about <strong>cost, delivery performance, warehouse capacity, customer satisfaction, carrier reliability, damage, and profitability.</strong></p><p>The challenge is not whether logistics companies have data.</p><p>The challenge is whether they can turn that data into <strong>better decisions.</strong></p><p>That was the thinking behind my latest Power BI project, <strong>Logistics Intelligence &amp; Performance Analytics</strong>.</p><p>Rather than building a dashboard simply to display KPIs, I wanted to answer a more important question:</p><blockquote><strong><em>What can logistics data tell us about where value is being created, where operational efficiency is being lost, and where management should intervene?</em></strong></blockquote><p>I structured the analysis across three perspectives:</p><ol><li>👥 <strong>Customer &amp; Order Performance</strong></li><li>🌍 <strong>Shipment &amp; Trade Flow</strong></li><li>🚚 <strong>Logistics &amp; Carrier Performance</strong></li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Lllnq6kEI6iuIz0OfwE4lw.png" /></figure><h3>1. Customer &amp; Order Performance 👥</h3><p>The first dashboard looks at the commercial side of the business.</p><p>It brings together:</p><ul><li>Total Order Value</li><li>Acquisition Cost</li><li>Customer Satisfaction</li><li>Days to Payment</li><li>Support Tickets</li><li>Market Segment performance</li></ul><p>One of the most important ideas here is that <strong>growth should not be viewed in isolation</strong>.</p><p>A company can increase order value while simultaneously spending more to acquire customers, receiving more support tickets, or waiting longer for payments.</p><p>That may look like growth on a traditional report.</p><p>Analytics tells a different story.</p><h4>Acquisition efficiency matters 💰</h4><p>The dashboard compares <strong>Average Order Value against Total Acquisition Cost across market segments</strong>.</p><p>This helps answer:</p><blockquote><strong><em>Are we spending efficiently to generate customer value?</em></strong></blockquote><p>A segment producing strong order value but requiring disproportionately high acquisition spending may need a different strategy from a segment generating similar value at a lower acquisition cost.</p><p>This can support decisions around:</p><ul><li>Acquisition budget allocation</li><li>Customer targeting</li><li>Segment strategy</li><li>Marketing efficiency</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*60-FXz0gjwzktCrvEAiB3g.png" /></figure><h3>2. Shipment &amp; Trade Flow 🌍</h3><p>The second dashboard moves from the customer to the physical movement of goods.</p><p>It examines:</p><ul><li>Shipment Value</li><li>Freight Cost</li><li>Shipment Volume</li><li>Customs Clearance</li><li>Export Value</li><li>Destination Countries</li><li>Product Categories</li><li>On Time Delivery</li></ul><p>The dashboard shows <strong>7M in shipment value, 358K in freight cost, and 60 shipments</strong> for the selected period.</p><p>But the real insight is not the numbers individually.</p><p>It is the relationship between them.</p><h3>Shipment volume does not tell the whole story 📦</h3><p>Two periods could process the same number of shipments but carry completely different financial value.</p><p>A logistics operation therefore needs to think about <strong>value at risk</strong>, not just shipment count.</p><p>High value shipments may deserve:</p><ul><li>Enhanced tracking</li><li>Stronger carrier controls</li><li>Better insurance coverage</li><li>Faster exception handling</li><li>Greater damage prevention measures</li></ul><p>This is one reason operational analytics needs to go beyond volume.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*N07CVfYd9bRafHFnKowCQg.png" /></figure><h3>3. Logistics &amp; Carrier Performance 🚛</h3><p>The third dashboard focuses on operational efficiency.</p><p>It brings together:</p><ul><li>Shipments Processed</li><li>Delay Hours</li><li>Warehouse Utilization</li><li>Damage Claims</li><li>Fuel Price</li><li>Carrier performance</li><li>Regional performance</li></ul><p>This page answers a simple but important question:</p><blockquote><strong><em>How efficiently is the logistics operation actually running?</em></strong></blockquote><h3>Carrier volume does not equal carrier performance</h3><p>A carrier processing the most shipments is not automatically the best carrier.</p><p>Performance needs to be considered across multiple dimensions:</p><p><strong>Volume + Delay + Damage + Reliability + Cost</strong></p><p>A carrier handling high volume but experiencing significantly more delays or damage claims could represent a greater operational risk.</p><p>This creates an opportunity for businesses to move from simple carrier selection to <strong>data driven carrier scorecards.</strong></p><h3>One of the Most Interesting Findings: Warehouse Utilization 🏭</h3><p>The warehouse utilization analysis revealed a significant regional difference.</p><h4>Asia Pacific — 93.0</h4><h4>Europe — 74.0</h4><h4>North America — 72.8</h4><p>At first glance, high utilization may appear positive.</p><p>But consistently operating close to maximum capacity can also create risk.</p><p>High utilization leaves less room to absorb unexpected shipment increases.</p><p>That can eventually contribute to:</p><ul><li>Congestion</li><li>Slower processing</li><li>Handling errors</li><li>Longer loading times</li><li>Reduced operational flexibility</li></ul><h3>Strategic implication 🎯</h3><p>Asia Pacific may require closer capacity planning.</p><p>Potential responses could include:</p><ul><li>Expanding warehouse capacity</li><li>Rebalancing inventory</li><li>Improving warehouse throughput</li><li>Using third party logistics capacity</li><li>Forecasting demand more aggressively</li></ul><p>The key lesson is:</p><blockquote><strong><em>High utilization is not automatically good.</em></strong></blockquote><p>There is an optimal operating range.</p><h3>Connecting the Dots 🔗</h3><p>The biggest value of this project is not any individual chart.</p><p>It is the <strong>relationship between the metrics</strong>.</p><p>For example:</p><h4>Customer Performance 👥</h4><p><em>Acquisition Cost → Order Value → Satisfaction → Support Tickets</em></p><h4>Shipment Economics 📦</h4><p><em>Shipment Value → Freight Cost → Shipment Volume</em></p><h4>Operational Performance ⚙️</h4><p><em>Shipment Volume → Delays → Damage → Warehouse Utilization</em></p><h4>Regional Risk 🌍</h4><p><em>Region → Shipment Value → Utilization → Damage → Delays</em></p><p>Looking at these relationships allows an organization to move beyond:</p><blockquote><em>“What happened?”</em></blockquote><p>toward:</p><blockquote><strong><em>“Why might it be happening, and where should we investigate?”</em></strong></blockquote><h3>From Dashboard to Decision Making 🎯</h3><p>This is where I believe data analytics can have a real impact on logistics.</p><p>The objective should not be to produce another monthly report.</p><p>It should be to help decision makers answer questions such as:</p><p><strong>Should we increase warehouse capacity in a high utilization region?</strong></p><p><strong>Which carriers should receive more shipment allocation?</strong></p><p><strong>Which market segments are generating the strongest value relative to acquisition cost?</strong></p><p><strong>Which destinations represent concentration risk?</strong></p><p><strong>Which product categories require greater logistics attention?</strong></p><p><strong>Where are delays and damages occurring disproportionately?</strong></p><p>These are operational and strategic questions.</p><p>The dashboard simply provides the evidence needed to investigate them.</p><h3>Why This Matters 🚀</h3><p>The logistics sector generates enormous amounts of operational data.</p><p>Every shipment creates a record.</p><p>Every carrier creates performance information.</p><p>Every warehouse generates capacity signals.</p><p>Every delay creates an operational event.</p><p>Every damaged shipment creates a cost.</p><p>Individually, these records may seem insignificant.</p><p>At scale, they can reveal patterns that directly affect <strong>cost, customer experience, capacity, and profitability.</strong></p><p>That is where I see the role of the modern data analyst.</p><p>Not simply as someone who creates dashboards.</p><p>But as someone who can take operational data, identify meaningful relationships, uncover risks, and translate those findings into <strong>actions the business can take.</strong></p><h3>Final Thought 💡</h3><p>I didn’t build this project simply to demonstrate that I can use Power BI.</p><p>I built it to demonstrate how analytics can be applied to a real industry problem.</p><p>Because the dashboard is not the final product.</p><p><strong>Better decision making is.</strong></p><p>And in a sector as complex and data intensive as logistics, I believe that difference matters. 🚚📊</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=249fcacac29b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ How I Built Interactive KPI Cards in Power BI Using DAX, HTML… and ChatGPT]]></title>
            <link>https://medium.com/@frankgodwin796/how-i-built-interactive-kpi-cards-in-power-bi-using-dax-html-and-chatgpt-201d627cedc5?source=rss-58de6c90983c------2</link>
            <guid isPermaLink="false">https://medium.com/p/201d627cedc5</guid>
            <category><![CDATA[data-visualization]]></category>
            <category><![CDATA[html]]></category>
            <category><![CDATA[power-bi]]></category>
            <category><![CDATA[storytelling]]></category>
            <category><![CDATA[dax]]></category>
            <dc:creator><![CDATA[Agba Frank Onwuchekwa]]></dc:creator>
            <pubDate>Tue, 14 Apr 2026 02:41:54 GMT</pubDate>
            <atom:updated>2026-04-14T02:41:54.115Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*omMU8B4AGXJoerRz-PcCPw.png" /></figure><p>When most people start using Power BI, they focus on:</p><ul><li>bar charts</li><li>line charts</li><li>tables</li></ul><p>And that’s fine.</p><p>But at some point, I wanted more.</p><p>I wanted my dashboard to feel like a <strong>real product interface</strong> , something clean, interactive, and modern. Something that doesn’t just show numbers, but <strong>explains them instantly</strong>.</p><p>There was just one problem:</p><p>👉 I understood DAX<br>👉 I understood my data<br>👉 But I had <strong>zero knowledge of HTML or CSS</strong></p><p>So how did I build interactive KPI cards with hover effects, flip animations, and storytelling?</p><p>👉 I combined what I knew (DAX) with what I didn’t (HTML)… using ChatGPT.</p><p>This article breaks down everything — step by step — so even a beginner can follow.</p><h3>🎯 The Goal</h3><p>I wasn’t trying to build just another dashboard.</p><p>I wanted KPI cards that:</p><ul><li>React when you hover</li><li>Show additional insights</li><li>Compare current vs previous performance</li><li>Feel like a modern app UI</li></ul><p>Metrics I focused on:</p><ul><li>Units Sold</li><li>Cost</li><li>Sales</li><li>Profit</li></ul><h3>🧱 Step 1: Build Your Foundation (DAX Measures)</h3><p>Before any design, you need <strong>solid measures</strong>.</p><p>Let’s start simple.</p><h3>🔹 Total Cost</h3><pre>Total Cost = SUM(financials[COGS])</pre><h3>What this does:</h3><ul><li>Takes the COGS column (Cost of Goods Sold)</li><li>Adds everything together</li><li>Returns your total cost</li></ul><h3>🔹 Previous Month Cost</h3><pre>PM Cost = <br>CALCULATE(<br>    [Total Cost],<br>    DATEADD(DateTable[Date], -1, MONTH)<br>)</pre><h3>Let’s break this down:</h3><ul><li>CALCULATE() → changes the filter context</li><li>DATEADD() → shifts the date back by one month</li></ul><p>👉 Result: You now have <strong>last month’s cost</strong></p><h3>🔹 Month-over-Month Change (%)</h3><pre>MoM Cost % = <br>VAR CurrCost = [Total Cost]<br>VAR PMCost = [PM Cost]</pre><pre>RETURN<br>IF(<br>    HASONEVALUE(DateTable[Month Name]) &amp;&amp; PMCost &lt;&gt; 0,<br>    DIVIDE(CurrCost - PMCost, PMCost),<br>    BLANK()<br>)</pre><h3>Why this matters:</h3><ul><li>CurrCost - PMCost → gives the difference</li><li>Dividing by PMCost → gives percentage change</li><li>HASONEVALUE() → ensures the calculation works properly per month</li></ul><p>👉 This iswhat powers your KPI comparison.</p><h3>🧠 Important Concept: Separate Logic from Display</h3><p>In DAX, you should always separate:</p><ul><li>Calculation</li><li>Formatting</li></ul><p>Example:</p><pre>VAR _units = [Total Units Sold]<br>VAR _unitsDisplay = FORMAT(_units, &quot;#,0&quot;)</pre><h3>Why?</h3><ul><li>_units → raw number (used for calculations)</li><li>_unitsDisplay → formatted string (used for UI)</li></ul><h3>🤖 Step 2: Where ChatGPT Changed Everything</h3><p>Here’s the honest part of my workflow.</p><p>I didn’t know HTML.</p><p>So instead of trying to master CSS animations and layouts from scratch, I did this:</p><h3>My Process:</h3><ol><li>I designed (or found) a KPI card I liked</li><li>Took a screenshot of it</li><li>Found an existing HTML template</li><li>Dropped both into ChatGPT</li><li>Asked ChatGPT to adapt it to my data</li></ol><p>Something like:</p><blockquote><em>“Use this template, match this design, and connect it to my Power BI measures”</em></blockquote><h3>🎥 Helpful Resource (Highly Recommended)</h3><p>If you’re new to this kind of approach, especially combining <strong>DAX with HTML in Power BI</strong> , this video will help you understand the concept much better:</p><p>👉 I personally recommend watching this before or alongside this guide, it makes everything click faster.</p><p><a href="https://www.youtube.com/watch?v=Gy6HNGBiaq8&amp;t=34s">CLICK HERE</a></p><h3>💡 What ChatGPT Actually Helped With</h3><p>ChatGPT helped me:</p><ul><li>Convert my design idea into HTML structure</li><li>Write CSS for layout and styling</li><li>Add hover interactions (flip, slide, blink)</li><li>Insert DAX variables into HTML</li><li>Fix bugs when visuals didn’t render</li></ul><p>👉 It basically became the <strong>bridge between design and data</strong></p><h3>🧩 Step 3: Building the KPI Card (HTML + DAX)</h3><p>Let’s look at your Units Sold card.</p><p>From your implementation:</p><h3>🔹 Dynamic Values</h3><pre>VAR _unitsDisplay = FORMAT(_units, &quot;#,0&quot;)</pre><p>This value is injected into HTML like this:</p><pre>&lt;div class=&#39;metric&#39;&gt;&quot; &amp; _unitsDisplay &amp; &quot;&lt;/div&gt;</pre><p>👉 This is how Power BI displays dynamic data inside HTML.</p><h3>🔹 Handling Percentage Changes</h3><pre>VAR _unitsVarDisplay = <br>IF(<br>    ISBLANK(_unitsVar),<br>    &quot;--&quot;,<br>    FORMAT(ABS(_unitsVar), &quot;0.00&quot;) &amp; &quot;%&quot;<br>)</pre><h3>Why ABS?</h3><p>Because you separate:</p><ul><li>Sign (+ / -)</li><li>Value (number)</li></ul><h3>🔹 Sign Logic</h3><pre>VAR _unitsVarSign = <br>IF(ISBLANK(_unitsVar), &quot;&quot;, IF(_unitsVar &gt;= 0, &quot;+&quot;, &quot;-&quot;))</pre><p>👉 Ensures clean display like:</p><ul><li>+5.2%</li><li>-3.1%</li></ul><h3>🎨 Step 4: Styling with CSS</h3><p>Your card’s look is controlled by CSS:</p><pre>.kc{<br>  border-radius:14px;<br>  background:#FFFFFF;<br>  border:3px solid #5C3D2E;<br>}</pre><h3>What this does:</h3><ul><li>Rounded edges</li><li>Clean white background</li><li>Branded border</li></ul><h3>🔄 Step 5: Adding Interactivity (Hover Effects)</h3><p>This is where your dashboard becomes powerful.</p><h3>Example:</h3><pre>.kc:hover .front{opacity:0}<br>.kc:hover .back{opacity:1}</pre><h3>What happens:</h3><ul><li>Front disappears</li><li>Back appears</li><li>User sees more detail</li></ul><h3>🪞 Front vs Back Design</h3><pre>&lt;div class=&#39;front&#39;&gt;...&lt;/div&gt;<br>&lt;div class=&#39;back&#39;&gt;...&lt;/div&gt;</pre><ul><li>Front → summary</li><li>Back → explanation</li></ul><p>👉 This turns your KPI into a <strong>storytelling component</strong></p><h3>🧠 Step 6: Context Awareness (Dates)</h3><pre>VAR _selectedMonthYear = FORMAT(_selectedDate, &quot;mmm-yyyy&quot;)<br>VAR _priorMonthYear = FORMAT(_priorDate, &quot;mmm-yyyy&quot;)</pre><p>This allows your card to dynamically say:</p><blockquote><em>“+5% vs Aug-2025”</em></blockquote><h3>🎯 Step 7: Conditional Formatting (Colors)</h3><pre>VAR _badgeClass = IF(_costVar &gt;= 0, &quot;badge-down&quot;, &quot;badge-up&quot;)</pre><h3>Why reversed?</h3><p>Because:</p><ul><li>Increase in cost = bad → red</li><li>Decrease in cost = good → green</li></ul><p>👉 This is business logic, not just visuals.</p><h3>🔥 Step 8: Advanced Cards (Profit &amp; Sales)</h3><p>I went further by building:</p><h3>💰 Profit Card</h3><ul><li>Progress bar</li><li>Target tracking</li><li>Status labels</li></ul><pre>VAR _barWidth = MIN(_attain,1) * 100</pre><p>👉 Controls how full the progress bar is.</p><h3>🔄 Interactions You Built</h3><ul><li>Flip → Cost</li><li>Blink → Units</li><li>Slide → Profit</li><li>Hero → Sales &amp; Profit</li></ul><p>👉 Each card feels unique, but still consistent.</p><h3>💎 Step 9: What Makes This Special</h3><p>This isn’t just Power BI anymore.</p><p>You combined:</p><ul><li>Data (DAX)</li><li>Design (HTML/CSS)</li><li>AI (ChatGPT)</li></ul><p>👉 That’s a <strong>hybrid workflow</strong></p><h3>🧠 What I Learned</h3><ol><li>You don’t need to know everything</li><li>You need to know how to <strong>use tools effectively</strong></li><li>Design matters as much as logic</li><li>Storytelling makes dashboards powerful</li></ol><h3>🚀 Final Thoughts</h3><p>Before this project:</p><ul><li>I built dashboards</li></ul><p>After this project:</p><ul><li>I design experiences</li></ul><p>And the biggest lesson?</p><p>👉 ChatGPT didn’t replace my skills<br>👉 It amplified them</p><h3>🙌 If You’re a Beginner</h3><p>Start here:</p><ol><li>Learn basic DAX</li><li>Build your measures</li><li>Think about how you want it to look</li><li>Use ChatGPT to translate design into HTML</li><li>Iterate</li></ol><p>You don’t need to know everything to build something impressive.</p><h3>🔥 Closing Line</h3><p>Because at the end of the day…</p><p>👉 Data isn’t just numbers<br>👉 It’s a story waiting to be told</p><p>And now, you have the tools to tell it 🚀</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=201d627cedc5" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ Building an End-to-End Fraud Detection System with 6.6]]></title>
            <link>https://medium.com/@frankgodwin796/building-an-end-to-end-fraud-detection-system-with-6-6-8aa03434c5b3?source=rss-58de6c90983c------2</link>
            <guid isPermaLink="false">https://medium.com/p/8aa03434c5b3</guid>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[fraud-detection]]></category>
            <category><![CDATA[python]]></category>
            <dc:creator><![CDATA[Agba Frank Onwuchekwa]]></dc:creator>
            <pubDate>Wed, 08 Apr 2026 16:42:57 GMT</pubDate>
            <atom:updated>2026-04-08T16:42:57.735Z</atom:updated>
            <content:encoded><![CDATA[<h3>💳 Building an End-to-End Fraud Detection System with 6.6 Million Transactions (From Data to Deployment)</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TD-UXPSA4iiLedVFLIdyVg.png" /></figure><p>Fraud detection is one of the most critical applications of machine learning in today’s digital economy. With millions of transactions happening every second, even a tiny percentage of fraud can result in massive financial losses.</p><p>In this project, I built a <strong>machine learning-powered fraud detection system</strong> using a dataset of <strong>over 6.6 million transaction records, </strong>making this not just a typical ML project, but a <strong>big data problem</strong>.</p><p>From data exploration to deployment, this project reflects a complete real-world pipeline.</p><h3>🚀 Live Demo</h3><p>You can interact with the deployed application here:<br> <a href="https://fraud-detection-app796.streamlit.app/">https://fraud-detection-app796.streamlit.app/</a></p><h3>📌 Problem Statement</h3><p>The goal was straightforward:</p><p>Detect fraudulent transactions from a large-scale dataset of online payments.</p><p>But the complexity lies in two major challenges:</p><ol><li><strong>Scale of Data</strong><br> Working with <strong>6.6 million rows</strong> means:</li></ol><ul><li>Memory management becomes important</li><li>Computations take longer</li><li>Efficient processing is required</li></ul><p><strong>2. Class Imbalance</strong><br> Fraud cases are extremely rare compared to legitimate transactions.</p><p>This introduces a critical business concern:</p><ul><li>Missing fraud (False Negative) = financial loss</li><li>Incorrectly flagging users (False Positive) = poor user experience</li></ul><p>Because of this, I focused heavily on <strong>Recall (Fraud Detection Rate)</strong> rather than just accuracy.</p><h3>📊 Understanding the Dataset</h3><p>The dataset includes:</p><ul><li>Transaction type (e.g., PAYMENT, TRANSFER)</li><li>Transaction amount</li><li>Account balances before and after transactions</li><li>Fraud label (isFraud)</li></ul><h3>Initial Exploration</h3><p>I began by inspecting the dataset structure, checking for missing values, and understanding distributions.</p><p>Key findings:</p><ul><li>No major missing data</li><li>Strong class imbalance</li><li>Financial variables dominate the dataset</li></ul><p>Handling a dataset of this size required being mindful of performance while still extracting meaningful insights.</p><h3>🔍 Exploratory Data Analysis</h3><p>Exploratory analysis revealed important behavioral patterns:</p><ul><li>Fraudulent transactions were significantly fewer</li><li>Higher transaction amounts showed stronger fraud tendencies</li><li>Certain transaction types (TRANSFER and CASH_OUT) were more associated with fraud</li><li>Balance-related variables showed strong relationships</li></ul><p>Using visualizations like distribution plots, boxplots, and correlation heatmaps helped uncover these patterns.</p><h3>🧠 Feature Engineering — The Turning Point</h3><p>One of the most important steps in this project was creating new features that reflect <strong>transaction behavior</strong>.</p><p>I introduced:</p><ul><li>Balance difference for sender</li><li>Balance difference for receiver</li></ul><p>These features capture inconsistencies such as:</p><ul><li>Money leaving an account without proper balance updates</li><li>Sudden abnormal changes in balances</li></ul><p>This step significantly improved the model’s ability to detect fraud.</p><h3>⚙️ Data Preprocessing</h3><p>To prepare the data for modeling:</p><ul><li>Converted categorical transaction types into numerical values</li><li>Removed irrelevant columns such as account IDs and flags</li><li>Defined input features and target variable</li></ul><p>I also split the data into training and testing sets to evaluate model performance on unseen data.</p><h3>Model Building and Comparison</h3><p>I experimented with multiple machine learning models to find the best approach.</p><h3>Logistic Regression</h3><p>This served as a baseline model but performed poorly in detecting fraud due to its simplicity.</p><h3>Random Forest</h3><p>This model performed significantly better:</p><ul><li>Captured complex patterns</li><li>Improved fraud detection rate</li><li>More stable and reliable</li></ul><h3>HistGradientBoosting</h3><p>This model achieved the highest recall but introduced complexity during deployment.</p><h3>Final Model Decision</h3><p>Even though HistGradientBoosting had slightly better performance, I selected:</p><p><strong>Random Forest</strong></p><p>Why?</p><ul><li>Easier to deploy and debug</li><li>Stable performance</li><li>Strong recall without added complexity</li></ul><p>This reflects an important real-world lesson:<br> The best model is not always the most complex one — it is the most practical and reliable.</p><h3>Model Saving</h3><p>To prepare for deployment, I saved:</p><ul><li>The trained model</li><li>The feature column structure</li></ul><p>This ensured consistency between training and real-world predictions.</p><h3>Building the Web Application</h3><p>To make the model accessible, I built an interactive application using Streamlit.</p><p>The app allows users to:</p><ul><li>Input transaction details</li><li>Simulate real-world scenarios</li><li>Receive:</li><li>Fraud probability (in percentage)</li><li>Clear classification (Fraud or Legitimate)</li></ul><p>A key part of this process was ensuring that:</p><ul><li>Feature engineering in the app matched the training process</li><li>Input data aligned exactly with the model’s expected structure</li></ul><h3>Challenges Faced</h3><p>This project involved several real-world challenges:</p><h3>Working with Large Data (6.6M rows)</h3><ul><li>Slower computations</li><li>Need for efficient processing</li><li>Careful handling during analysis</li></ul><h3>Deployment Issues</h3><ul><li>Missing model files during deployment</li><li>Incorrect file naming</li><li>Path-related errors</li></ul><h3>Model Serialization Mistakes</h3><p>Initially misused pickle, which resulted in errors when loading the model.</p><h3>Encoding Consistency</h3><p>Ensuring that categorical encoding in deployment matched training was critical to avoid incorrect predictions.</p><h3>Deployment</h3><p>The final application was deployed using Streamlit Cloud, making it publicly accessible and usable in real time.</p><p>This step transformed the project from a notebook into a <strong>production-style machine learning solution</strong>.</p><h3>Business Impact</h3><p>This solution can be applied in:</p><ul><li>FinTech platforms</li><li>Digital banking systems</li><li>Payment gateways</li></ul><p>It helps:</p><ul><li>Reduce financial losses due to fraud</li><li>Improve transaction monitoring</li><li>Build trust in digital payment systems</li></ul><h3>Future Improvements</h3><ul><li>Handle class imbalance with advanced techniques like SMOTE</li><li>Add model explainability (SHAP or LIME)</li><li>Deploy as an API for integration into larger systems</li><li>Implement real-time fraud detection pipelines</li></ul><h3>About Me</h3><p>Frank Agba<br> Data Analyst | Aspiring Data Scientist</p><p>Portfolio: <a href="https://frankagba.base44.app/">https://frankagba.base44.app/</a><br> LinkedIn: <a href="http://www.linkedin.com/in/frank-agba">http://www.linkedin.com/in/frank-agba</a><br> Twitter (X): <a href="https://x.com/agba_frank796">https://x.com/agba_frank796</a><br> Medium: <a href="https://medium.com/@frankgodwin796">https://medium.com/@frankgodwin796</a><br> GitHub: <a href="https://github.com/InsightByFrank">https://github.com/InsightByFrank</a></p><h3>Final Thoughts</h3><p>This project goes beyond building a model. It represents:</p><ul><li>Working with <strong>large-scale (6.6 million) real-world data</strong></li><li>Making thoughtful modeling decisions</li><li>Solving deployment challenges</li></ul><p>Most importantly, it reinforces a key principle:</p><h3>Machine learning is not just about building models — it’s about solving real-world problems effectively.</h3><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8aa03434c5b3" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Building and Deploying a Flight Booking Prediction App with Machine Learning and Streamlit]]></title>
            <link>https://medium.com/@frankgodwin796/building-and-deploying-a-flight-booking-prediction-app-with-machine-learning-and-streamlit-5defc1f4333c?source=rss-58de6c90983c------2</link>
            <guid isPermaLink="false">https://medium.com/p/5defc1f4333c</guid>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[british-airways]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[ml-model-deployment]]></category>
            <category><![CDATA[big-data]]></category>
            <dc:creator><![CDATA[Agba Frank Onwuchekwa]]></dc:creator>
            <pubDate>Thu, 05 Mar 2026 14:29:25 GMT</pubDate>
            <atom:updated>2026-03-05T14:29:25.833Z</atom:updated>
            <content:encoded><![CDATA[<p><em>From data exploration to deploying a live machine learning application.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rkSLKQiRgKxTW2xXGl4G4Q.png" /></figure><p>Machine learning projects are often demonstrated in notebooks, but the real value comes when a model becomes something <strong>people can actually interact with</strong>.</p><p>In this project, I built an <strong>end-to-end machine learning application</strong> that predicts whether a customer is likely to complete a flight booking based on their travel behavior and add-on selections.</p><p>The final result is an interactive web app where users can input travel details and instantly receive a prediction.</p><p><strong>Live App:</strong><br><a href="https://british-airways-booking-prediction.streamlit.app/">https://british-airways-booking-prediction.streamlit.app/</a></p><p><strong>Project Repository:</strong><br><a href="https://github.com/InsightByFrank/british-airways-booking-prediction">https://github.com/InsightByFrank/british-airways-booking-prediction</a></p><p><strong>Connect with me on LinkedIn:</strong><br><a href="https://www.linkedin.com/in/frank-agba">https://www.linkedin.com/in/frank-agba</a></p><h3>Project Overview</h3><p>Airline companies collect large amounts of behavioral data from users browsing their websites. Understanding <strong>which users are likely to complete a booking</strong> can help companies:</p><ul><li>optimize marketing strategies</li><li>personalize offers</li><li>improve customer conversion rates</li></ul><p>In this project, I built a <strong>classification model</strong> that predicts booking completion using customer travel information and booking behavior.</p><p>The project includes:</p><ul><li>Data preprocessing and feature engineering</li><li>Training a machine learning model</li><li>Saving the trained model</li><li>Building an interactive web interface</li><li>Deploying the application online</li></ul><h3>Dataset and Problem Statement</h3><p>The dataset contains behavioral information about airline customers, including:</p><ul><li>Purchase lead time</li><li>Flight distance</li><li>Length of stay</li><li>Flight time</li><li>Add-ons selected by the customer</li></ul><p>The goal is to predict:</p><p><strong>Will the customer complete the booking or not?</strong></p><p>This makes the problem a <strong>binary classification task</strong>.</p><h3>Feature Engineering</h3><p>Instead of using raw features directly, I created a derived feature to capture <strong>customer commitment to the purchase</strong>.</p><h4>Add-on behavior</h4><p>Customers who select additional services are generally more likely to complete their booking.</p><p>These services include:</p><ul><li>Extra baggage</li><li>Preferred seat</li><li>In-flight meals</li></ul><p>I created a new feature called:</p><pre>total_add_ons</pre><p>This represents the number of optional services selected by the user.</p><p>Example:</p><pre>total_add_ons = baggage + seat + meal</pre><p>This helps the model capture <strong>purchase intent more clearly</strong>.</p><h3>Training the Machine Learning Model</h3><p>For this project, I used a <strong>Random Forest Classifier</strong>.</p><p>Random Forest works well for this type of problem because it:</p><ul><li>handles nonlinear relationships</li><li>works well with tabular data</li><li>is robust against overfitting</li></ul><p>Model setup:</p><pre>from sklearn.ensemble import RandomForestClassifier</pre><pre>model = RandomForestClassifier(<br>    n_estimators=100,<br>    max_depth=10,<br>    random_state=42<br>)</pre><pre>model.fit(X_train, y_train)</pre><p>After training, the model was able to learn patterns between customer behavior and booking completion.</p><h3>Saving the Trained Model</h3><p>Once the model was trained, I saved it using <strong>pickle</strong> so it could be loaded inside a web application.</p><pre>import pickle</pre><pre>pickle.dump(model, open(&quot;booking_model.pkl&quot;, &quot;wb&quot;))<br>pickle.dump(X.columns, open(&quot;model_columns.pkl&quot;, &quot;wb&quot;))</pre><p>Saving the feature columns ensures that <strong>future predictions match the structure used during training</strong>.</p><h3>Building the Web Application</h3><p>To make the model interactive, I built a simple web interface using <strong>Streamlit</strong>.</p><p>Streamlit allows developers to quickly turn Python scripts into web applications.</p><p>Users can enter information such as:</p><ul><li>days before flight</li><li>flight distance</li><li>length of stay</li><li>flight hour</li><li>add-on selections</li></ul><p>Example interface layout:</p><pre>Trip Info | Travel Details | Add-ons</pre><p>After entering the inputs, users can click <strong>Predict Booking</strong> to see the predicted probability of completing the booking.</p><h3>Deployment</h3><p>After testing the app locally, I deployed it online using <strong>Streamlit Cloud</strong>.</p><p>Deployment steps included:</p><ol><li>Creating a GitHub repository</li><li>Uploading the project files</li><li>Creating a requirements.txt</li><li>Deploying the app directly from GitHub</li></ol><p>The required dependencies included:</p><pre>streamlit<br>pandas<br>numpy<br>scikit-learn</pre><p>Once deployed, the app became accessible through a public link.</p><h3>Challenges I Encountered</h3><p>Like most real projects, deployment was not entirely smooth. Several issues came up along the way.</p><h4>1. Model File Too Large</h4><p>The initial model file was very large and exceeded GitHub’s recommended file size limits.</p><p>To resolve this, I retrained the model with more efficient parameters, reducing the file size significantly while maintaining performance.</p><h4>2. Streamlit Dependency Errors</h4><p>At one point, the deployment failed because the dependencies were not being installed.</p><p>This happened because the requirements file was mistakenly named:</p><pre>Requirement.txt</pre><p>instead of:</p><pre>requirements.txt</pre><p>Once corrected, Streamlit successfully installed all necessary libraries.</p><h4>3. Model Loading Issues</h4><p>Another challenge appeared when the application attempted to load the model and returned an error.</p><p>The root cause was that the wrong object had been saved during testing, which caused the model file to contain a NumPy array instead of the trained classifier.</p><p>Re-saving the trained model fixed the issue.</p><h3>Lessons Learned</h3><p>This project reinforced several important lessons about building machine learning applications:</p><ol><li><strong>Deployment is just as important as modeling</strong></li><li>Small mistakes in file structure can break a deployment</li><li>Saving models correctly is critical for reproducibility</li><li>Streamlit is an excellent tool for rapid ML prototyping</li></ol><h3>Final Thoughts</h3><p>Building machine learning models is one thing, but turning them into <strong>usable tools</strong> is where the real impact happens.</p><p>By deploying this model as an interactive application, the project moves beyond experimentation and becomes something users can actually interact with.</p><h3>Try the App</h3><p>You can try the live application here:</p><p><strong>Streamlit App:</strong><br><a href="https://british-airways-booking-prediction.streamlit.app/">https://british-airways-booking-prediction.streamlit.app/</a></p><p><strong>GitHub Repository:</strong><br><a href="https://github.com/InsightByFrank/british-airways-booking-prediction">https://github.com/InsightByFrank/british-airways-booking-prediction</a></p><p><strong>LinkedIn:</strong><br><a href="https://www.linkedin.com/in/frank-agba">https://www.linkedin.com/in/frank-agba</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5defc1f4333c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ Enhancing Customer Retention Through Predictive Analytics]]></title>
            <link>https://medium.com/@frankgodwin796/enhancing-customer-retention-through-predictive-analytics-98167ce16de3?source=rss-58de6c90983c------2</link>
            <guid isPermaLink="false">https://medium.com/p/98167ce16de3</guid>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[python-libraries]]></category>
            <category><![CDATA[data-gathering]]></category>
            <category><![CDATA[data-modeling]]></category>
            <category><![CDATA[exploratory-data-analysis]]></category>
            <dc:creator><![CDATA[Agba Frank Onwuchekwa]]></dc:creator>
            <pubDate>Fri, 27 Feb 2026 08:37:48 GMT</pubDate>
            <atom:updated>2026-02-27T08:37:48.421Z</atom:updated>
            <content:encoded><![CDATA[<h4>A Complete Data Gathering &amp; Exploratory Data Analysis Walkthrough</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EZTkBZK9eXzCFtmSvRXSIw.png" /></figure><p>Customer churn is one of the most critical challenges in banking. Retaining customers is significantly more cost-effective than acquiring new ones. In this project, we were tasked with building the foundation for a predictive churn model for SmartBank, a subsidiary of Lloyds Banking Group.</p><p>This article walks through the <strong>entire data gathering, exploratory data analysis (EDA), and preprocessing process</strong>, step-by-step exactly how it would be done in a real-world corporate data science environment.</p><h3>📌 Business Objective</h3><p>SmartBank has observed an increase in customer churn, particularly among young professionals and small business owners.</p><p>Our objective:</p><blockquote><em>Identify behavioural and demographic patterns that may predict customer churn, and prepare a clean dataset suitable for machine learning modelling.</em></blockquote><h3>Step 1 — Import Required Libraries</h3><p>We begin by importing essential libraries for data manipulation and visualization.</p><pre>import pandas as pd<br>import numpy as np<br>import matplotlib.pyplot as plt<br>import seaborn as sns</pre><pre>sns.set(style=&quot;whitegrid&quot;)</pre><h3>Step 2 — Load and Inspect the Data</h3><p>The dataset consists of five sheets:</p><ul><li>Customer_Demographics</li><li>Transaction_History</li><li>Customer_Service</li><li>Online_Activity</li><li>Churn_Status</li></ul><p>We load the file and inspect sheet names:</p><pre>file_path = &quot;Customer_Churn_Data_Large.xlsx&quot;</pre><pre>xls = pd.ExcelFile(file_path)<br>print(xls.sheet_names)</pre><p>Load each sheet:</p><pre>demographics = pd.read_excel(file_path, sheet_name=&quot;Customer_Demographics&quot;)<br>transactions = pd.read_excel(file_path, sheet_name=&quot;Transaction_History&quot;)<br>service = pd.read_excel(file_path, sheet_name=&quot;Customer_Service&quot;)<br>online = pd.read_excel(file_path, sheet_name=&quot;Online_Activity&quot;)<br>churn = pd.read_excel(file_path, sheet_name=&quot;Churn_Status&quot;)</pre><h3>Step 3 — Data Inspection</h3><p>We inspect structure, missing values, and types.</p><pre>demographics.info()<br>demographics.describe()<br>demographics.isnull().sum()</pre><p>We repeat this process for all sheets.</p><h3>Why This Matters</h3><p>Before modelling, we must understand:</p><ul><li>Data types</li><li>Missing values</li><li>One-to-many relationships</li><li>Feature distributions</li></ul><h3>Step 4 — Aggregating One-to-Many Tables</h3><p>Some tables (transactions and service) contain multiple rows per customer.</p><p>To prevent duplication during merging, we aggregate them at the customer level.</p><h3>Transaction Aggregation</h3><pre>transactions_agg = transactions.groupby(&#39;CustomerID&#39;).agg({<br>    &#39;AmountSpent&#39;: &#39;sum&#39;,<br>    &#39;TransactionID&#39;: &#39;count&#39;<br>}).reset_index()</pre><pre>transactions_agg.columns = [<br>    &#39;CustomerID&#39;,<br>    &#39;TotalAmountSpent&#39;,<br>    &#39;TransactionCount&#39;<br>]</pre><p>Now each customer has:</p><ul><li>TotalAmountSpent</li><li>TransactionCount</li></ul><h3>Customer Service Aggregation</h3><pre>service_agg = service.groupby(&#39;CustomerID&#39;).agg({<br>    &#39;InteractionType&#39;: &#39;count&#39;,<br>    &#39;ResolutionStatus&#39;: lambda x: (x == &#39;Unresolved&#39;).sum()<br>}).reset_index()</pre><pre>service_agg.columns = [<br>    &#39;CustomerID&#39;,<br>    &#39;TotalInteractions&#39;,<br>    &#39;UnresolvedCases&#39;<br>]</pre><p>This captures dissatisfaction risk.</p><h3>Online Activity Feature Engineering</h3><p>First, create “Days Since Last Login”:</p><pre>reference_date = online[&#39;LastLoginDate&#39;].max()<br>online[&#39;DaysSinceLastLogin&#39;] = (<br>    reference_date - online[&#39;LastLoginDate&#39;]<br>).dt.days</pre><p>Aggregate:</p><pre>online_agg = online.groupby(&#39;CustomerID&#39;).agg({<br>    &#39;LoginFrequency&#39;: &#39;mean&#39;,<br>    &#39;DaysSinceLastLogin&#39;: &#39;mean&#39;,<br>    &#39;ServiceUsage&#39;: lambda x: x.mode()[0]<br>}).reset_index()</pre><pre>online_agg.columns = [<br>    &#39;CustomerID&#39;,<br>    &#39;AvgLoginFrequency&#39;,<br>    &#39;AvgDaysSinceLastLogin&#39;,<br>    &#39;PreferredService&#39;<br>]</pre><p>This creates powerful behavioural predictors.</p><h3>Step 5 — Merge All Datasets</h3><p>We use left joins to preserve the full customer base.</p><pre>merged_df = demographics.merge(transactions_agg, on=&#39;CustomerID&#39;, how=&#39;left&#39;)<br><br>merged_df = merged_df.merge(service_agg, on=&#39;CustomerID&#39;, how=&#39;left&#39;)<br>merged_df = merged_df.merge(online_agg, on=&#39;CustomerID&#39;, how=&#39;left&#39;)<br>merged_df = merged_df.merge(churn, on=&#39;CustomerID&#39;, how=&#39;left&#39;)</pre><h3>Step 6 — Handle Missing Values</h3><p>After merging, customers without service interactions have missing values.</p><p>We replace them with zero:</p><pre>merged_df[&#39;TotalInteractions&#39;] = merged_df[&#39;TotalInteractions&#39;].fillna(0)<br>merged_df[&#39;UnresolvedCases&#39;] = merged_df[&#39;UnresolvedCases&#39;].fillna(0)</pre><p>This is logically correct — no interaction equals zero.</p><h3>7— Exploratory Data Analysis</h3><h4>Churn Distribution</h4><pre>sns.countplot(x=&#39;ChurnStatus&#39;, data=merged_df)<br>plt.title(&quot;Churn Distribution&quot;)<br>plt.show()</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/862/1*is0XwJ7f6bBf3qN4ZMuJlQ.png" /></figure><p>Insight:<br> Approximately 20% of customers have churned.</p><h4>Spending vs Churn</h4><pre>sns.boxplot(x=&#39;ChurnStatus&#39;, y=&#39;TotalAmountSpent&#39;, data=merged_df)<br>plt.title(&quot;Spending vs Churn&quot;)<br>plt.show()</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/832/1*PfH5JJYxE3wb8cp_om7BfA.png" /></figure><p>Insight:<br> Spending patterns show variation, though not strongly separated.</p><h4>Correlation Heatmap</h4><pre>plt.figure(figsize=(10,8))<br>sns.heatmap(merged_df.corr(numeric_only=True), annot=True, cmap=&#39;coolwarm&#39;)<br>plt.show()</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tky5SnzgSyp6haZ2cxcEMQ.png" /></figure><p>Key Observations:</p><ul><li>Strong correlation (0.9) between TotalAmountSpent and TransactionCount</li><li>Weak linear correlation with churn</li></ul><p>This suggests nonlinear models may perform better.</p><h3>Step 8 — Feature Scaling</h3><p>We scale numeric features but exclude the target variable.</p><pre>from sklearn.preprocessing import StandardScaler</pre><pre>scaler = StandardScaler()</pre><pre>numeric_cols = merged_df.select_dtypes(include=np.number).columns.tolist()<br>numeric_cols.remove(&#39;ChurnStatus&#39;)</pre><pre>merged_df[numeric_cols] = scaler.fit_transform(merged_df[numeric_cols])</pre><p>We verify:</p><pre>merged_df[&#39;ChurnStatus&#39;].unique()</pre><p>Output:</p><pre>array([0, 1])</pre><p>Target remains intact.</p><h3>Step 9 — Save Clean Dataset</h3><pre>merged_df.to_csv(&quot;Cleaned_Customer_Churn_Data.csv&quot;, index=False)</pre><p>The dataset is now:</p><ul><li>Fully merged</li><li>Aggregated</li><li>Feature engineered</li><li>Cleaned</li><li>Scaled</li><li>Model-ready</li></ul><h3>Key Insights from EDA</h3><ol><li>Churn rate ≈ 20%</li><li>Spending and transaction frequency are strongly correlated</li><li>Service dissatisfaction may influence churn</li><li>Engagement recency is a valuable predictor</li><li>Linear relationships with churn are weak</li></ol><h3>Conclusion</h3><p>This stage focused on building a robust analytical foundation:</p><ul><li>Careful data inspection</li><li>Intelligent aggregation</li><li>Feature engineering</li><li>Behavioural signal extraction</li><li>Clean preprocessing</li></ul><p>The result is a structured, model-ready dataset prepared for machine learning development.</p><p>In the next phase, we will build and evaluate predictive models to identify at-risk customers and inform targeted retention strategies.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=98167ce16de3" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[✈️ From Reactive to Predictive: Using Machine Learning to Predict Customer Booking Behaviour]]></title>
            <link>https://medium.com/@frankgodwin796/%EF%B8%8F-from-reactive-to-predictive-using-machine-learning-to-predict-customer-booking-behaviour-86a8df838e08?source=rss-58de6c90983c------2</link>
            <guid isPermaLink="false">https://medium.com/p/86a8df838e08</guid>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[business-insight]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[feature-engineering]]></category>
            <category><![CDATA[random-forest-model]]></category>
            <dc:creator><![CDATA[Agba Frank Onwuchekwa]]></dc:creator>
            <pubDate>Thu, 26 Feb 2026 00:16:36 GMT</pubDate>
            <atom:updated>2026-02-26T00:16:36.672Z</atom:updated>
            <content:encoded><![CDATA[<h4>A British Airways Data Science Project</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*A135yOvJ3XSqWAUFMMp-pQ.png" /></figure><h3>Introduction: Why This Problem Matters</h3><p>Airlines operate in one of the most competitive industries in the world.</p><p>Customers compare prices across platforms. They delay decisions. They abandon bookings. They return later — or never.</p><p>In such an environment, waiting for customers to complete a booking is not strategy.</p><p>It is reaction.</p><p>The real competitive advantage lies in prediction:</p><blockquote><em>Can we identify customers who are likely to complete their booking before they do?</em></blockquote><p>As part of a British Airways Data Science project, I built a machine learning model to predict whether a customer would complete their booking using historical behavioural data.</p><p>This was not just a modeling task. It was a behavioural analysis problem disguised as a classification problem.</p><h3>📊 Understanding the Dataset</h3><p>The dataset contained:</p><ul><li><strong>50,000 customer records</strong></li><li><strong>14 structured features</strong></li><li>A binary outcome: booking_complete</li></ul><p>Each row represented a customer interaction before booking completion.</p><p>Key variables included:</p><ul><li>Number of passengers</li><li>Purchase lead time</li><li>Length of stay</li><li>Flight hour</li><li>Booking origin</li><li>Trip type</li><li>Sales channel</li><li>Add-on selections (baggage, meals, seats)</li></ul><h3>⚠️ A Critical Discovery: Class Imbalance</h3><p>When exploring the target variable:</p><pre>df[&#39;booking_complete&#39;].value_counts(normalize=True)</pre><p>I discovered:</p><ul><li>85% did NOT complete booking</li><li>15% completed booking</li></ul><p>This immediately shaped my evaluation approach.</p><p>Why?</p><p>Because if a model predicts “No booking” for every customer, it would already achieve 85% accuracy.</p><p>That means:</p><blockquote><em>Accuracy alone is meaningless here.</em></blockquote><p>Instead, I focused on:</p><ul><li>ROC-AUC</li><li>Recall</li><li>Cross-validation stability</li></ul><p>This is a critical distinction between beginner and applied-level modeling.</p><h3>Feature Engineering: Capturing Behaviour, Not Just Variables</h3><p>Raw data often hides behavioural signals.</p><p>My goal was to extract behavioural patterns that better explain intent.</p><h4>Time-of-Day Behaviour</h4><p>Flight hour was transformed into behavioural time buckets:</p><pre>def time_bucket(hour):<br>    if hour &lt; 6:<br>        return &quot;EarlyMorning&quot;<br>    elif hour &lt; 12:<br>        return &quot;Morning&quot;<br>    elif hour &lt; 18:<br>        return &quot;Afternoon&quot;<br>    else:<br>        return &quot;Evening&quot;</pre><pre>df[&#39;flight_time_category&#39;] = df[&#39;flight_hour&#39;].apply(time_bucket)</pre><p>Why?</p><p>Travel behaviour differs by time:</p><ul><li>Early morning flights → business travel</li><li>Evening flights → leisure patterns</li></ul><p>Time-of-day reflects intent.</p><h4>Weekend Behaviour</h4><pre>df[&#39;is_weekend&#39;] = df[&#39;flight_day&#39;].isin([&#39;Sat&#39;,&#39;Sun&#39;]).astype(int)</pre><p>Weekend travel often correlates with leisure behaviour, which can affect booking conversion.</p><h3>Engagement Score (Total Add-Ons)</h3><p>This was one of the most meaningful engineered features.</p><pre>df[&#39;total_add_ons&#39;] = (<br>    df[&#39;wants_extra_baggage&#39;] +<br>    df[&#39;wants_preferred_seat&#39;] +<br>    df[&#39;wants_in_flight_meals&#39;]<br>)</pre><p>This variable captures <em>engagement intensity</em>.</p><p>A customer selecting multiple add-ons is:</p><ul><li>More invested</li><li>More intentional</li><li>Less price-sensitive</li><li>More likely to complete booking</li></ul><p>This is behavioural modeling — not just data modeling.</p><h3>Preparing the Data for Machine Learning</h3><p>Categorical variables were encoded using one-hot encoding:</p><pre>df = pd.get_dummies(df, drop_first=True)</pre><p>Then features and target were separated:</p><pre>X = df.drop(&#39;booking_complete&#39;, axis=1)<br>y = df[&#39;booking_complete&#39;]</pre><p>Train-test split:</p><pre>X_train, X_test, y_train, y_test = train_test_split(<br>    X, y,<br>    test_size=0.2,<br>    random_state=42<br>)</pre><h3>Why I Chose Random Forest</h3><p>Random Forest was selected because:</p><ul><li>It handles nonlinear relationships well.</li><li>It is robust to overfitting.</li><li>It performs strongly on structured tabular data.</li><li>It provides feature importance scores.</li></ul><p>This made it ideal for both prediction and interpretation.</p><pre>model = RandomForestClassifier(<br>    n_estimators=300,<br>    random_state=42<br>)</pre><pre>model.fit(X_train, y_train)</pre><h3>📈 Model Evaluation: Looking Beyond Acuracy</h3><h4>Accuracy: 85%</h4><p>At face value, this looks strong.</p><p>But because the dataset is imbalanced, we need deeper analysis.</p><h4>ROC-AUC: 0.79</h4><pre>roc_auc_score(y_test, y_probs)</pre><p>ROC-AUC measures how well the model separates buyers from non-buyers across thresholds.</p><p>A score of 0.79 indicates:</p><ul><li>Strong discriminatory power</li><li>Good ranking ability</li><li>Reliable probability estimation</li></ul><p>This is the more meaningful metric here.</p><h4>Cross-Validation Score: 0.75</h4><p>Cross-validation confirmed:</p><ul><li>Model stability</li><li>No major overfitting</li><li>Generalization ability</li></ul><p>This is critical in real-world deployment.</p><h3>Interpreting Feature Importance</h3><pre>importances = model.feature_importances_<br>indices = np.argsort(importances)[-10:]<br><br>plt.figure(figsize=(8,6))<br>plt.barh(range(len(indices)), importances[indices])<br>plt.yticks(range(len(indices)), X.columns[indices])<br>plt.title(&quot;Top 10 Feature Importances&quot;)<br>plt.xlabel(&quot;Importance&quot;)<br>plt.ylabel(&quot;Features&quot;)<br>plt.show()</pre><p>Feature Top 7 Importance revealed:</p><ol><li>Purchase lead</li><li>Length of stay</li><li>Flight hour</li><li>Number of passengers</li><li>Flight duration</li><li>Engagement score (total_add_ons)</li><li>Booking origin</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*khzzDay_oCwhaa4AlO419A.png" /></figure><h3>What This Tells Us About Customer Behaviour</h3><h4>1️⃣ Planning Horizon Matters</h4><p>Customers booking further in advance exhibit distinct behavioural patterns.</p><p>Early planners are more predictable.</p><h4>2️⃣ Commitment Signals Conversion</h4><p>Longer stays and group bookings correlate strongly with completion.</p><p>Commitment reduces abandonment probability.</p><h4>3️⃣ Engagement Drives Completion</h4><p>Add-on selection is a strong behavioural signal.</p><p>Customers investing in extras are more likely to complete booking.</p><h4>4️⃣ Geographic Patterns Exist</h4><p>Booking origin plays a measurable role in conversion rates.</p><p>This suggests market-specific marketing strategies.</p><h3>Model Limitation</h3><p>Recall for completed bookings was low (12%).</p><p>This is due to class imbalance.</p><p>Future improvements could include:</p><ul><li>Class weighting</li><li>Threshold tuning</li><li>SMOTE oversampling</li><li>Gradient boosting techniques</li></ul><p>However, as a baseline predictive model, performance is strong and strategically useful.</p><h3>Business Implications</h3><p>This model enables:</p><ul><li>Targeted promotions for high-probability customers</li><li>Intelligent marketing segmentation</li><li>Reduced customer acquisition cost</li><li>Improved conversion strategy</li><li>Data-driven personalization</li></ul><p>It shifts British Airways from reactive marketing to predictive engagement.</p><h3>Key Lessons From This Project</h3><ol><li>Metrics matter — accuracy can mislead.</li><li>Feature engineering can dramatically enhance model power.</li><li>Interpretation creates business value.</li><li>Behavioural signals outperform surface-level features.</li><li>Data science must connect to decision-making.</li></ol><h3>Final Reflection</h3><p>This project reinforced an important principle:</p><blockquote><em>Machine learning is not about building the most complex model.<br> It is about extracting meaningful behavioural insight that drives action.</em></blockquote><p>By combining structured modeling with business reasoning, we transformed raw booking data into predictive intelligence.</p><p>That is applied data science.</p><h3>Let’s Connect</h3><p>If you found this project interesting, I’d love to hear your thoughts.</p><p>How would you improve the model? Would you approach the problem differently?</p><p>Feel free to connect with me on LinkedIn <a href="https://www.linkedin.com/in/frank-agba">@Frank Agba</a> and share your perspective — I’m always open to learning and discussing new ideas in data science and analytics.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=86a8df838e08" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[✈️ Forecasting Lounge Demand at Heathrow: A Strategic Data Modeling Exercise]]></title>
            <link>https://medium.com/@frankgodwin796/%EF%B8%8F-forecasting-lounge-demand-at-heathrow-a-strategic-data-modeling-exercise-8c2dab67aaae?source=rss-58de6c90983c------2</link>
            <guid isPermaLink="false">https://medium.com/p/8c2dab67aaae</guid>
            <category><![CDATA[data]]></category>
            <category><![CDATA[modelling]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[forecasting]]></category>
            <category><![CDATA[machine-learning]]></category>
            <dc:creator><![CDATA[Agba Frank Onwuchekwa]]></dc:creator>
            <pubDate>Tue, 24 Feb 2026 23:58:04 GMT</pubDate>
            <atom:updated>2026-02-24T23:58:04.894Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/403/1*qUvV472fm1RvbZHNNwlODA.jpeg" /></figure><h3>Introduction</h3><p>As part of the British Airways Data Science Virtual Experience, I was tasked with solving a realistic airport planning problem:</p><blockquote><em>How can we forecast lounge demand at Heathrow Terminal 3 using a model that remains flexible under future schedule uncertainty?</em></blockquote><p>At first glance, this seems like a straightforward estimation exercise. But the real challenge was not calculating numbers — it was designing a scalable framework that could adapt to future flight schedule changes.</p><p>This project became an exercise in structured thinking, segmentation strategy, and assumption-based modeling.</p><h3>🧩 The Business Problem</h3><p>Lounge access is a key component of the premium passenger experience. For British Airways, accurately forecasting lounge demand is critical for:</p><ul><li>Capacity planning</li><li>Space allocation</li><li>Staffing strategy</li><li>Investment decisions</li></ul><p>However, future flight schedules are unpredictable:</p><ul><li>Aircraft types may change</li><li>Routes may expand or shrink</li><li>Frequencies may vary</li></ul><p>This meant that building a model tied to specific flight numbers would not be sustainable.</p><p>The solution required a generalized, reusable approach.</p><h3>Step 1: Identifying the Core Drivers of Lounge Demand</h3><p>Instead of starting with the data table, I started with business logic.</p><p>I asked:</p><p>What actually determines lounge eligibility?</p><p>Two key drivers emerged:</p><h4>1️⃣ Route Type (Short-haul vs Long-haul)</h4><p>Long-haul flights:</p><ul><li>Typically operate aircraft with premium cabins (including First Class)</li><li>Carry higher proportions of corporate travelers</li><li>Have stronger loyalty-status representation</li></ul><p>Short-haul flights:</p><ul><li>Usually do not operate First Class cabins</li><li>Include more leisure passengers</li><li>Have a lower proportion of top-tier loyalty members</li></ul><p>Route type clearly influences the supply of premium passengers.</p><h4>2️⃣ Time of Departure (AM vs PM)</h4><p>Time of day influences traveler behavior:</p><p>Morning departures:</p><ul><li>Attract business travelers</li><li>Include more frequent flyers</li><li>Have higher elite status concentration</li></ul><p>Afternoon and evening departures:</p><ul><li>Often more leisure-oriented</li><li>Include more price-sensitive passengers</li><li>Have slightly lower loyalty penetration</li></ul><p>Time of departure influences the demand profile.</p><h3>Step 2: Combining the Variables</h3><p>Rather than grouping by only one factor, I combined both:</p><ul><li>Short-haul AM</li><li>Short-haul PM</li><li>Long-haul AM</li><li>Long-haul PM</li></ul><p>This created four scalable categories that capture both:</p><ul><li>Aircraft premium configuration</li><li>Passenger behavior patterns</li></ul><p>This dual segmentation ensured the model reflected real-world aviation dynamics.</p><h3>📊 Step 3: Designing the Lookup Table</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8VxkxwkTlTiUFuYfBphiiA.png" /></figure><p>For each category, I assigned estimated eligibility percentages across three lounge tiers:</p><ul><li>Tier 1 — Concorde Room (hypothetical at T3)</li><li>Tier 2 — First Lounge</li><li>Tier 3 — Club Lounge</li></ul><p>Important structural rules I followed:</p><ul><li>Tier 3 &gt; Tier 2&gt; Tier 1</li><li>Long-haul &gt; Short-haul</li><li>Morning ≥ Evening</li></ul><p>These were not exact operational figures. They were structured planning assumptions designed for strategic forecasting.</p><p>The goal was not precision — it was internal consistency and scalability.</p><h3>📈 Why the Percentages Do Not Sum to 100%</h3><p>One important insight during this exercise was understanding that lounge eligibility percentages do not need to sum to 100%.</p><p>The table only represents passengers eligible for lounge access.</p><p>The remaining passengers are economy travelers without loyalty status and are not part of lounge demand.</p><p>This distinction is critical in capacity modeling.</p><h3>Step 4: Ensuring Scalability</h3><p>The strength of the model lies in its flexibility.</p><p>Because the framework is category-based:</p><ul><li>Any new flight can be assigned to one of the four groups</li><li>Eligibility assumptions remain constant</li><li>The model adapts to future schedule changes</li></ul><p>This is how real airport planning models are designed — not tied to today’s timetable, but built for future variability.</p><h3>Justifiaction of Modelling Approach</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*E6TKNH3Mp_XgC3m_S0fDrQ.png" /></figure><p>A key part of this project was not simply assigning percentages, but ensuring that the assumptions behind them were logically grounded and strategically defensible.</p><p>The segmentation approach was based on two primary drivers of lounge demand: route type and time of departure.</p><p>Route type plays a significant role in determining premium passenger concentration. Long-haul flights typically operate aircraft with larger premium cabins, including Business Class and, in many cases, First Class. These routes also attract a higher proportion of corporate and long-distance travelers, who are more likely to hold elite loyalty status. As a result, it was reasonable to assume that long-haul flights would generate higher proportions of Tier 1, Tier 2, and Tier 3 lounge-eligible passengers compared to short-haul flights.</p><p>Time of departure reflects differences in traveler behavior. Morning departures tend to serve business travelers and frequent flyers, particularly on routes connecting major commercial hubs. These passengers are more likely to hold Silver or Gold status, increasing lounge eligibility. In contrast, afternoon and evening departures generally include a higher share of leisure travelers, resulting in slightly lower elite representation.</p><p>The assigned percentages were structured to reflect these behavioral and operational dynamics. Tier 3 (Club Lounge) was modeled as the largest eligible segment, followed by Tier 2 (First Lounge), with Tier 1 (Concorde Room) representing the smallest and most exclusive group. This hierarchy mirrors the real-world distribution of airline loyalty tiers and premium cabin capacity.</p><p>It is important to note that the percentages were not intended to represent exact operational data. Instead, they function as planning-level assumptions designed to support strategic forecasting. The objective was to create a consistent, scalable framework that airport planners could apply to evolving schedules without needing flight-specific recalculations.</p><p>By grounding the assumptions in aviation behavior patterns and cabin structure logic, the model balances realism with flexibility — which is essential in long-term capacity planning.</p><h3>Strategic Lessons From This Project</h3><p>This exercise reinforced several important analytical principles:</p><h4>1️⃣ Structure Before Numbers</h4><p>Good forecasting begins with segmentation, not calculation.</p><h4>2️⃣ Assumptions Must Be Logical</h4><p>Even without internal data, assumptions can be defensible if grounded in business understanding.</p><h4>3️⃣ Scalability Is More Valuable Than Precision</h4><p>A slightly imperfect but flexible model is more useful than a highly detailed but fragile one.</p><h4>4️⃣ Data Science Is About Decision Support</h4><p>This wasn’t about predicting exact lounge traffic. It was about enabling strategic planning decisions.</p><h3>Final Reflection</h3><p>What I appreciated most about this project is that it mirrored real-world analytics work.</p><p>In many business environments, you will not have perfect data.<br> You will need to:</p><ul><li>Build structured frameworks</li><li>Apply informed assumptions</li><li>Justify your logic</li><li>Deliver decision-ready outputs</li></ul><p>This project strengthened my ability to translate operational problems into scalable analytical models.</p><p>And most importantly, it reinforced that data science is not just about algorithms — it’s about structured thinking.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8c2dab67aaae" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Being Good Is Not Enough: Standing Out in the Tech Industry]]></title>
            <link>https://medium.com/@frankgodwin796/being-good-is-not-enough-standing-out-in-the-tech-industry-aeefe3fdb7c9?source=rss-58de6c90983c------2</link>
            <guid isPermaLink="false">https://medium.com/p/aeefe3fdb7c9</guid>
            <category><![CDATA[careers]]></category>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[education]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[personal-development]]></category>
            <dc:creator><![CDATA[Agba Frank Onwuchekwa]]></dc:creator>
            <pubDate>Fri, 06 Feb 2026 09:01:03 GMT</pubDate>
            <atom:updated>2026-02-06T09:01:03.390Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*O7_7Q22PWZFsghSaExIQDg.png" /></figure><p>When I stood in front of a room filled with aspiring designers, developers, data analysts, cybersecurity learners, and beginners, one thing was obvious: <strong>talent was not the problem</strong>.</p><p>The room was full of capable people.<br> Curious people.<br> People who were learning, practicing, and genuinely trying to build something meaningful.</p><p>Yet, beneath the enthusiasm was a quiet anxiety — a question many of them didn’t ask out loud, but clearly carried within them:</p><blockquote>“What if I’m good… but no one notices?”</blockquote><p>That question is the reality of today’s tech industry.</p><p>This article is my attempt to answer it — not with hype, not with motivation alone, but with clarity, structure, and truth.</p><h3>The Tech Industry Has Changed — And Many People Haven’t Realized It Yet</h3><p>The tech space is growing faster than ever. Every day:</p><ul><li>More people enroll in online courses</li><li>More bootcamps are launched</li><li>More certifications are earned</li><li>More tools are learned</li><li>Talent is everywhere.</li></ul><p>But opportunities are limited.</p><p>In 2024 alone, global organizations created roughly <strong>1.7 million new tech roles</strong>, while <strong>tens of millions of people</strong> were learning tech skills worldwide. That gap matters.</p><p>What this means is simple but uncomfortable:</p><blockquote><em>Being good used to be rare.<br> Now, being good is common.</em></blockquote><p>The competition is no longer just about <em>who is skilled</em>.<br> It is about <strong>who is visible, trusted, and understandable</strong>.</p><h3>The Hard Truth: Skill Without Visibility Is Silent</h3><p>One of the most important things I shared during the session was this:</p><p>Recruiters don’t guess talent.<br> Employers don’t assume potential.<br> They respond to what they can see.</p><p>Research supports this. Reports consistently show that <strong>over 70% of employers review candidates’ online presence</strong>, and LinkedIn remains the <strong>number one platform</strong> they check.</p><p>This doesn’t mean they’re looking for perfection.<br> It means they’re looking for <strong>signals</strong>:</p><ul><li>How you think</li><li>How you communicate</li><li>How you approach problems</li><li>How you grow</li></ul><p>If none of that is visible, your skill is effectively silent.</p><p>Your work should be able to introduce you — even when you’re not in the room.</p><h3>Visibility Is Not Showing Off (And This Is Where Many People Get It Wrong)</h3><p>The moment “visibility” is mentioned, many students shut down mentally.</p><p>They think:</p><ul><li>“I don’t want to show off.”</li><li>“I’m not good enough yet.”</li><li>“Others are better than me.”</li></ul><p>But visibility is not performance.<br> Visibility is <strong>communication</strong>.</p><p>It is letting people understand:</p><ul><li>What you’re learning</li><li>What you’re building</li><li>What you’re struggling with</li><li>What you’re improving</li></ul><p>You don’t wait until you arrive before you share.</p><p>You share <strong>while you are becoming</strong>.</p><p>That shift alone changes everything.</p><h3>This Is Not Field-Specific — It Applies to Everyone in Tech</h3><p>Another misconception is that showcasing work only applies to certain roles.</p><p>It doesn’t.</p><ul><li>Designers can explain <em>why</em> they made design decisions</li><li>Developers can explain <em>how</em> a feature works</li><li>Data analysts can explain <em>what insights</em> the data reveals</li><li>Cybersecurity learners can explain <em>risks and prevention</em></li><li>Beginners can document <em>what they are learning</em></li></ul><p>Your field does not limit you.</p><p>Silence does.</p><h3>From Understanding the Problem to Taking Action</h3><p>At this point in the session, I always make a transition. Because understanding <em>why</em> something matters is not enough. People need to know <strong>how</strong> to act.</p><p>So I introduced a simple, practical framework — not theory, not hype — just steps.</p><h3>A 5-Step Framework to Stand Out in the Tech Industry</h3><h3>Step 1: Clarify Your Direction</h3><p>You cannot showcase what you are not clear about.</p><p>Clarity means being able to answer:</p><ul><li>What field am I in?</li><li>What level am I currently at?</li><li>What am I actively learning right now?</li></ul><p>You don’t need a five-year plan.<br> You need <strong>current direction</strong>.</p><p>If you cannot explain your learning focus in one sentence, neither can anyone else.</p><h3>Step 2: Build Small, Real Things</h3><p>You don’t need massive projects to stand out.<br> You need <strong>real ones</strong>.</p><p>Small dashboards.<br> Simple websites.<br> Design mockups.<br> Security labs.<br> Learning notes.</p><p>Your project doesn’t need to be big.</p><p>It needs to be <strong>real</strong> — something that shows effort, thought, and learning.</p><h3>Step 3: Document, Don’t Perform</h3><p>This is where pressure disappears.</p><p>You are not performing for an audience.<br> You are documenting a journey.</p><p>Document:</p><ul><li>What you learned</li><li>What challenged you</li><li>What confused you</li><li>What you fixed</li></ul><p>This is where growth becomes visible.</p><p>Progress, not perfection.</p><h3>Step 4: Share Consistently (Not Loudly)</h3><p>Consistency beats confidence.</p><p>You don’t need to post every day.<br> You don’t need to sound like an expert.</p><p>One or two posts per week is enough.</p><p>A simple format works:</p><ul><li>What I learned</li><li>Why it matters</li><li>One takeaway</li></ul><p>LinkedIn rewards clarity, not grammar.<br> Consistency, not virality.</p><h3>Step 5: Engage and Be Professional</h3><p>Visibility without professionalism does not last.</p><p>Every comment, reply, and interaction is part of your <strong>invisible CV</strong>.</p><p>People may forget:</p><ul><li>The tools you used</li><li>The frameworks you mentioned</li></ul><p>But they never forget:</p><ul><li>How you communicated</li><li>How you responded</li><li>How you treated others</li></ul><p>Professionalism sustains visibility.</p><h3>Building an Audience Is Not About Fame</h3><p>An audience is not a crowd.</p><p>It is trust.</p><p>Even 10–50 people paying attention to your journey can change your career path. Those people may become:</p><ul><li>Mentors</li><li>Referrers</li><li>Collaborators</li><li>Employers</li></ul><p>Your future opportunity may already be watching — quietly.</p><h3>LinkedIn Is a Classroom, Not a Stage</h3><p>LinkedIn is not reserved for experts who have “made it”.</p><p>It is a classroom for people who are intentional about growth.</p><p>Share:</p><ul><li>Learning</li><li>Projects</li><li>Mistakes</li><li>Lessons</li></ul><p>Growth happens in public.</p><h3>Common Mistakes That Hold People Back</h3><p>Most people don’t fail because they’re incapable.</p><p>They stop because they:</p><ul><li>Wait to be perfect</li><li>Compare their chapter 1 to someone’s chapter 10</li><li>Post without learning</li></ul><p>Progress is more attractive than perfection.</p><p>Always.</p><h3>Final Thoughts</h3><p>In tech, many people are good.</p><p>Those who stand out are not always the smartest — they are the ones who:</p><ul><li>Learn intentionally</li><li>Share honestly</li><li>Show up consistently</li></ul><p>Don’t hide your journey.</p><p>Let your progress speak.</p><p>You don’t need experience to start sharing.<br> <strong>Sharing creates experience.</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=aeefe3fdb7c9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ Mobile App or Website?]]></title>
            <link>https://medium.com/@frankgodwin796/mobile-app-or-website-b31d443e37ed?source=rss-58de6c90983c------2</link>
            <guid isPermaLink="false">https://medium.com/p/b31d443e37ed</guid>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[data-analysis]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[data-visualization]]></category>
            <category><![CDATA[business-intelligence]]></category>
            <dc:creator><![CDATA[Agba Frank Onwuchekwa]]></dc:creator>
            <pubDate>Fri, 26 Dec 2025 13:56:00 GMT</pubDate>
            <atom:updated>2025-12-26T14:03:02.595Z</atom:updated>
            <content:encoded><![CDATA[<h4>A Practical Linear Regression Case Study with Python &amp; Seaborn Turning customer behavior data into real business decisions</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XqE_CcLpPrS9M5TlI5PLxQ.png" /></figure><h3>Introduction</h3><p><em>As data analysts transitioning to data science one thing i have learnt, our job is not just to build models , it’s to </em><strong><em>answer business questions clearly</em></strong><em>.</em></p><p><em>In this project, I analyzed an e-commerce customer dataset to answer a simple but important question:</em></p><blockquote><strong><em>What factors truly drive how much customers spend in a year?</em></strong></blockquote><p><em>Is it:</em></p><ul><li><em>Time spent on the website?</em></li><li><em>Time spent on the mobile app?</em></li><li><em>Or customer loyalty?</em></li></ul><p><em>Using </em><strong><em>Python, Seaborn, and Linear Regression</em></strong><em>, I walk through my full approach, from exploration to insights and recommendations.</em></p><h3>📁 Dataset Overview</h3><p><em>The dataset contains customer-level behavioral metrics:</em></p><ul><li><em>Avg. Session Length</em></li><li><em>Time on App</em></li><li><em>Time on Website</em></li><li><em>Length of Membership</em></li><li><em>Yearly Amount Spent (target variable)</em></li></ul><p><em>All variables are numeric, making the data ideal for regression analysis.</em></p><h3>🛠️ Step 1: Importing Libraries &amp; Loading Data</h3><p><em>At this stage, I prepared the tools needed to work with the data and then loaded the customer dataset for analysis. This step is important because it allows the data to be organized, explored, and visualized properly.</em></p><p><em>From a business point of view, this is like opening and preparing a clean customer report before making decisions. If the data is not loaded correctly, any insights or recommendations that follow may be inaccurate.</em></p><p><em>In simple terms, this step ensures that the analysis is based on the right data and sets a solid foundation for all business insights that come next.</em></p><pre>import pandas as pd<br>import numpy as np<br>import matplotlib.pyplot as plt<br>import seaborn as sns<br><br>%matplotlib inline<br>sns.set(style=&quot;whitegrid&quot;)</pre><pre>customers = pd.read_csv(&quot;Ecommerce Customers.csv&quot;)</pre><pre>customers.head()</pre><pre>customers.info()</pre><pre>customers.describe()</pre><h3>🔍 Step 2: Exploratory Data Analysis (EDA)</h3><p><em>In this step, I explored the data to understand customer behavior and identify patterns before building any model. This involved using simple charts to see how different customer activities relate to how much they spend in a year.</em></p><p><em>From a business perspective, this step helps answer early questions like:<br> Which customer behaviors matter most?<br> Are there clear trends worth paying attention to?</em></p><p><em>Exploratory Data Analysis is important because it helps avoid guessing. By visually exploring the data, we can quickly spot strong relationships, unusual patterns, or behaviors that may drive revenue. These early insights guide smarter decisions and ensure the analysis stays focused on what truly matters to the business.</em></p><p><em>In short, EDA helps turn raw data into early insights that shape better strategy and decision-making.</em></p><pre>sns.pairplot(customers)<br>plt.show()</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*K_ucqJofLQWV-MfoE7CkRg.png" /></figure><h4>🔎 What stood out immediately?</h4><p><em>The relationship between </em><strong><em>Length of Membership</em></strong><em> and </em><strong><em>Yearly Amount Spent</em></strong><em> showed the </em><strong><em>strongest linear pattern</em></strong><em> — a strong early signal.</em></p><h3>📊 Step 3: Exploring Key Relationships</h3><p><em>In this step, I examined how different customer activities relate to how much they spend in a year. By comparing key behaviors such as time spent on the app, time on the website, and length of membership with yearly spending, it becomes easier to see which actions are linked to higher value customers.</em></p><p><em>From a business perspective, this step helps identify where to focus attention and resources. By understanding which behaviors have the strongest relationship with spending, the company can make smarter decisions about product improvements, customer engagement strategies, and long-term growth initiatives.</em></p><h4>a. Time on Website vs Yearly Amount Spent</h4><pre>sns.jointplot(<br>    x=&#39;Time on Website&#39;,<br>    y=&#39;Yearly Amount Spent&#39;,<br>    data=customers<br>)<br>plt.show()</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KY8xUp2ThAU3vJZCxvr5FQ.png" /></figure><h4>b. Time on App vs Yearly Amount Spent</h4><pre>sns.jointplot(<br>    x=&#39;Time on App&#39;,<br>    y=&#39;Yearly Amount Spent&#39;,<br>    data=customers<br>)<br>plt.show()</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rKhOUqWIHmj4X4fm_PlCrg.png" /></figure><h4>c. Time on App vs Length of Membership (Density Plot)</h4><pre>sns.jointplot(<br>    x=&#39;Time on App&#39;,<br>    y=&#39;Length of Membership&#39;,<br>    kind=&#39;hex&#39;,<br>    data=customers<br>)<br>plt.show()</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QePnZNo9fjv7RYaRDfzN9Q.png" /></figure><h4>d. Length of Membership vs Yearly Amount Spent (Regression Line)</h4><pre>sns.lmplot(<br>    x=&#39;Length of Membership&#39;,<br>    y=&#39;Yearly Amount Spent&#39;,<br>    data=customers<br>)<br>plt.show()</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ewOl9ly8vsuwsJYqXJSFEQ.png" /></figure><h3>🤖 Step 4: Preparing Data for Modeling</h3><p><em>At this stage, I prepared the data so it could be used to build a predictive model. This involved selecting the key customer behaviors that could influence spending and separating them from the outcome we want to predict, which is the yearly amount spent. The data was then split into two parts: one for learning and one for testing.</em></p><p><em>From a business point of view, this step is about </em><strong><em>fair and reliable decision-making</em></strong><em>. By training the model on one portion of the data and testing it on another, we can check how well our insights would perform on new customers. This helps ensure that any conclusions or recommendations are dependable and not based on chance.</em></p><h4>Feature Selection</h4><p><em>Feature selection involves choosing the most relevant customer behaviors to include in the model. This is important because focusing on the right features helps the analysis stay clear, accurate, and aligned with real business drivers of customer spending.</em></p><pre>X = customers[[&#39;Avg. Session Length&#39;,<br>               &#39;Time on App&#39;,<br>               &#39;Time on Website&#39;,<br>               &#39;Length of Membership&#39;]]</pre><pre>y = customers[&#39;Yearly Amount Spent&#39;]</pre><h3>Train–Test Split</h3><p><em>The train–test split separates the data into two parts: one used to build the model and the other used to test how well it performs. This helps ensure that the results are reliable and can be trusted when applied to new customers.</em></p><pre>from sklearn.model_selection import train_test_split</pre><pre>X_train, X_test, y_train, y_test = train_test_split(<br>    X, y, test_size=0.3, random_state=101<br>)</pre><h3>📈 Step 5: Training the Linear Regression Model</h3><p><em>In this step, I trained the model to learn how customer behaviors relate to yearly spending. By using past data, the model identifies patterns that explain how changes in customer activity are associated with changes in how much they spend.</em></p><p><em>From a business perspective, this step is about </em><strong><em>turning observations into predictions</em></strong><em>. It allows the company to estimate customer spending based on known behaviors and use those insights to support planning and strategic decisions.</em></p><pre>from sklearn.linear_model import LinearRegression</pre><pre>lm = LinearRegression()<br>lm.fit(X_train, y_train)</pre><h3>📊 Step 6: Interpreting Model Coefficients</h3><p><em>In this step, I examined the model’s coefficients to understand how each customer behavior influences yearly spending. Each coefficient shows how changes in a specific behavior are associated with increases or decreases in customer spend, assuming other factors remain constant.</em></p><p><em>From a business point of view, this step helps identify which actions matter most. It allows the company to focus on the behaviors that drive the highest value, such as customer loyalty or app engagement, rather than investing equally in areas with little impact.</em></p><pre>coeff_df = pd.DataFrame(<br>    lm.coef_,<br>    X.columns,<br>    columns=[&#39;Coefficient&#39;]<br>)</pre><pre>coeff_df</pre><h4>🔑 What the coefficients tell us</h4><ul><li><strong><em>Length of Membership</em></strong><em> → strongest impact on spending</em></li><li><strong><em>Time on App</em></strong><em> → strong positive influence</em></li><li><strong><em>Avg. Session Length</em></strong><em> → moderate effect</em></li><li><strong><em>Time on Website</em></strong><em> → minimal impact</em></li></ul><blockquote><em>Loyalty and mobile engagement matter more than website usage.</em></blockquote><h3>🎯 Step 7: Making Predictions</h3><p><em>At this stage, the trained model is used to estimate yearly customer spending based on their behavior. These predictions show how well the model can apply what it has learned to new or unseen data.</em></p><p><em>From a business perspective, this step demonstrates how data can be used to anticipate customer value. It helps the company forecast spending patterns and support smarter planning and decision-making.</em></p><pre>predictions = lm.predict(X_test)</pre><h3>Actual vs Predicted Values</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DwG1j81ueA_pGmn3CVLUFw.png" /></figure><h3>📐 Step 8: Model Evaluation</h3><p><em>In this step, I checked how well the model’s predictions match actual customer spending. By comparing predicted values with real outcomes, we can understand how accurate and reliable the model is.</em></p><p><em>From a business point of view, this step builds confidence in the results. It helps determine whether the model is good enough to support decisions or if it needs improvement before being used in real-world scenarios.</em></p><h3>📐 Step 8: Model Evaluation</h3><pre>from sklearn import metrics</pre><pre>MAE: 7.228148653430838<br>MSE: 79.81305165097451<br>RMSE: 8.933815066978637</pre><h3>📉 Step 9: Residual Analysis</h3><p><em>In this step, I reviewed the differences between the model’s predictions and the actual customer spending. This helps check whether the model is making consistent and unbiased predictions.</em></p><p><em>From a business perspective, residual analysis helps confirm that the model is reliable and not missing important patterns. A well-behaved residual pattern increases confidence that the insights and recommendations can be trusted.</em></p><h3>📉 Step 9: Residual Analysis</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0BkWRU3tOReNY-mKbbcQJg.png" /></figure><p><em>Residuals are approximately normally distributed, a good sign that the linear model is appropriate.</em></p><p><em>Residuals are approximately normally distributed, a good sign that the linear model is appropriate.</em></p><p><strong><em>🔑 Insight 1: Loyalty Beats Everything</em></strong></p><p><em>Length of Membership was the </em><strong><em>most correlated feature</em></strong><em> with spending.</em></p><p><em>Long-term customers are:</em></p><ul><li><em>More engaged</em></li><li><em>More trusting</em></li><li><em>More valuable</em></li></ul><p><strong><em>🔑 Insight 2: The Mobile App Outperforms the Website</em></strong></p><p><em>Even when controlling for other variables:</em></p><ul><li><em>Time on App mattered</em></li><li><em>Time on Website barely moved the needle</em></li></ul><p><em>This suggests the app provides a smoother or more effective shopping experience.</em></p><p><strong><em>🔑 Insight 3: Not All Engagement Is Equal</em></strong></p><p><em>More time doesn’t always mean more money, </em><strong><em>where</em></strong><em> customers spend that time matters.</em></p><h4>💼 Business Recommendations</h4><ol><li><strong><em>Focus on Customer Retention</em></strong></li></ol><ul><li><em>Loyalty programs</em></li><li><em>Membership incentives</em></li><li><em>Personalized experiences</em></li><li><em>Retention drives revenue.</em></li></ul><p><strong><em>2. Invest in the Mobile App</em></strong></p><ul><li><em>Improve UX</em></li><li><em>Optimize checkout flow</em></li><li><em>Personalized push notifications</em></li><li><em>App-exclusive offers</em></li></ul><p><em>The data clearly favors the app.</em></p><p><strong><em>3. Maintain (Don’t Abandon) the Website</em></strong></p><p><em>The website still supports:</em></p><ul><li><em>Discovery</em></li><li><em>Trust-building</em></li><li><em>Customer onboarding</em></li></ul><p><em>But it’s not the</em><strong><em> primary growth </em></strong><em>lever.</em></p><h4>🏁 Final Thoughts</h4><p><em>This project highlights a key lesson:</em></p><blockquote><strong>Great data analysis combines visualization, modeling, and storytelling.</strong></blockquote><p><em>When EDA, correlation, and regression all point in the same direction, insights become powerfuland actionable.</em></p><h3>🙌 Thanks for Reading</h3><p><em>If you enjoyed this walkthrough:</em></p><ul><li><em>Share it</em></li><li><em>Leave a comment</em></li><li><em>Connect with me </em><a href="https://www.linkedin.com/in/frank-agba"><em>@Frank Agba</em></a></li></ul><p><em>I’ll be publishing more </em><strong><em>hands-on data analytics projects</em></strong><em> and real-world insights.</em></p><p><strong><em>Happy analyzing 🚀</em></strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b31d443e37ed" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>