<?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 Sydneyhustings on Medium]]></title>
        <description><![CDATA[Stories by Sydneyhustings on Medium]]></description>
        <link>https://medium.com/@sydneyhustings?source=rss-c126909363b5------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*1Khqpi2NIVTXOggc</url>
            <title>Stories by Sydneyhustings on Medium</title>
            <link>https://medium.com/@sydneyhustings?source=rss-c126909363b5------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 01 Dec 2026 06:55:44 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@sydneyhustings/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[Predicting Customer Churn Using Power BI and Python: A Telco Case Study]]></title>
            <link>https://medium.com/@sydneyhustings/predicting-customer-churn-using-power-bi-and-python-a-telco-case-study-88d1ed8a160b?source=rss-c126909363b5------2</link>
            <guid isPermaLink="false">https://medium.com/p/88d1ed8a160b</guid>
            <category><![CDATA[churn-analysis]]></category>
            <category><![CDATA[power-bi]]></category>
            <category><![CDATA[data-analysis]]></category>
            <category><![CDATA[churn]]></category>
            <category><![CDATA[python]]></category>
            <dc:creator><![CDATA[Sydneyhustings]]></dc:creator>
            <pubDate>Sun, 12 Oct 2025 16:36:37 GMT</pubDate>
            <atom:updated>2025-10-13T08:41:54.048Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/376/1*AHCr0XcdSL8LjniDFA2pQQ.png" /><figcaption>Customer Churn</figcaption></figure><p><strong>Overview</strong></p><p>What is Customer churn? This is essentially the rate at which customers leave a business against the total number of customers actively in business. This is also known as <em>churn rate </em>or <em>customer attrition</em>.</p><p>In this project, I analyzed customer churn data from a telecommunications company to understand <em>why customers leave</em> and to <em>predict which ones are likely to leave next. </em>Using my model, I can help your organisation identify churners with 80% accuracy.</p><p><strong>Project Objective:</strong></p><p>The project aims to analyze customer churn in a telecommunications company and develop predictive models to identify at-risk customers. The ultimate goal is to provide actionable insights and recommendations to reduce churn and improve customer retention.</p><p><strong>Tools: </strong>I combined <strong>Power BI</strong> for visualization and <strong>Python </strong>for prediction, creating an end-to-end data story from insight to action.</p><p><strong>About the data</strong></p><p>The raw data was provided in the form of a <a href="https://github.com/technwa/PortfolioProjects/blob/main/customer_churn_data.csv"><em>CSV file</em></a> with 7,000 rows of data. Data was sourced from a telecommunications company that was looking to improve its customer retention.</p><p><strong><em>Note</em></strong>: all personally Identifiable information has been removed from this data to protect customers’ private and sensitive information.</p><p><strong>Data Dictionary</strong></p><p><strong>customerID:</strong> identifier for each customer.</p><p><strong>Gender: </strong>indicates the gender of the customer.</p><p><strong>SeniorCitizen: </strong>Indicates whether the customer is a senior citizen</p><p><strong>Partner: </strong>Whether the customer has a partner.</p><p><strong>Dependents: </strong>Whether the customer has dependents.</p><p><strong>Tenure: </strong>Number of months the customer has stayed with the company.</p><p><strong>PhoneService: </strong>Indicates if the customer has phone service.</p><p><strong>MultipleLines: </strong>Whether the customer has multiple phone lines.</p><p><strong>InternetService: </strong>Type of internet service subscribed to.</p><p><strong>TechSupport: </strong>The customer has a tech support add-on.</p><p><strong>StreamingTV: </strong>Whether the customer has a streaming TV service.</p><p><strong>Contract: </strong>Type of contract the customer is under.</p><p><strong>PaymentMethod: </strong>The method used by the customer to make payments.</p><p><strong>MonthlyCharges:</strong> Amount charged to the customer monthly.</p><p><strong>Churn: </strong>Indicates whether the customer has churned (left the company).</p><p><strong>Data Discovery</strong></p><p>Using Power Query, I analyzed the data and also checked the columns for their importance to the business task. It was possible for me to validate that there was enough data to support my analysis. But on the other hand, the data required cleaning and proper transformation into a form that would be suitable for the analysis.</p><p><strong>Analytical Steps</strong></p><ol><li>Data Understanding</li><li>Data Cleaning</li><li>Data Transformation</li><li>Data Modeling</li><li>Exploratory Data Analysis (EDA)</li><li>Visualisation — Report</li><li>Predictive Modeling with Python</li><li>Insights</li><li>Recommendation</li><li>Conclusion</li><li><strong><em>Data Understanding</em></strong></li></ol><p>Initially, I imported the dataset and got it to explore in order to have a rough idea of what it was all about. The dataset consisted of customer’s demographic data like sex, age group (senior citizen), marital status, duration (in months), monthly and total charges, and a likelihood to churn score.</p><p>Before diving into analysis, I checked:</p><ul><li>The number of rows and columns</li><li>Data types (numerical vs categorical)</li><li>Whether the target column ChurnProbability had consistent values</li></ul><p>This initial review helped me understand the story behind the data.</p><p><strong><em>2. Data Cleaning</em></strong></p><p>The subsequent phase was to guarantee that the data was clean and prepared for analysis. I managed absent values, corrected data types, particularly where numbers were saved as text, and deleted duplicates. I also made categorical values such as “Yes” and “No” consistent for uniformity.</p><p>A clean dataset = accurate insights.</p><p><strong>Note</strong>: Power Query provides an <em>applied steps</em> pane, where any change made in the editor is automatically recorded. To customise this feature, which greatly aided my documentation, I renamed each step to better describe the action I took. To rename, simply right-click any of the steps and select <em>Rename.</em></p><p><strong><em>3. Data Transformation</em></strong></p><p>After cleaning, I created some calculated columns to add more analytical depth.<br> For example, I derived metrics like:</p><ul><li><strong>Average Monthly Spend</strong> = TotalCharges / Tenure</li></ul><p>I also grouped the Churn Probability into levels (Low, Medium, High) to make it easier to visualize customer risk categories.<br> This transformation step helped make the data more meaningful when visualized.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/302/1*V8HsaICBONnyMOL1jzYSfQ.png" /><figcaption>Probability Levels</figcaption></figure><p><strong><em>4. Data Modeling</em></strong></p><p>Here, I explored the relationship between these tables and how they are connected. Power BI pre-detected the cardinality of the model relationship as one-to-one, which is correct.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*47OXWG0z8u9fxXQXw00UjQ.png" /><figcaption>Tables Relationship.</figcaption></figure><p><strong><em>5. Exploratory Data Analysis (EDA)</em></strong></p><p>I began with a few quick checks to understand how customers were distributed:</p><ul><li>How many customers were senior citizens?</li><li>How was churn distributed by gender?</li><li>Did having a partner or dependents influence churn?</li></ul><p>The first patterns already started to emerge — older customers and those on month-to-month contracts showed higher churn.</p><p>This step gave me a clear sense of which factors were influencing churn most strongly.</p><p><strong><em>6. Visualisation — Report</em></strong></p><p>I started the report by creating a few DAX measures.</p><p><strong><em>DAX</em></strong> simply means Data Analysis Expression. It is an expression that helps with calculations while building a report. The three I created were:</p><ul><li>Customers(Number of customers)</li><li>Churn rate (%)</li><li>Customers Churned</li></ul><p><strong>Step</strong>:</p><p>On the right pane where the tables are listed, I right-clicked on the <em>Customer Data</em> table, then selected <em>new measure</em>. I labeled the measure as Total <em>Customers</em> and used the formula below.</p><pre>Total Customers = COUNTROWS(&#39;Telco_Customer_Churn_Dataset&#39;)</pre><p>The formula above counted all the unique rows in the dataset.</p><p>I repeated the above steps for the<em> Customer Churned </em>and <em>Churn Rate</em> measures with the respective formulas below:</p><pre>Churned Customers = <br>CALCULATE(<br>    COUNTROWS(&#39;Telco_Customer_Churn_Dataset&#39;),<br>    &#39;Telco_Customer_Churn_Dataset&#39;[Churn] = &quot;Yes&quot;)<br><br>Churn Rate = DIVIDE([Churned Customers], [Total Customers], 0)</pre><ol><li>Customers: 7K</li><li>Customers churned: 2K</li><li>Churn Rate: 27% ( Changed to % from the measures tool tab)</li></ol><p>I built my Power BI dashboard in three pages, each serving a unique purpose:</p><p><strong><em>Dashboard 1:</em></strong><em> </em><strong><em>Churn Overview</em></strong></p><p>This page summarizes key metrics:</p><ul><li>Total Customers</li><li>Overall Churn Rate</li><li>Average Tenure</li><li>Churn by Contract Type</li></ul><p>It gave a high-level snapshot of how customer retention looked across the business.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/934/1*ZjbkRNEJULfXGmJGZKi3AQ.png" /><figcaption>Churn rate overview</figcaption></figure><p><strong><em>Dashboard 2: Customer Demographics</em></strong></p><p>Here, I visualized customer groups using:</p><ul><li>Gender Distribution</li><li>Senior Citizen Status</li><li>Partner and Dependents</li></ul><p>Each visual was color-coded to make it easy to compare churned vs. retained customers.<br> From this page, it became clear that senior citizens and single customers had higher churn rates.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oThXMb6DbzBSl5o01JtmCQ.png" /><figcaption>Customer Demographics</figcaption></figure><p><strong><em>Dashboard 3: Revenue &amp; Churn Probability</em></strong></p><p>This was the predictive dashboard. I imported the output from my Python model to show each customer’s Churn Probability,<strong> </strong>highlighting those most likely to leave.</p><p>I also included:</p><ul><li>Monthly vs. Total Charges comparison</li><li>Tenure distribution</li><li>Conditional formatting to color-code risk levels:</li><li>🔴 High (≥ 0.7)</li><li>🔵 Medium (0.4–0.7)</li><li>🟢 Low (&lt; 0.4)</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*s6WyMx2-BqneOrrCdSTaXg.png" /><figcaption>Revenue &amp; Churn Probability</figcaption></figure><p><strong><em>7. Predictive Modeling with Python</em></strong></p><p>To move from descriptive to predictive analytics, I built a simple <strong>Logistic Regression</strong> model in Python.</p><p><strong>Setup</strong></p><p>I used:</p><pre>pip install pandas numpy scikit-learn</pre><p>Then imported the libraries and loaded the dataset:</p><pre>import pandas as pd<br>from sklearn.model_selection import train_test_split<br>from sklearn.preprocessing import LabelEncoder, StandardScaler<br>from sklearn.linear_model import LogisticRegression<br>from sklearn.metrics import accuracy_score<br><br>data = pd.read_csv(&quot;C:/Users/DELL/Documents/Telco_Customer_Churn_Dataset.csv&quot;)</pre><p><strong>Feature Engineering</strong></p><p>I encoded categorical variables and split the data:</p><pre>label_cols = [&#39;gender&#39;,&#39;Partner&#39;,&#39;Dependents&#39;,&#39;InternetService&#39;,&#39;Contract&#39;,&#39;PaymentMethod&#39;]<br>for col in label_cols:<br>    data[col] = LabelEncoder().fit_transform(data[col])<br><br>X = data.drop([&#39;customerID&#39;,&#39;Churn&#39;], axis=1)<br>y = data[&#39;Churn&#39;]</pre><p><strong>Training the Model</strong></p><pre>scaler = StandardScaler()<br>X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2, random_state=42)<br><br>model = LogisticRegression(max_iter=2000)<br>model.fit(scaler.fit_transform(X_train), y_train)<br>y_pred = model.predict(scaler.transform(X_test))<br>print(&quot;✅ Model Accuracy:&quot;, round(accuracy_score(y_test, y_pred), 2))</pre><p>The model achieved <strong>~80% accuracy</strong>, which was solid for a baseline.</p><p><strong>Generating Churn Probability</strong></p><p>Instead of just predicting churn “Yes/No,” I created a probability column:</p><pre>data[&#39;Churn_Probability&#39;] = model.predict_proba(scaler.transform(X))[:,1]<br>data.to_csv(&quot;C:/Users/DELL/Documents/Telco_Churn_With_Predictions.csv&quot;, index=False)</pre><p>I then imported this new CSV back into Power BI for visualization.</p><p><strong><em>8. Insights</em></strong></p><p>From both the visuals and predictions, I found that:</p><ul><li><strong>Senior citizens</strong> had a higher churn probability.</li><li><strong>Month-to-month contracts</strong> were the riskiest.</li><li><strong>Higher monthly charges</strong> correlated with higher churn likelihood.</li><li>Customers with <strong>longer tenure</strong> were far more loyal.</li></ul><p><strong>9. Recommendation</strong></p><p>Based on the analysis, here’s what I’d recommend:</p><ol><li><strong>Loyalty programs</strong> for senior and long-term customers.</li><li><strong>Discount incentives</strong> for customers with high monthly charges.</li><li><strong>Proactive engagement</strong> in the early months of new contracts.</li><li><strong>Flexible contracts</strong> to reduce cancellations.</li></ol><p><strong>10. Conclusion</strong></p><p>This project taught me the power of combining data storytelling (Power BI) with predictive analytics (Python).<br> Not only was I able to explain <em>why</em> customers churned, but I could also predict <em>who might churn next.</em></p><p>It is a great example of how data-driven insights can directly support better business decisions and how even a simple logistic regression model can deliver real-world value.</p><h4>Final Thoughts</h4><p>If you’d like to explore this dataset or collaborate on improving the churn model, feel free to connect with me!<br> Let’s keep building insights that drive retention and growth.</p><p>Thank you for reading!</p><p>I will appreciate your feedback below.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=88d1ed8a160b" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>