<?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 SadhanaT on Medium]]></title>
        <description><![CDATA[Stories by SadhanaT on Medium]]></description>
        <link>https://medium.com/@sadhanabalachandran?source=rss-99e1cd6de239------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/proxy/1*TGH72Nnw24QL3iV9IOm4VA.png</url>
            <title>Stories by SadhanaT on Medium</title>
            <link>https://medium.com/@sadhanabalachandran?source=rss-99e1cd6de239------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 27 Nov 2026 22:45:34 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@sadhanabalachandran/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[A Visual Deep Dive Into Regression Error Metrics : The Metrics that Matter in ML]]></title>
            <link>https://medium.com/@sadhanabalachandran/a-visual-deep-dive-into-regression-error-metrics-the-metrics-that-matter-in-ml-5164f7d764d3?source=rss-99e1cd6de239------2</link>
            <guid isPermaLink="false">https://medium.com/p/5164f7d764d3</guid>
            <dc:creator><![CDATA[SadhanaT]]></dc:creator>
            <pubDate>Tue, 25 Nov 2025 10:26:09 GMT</pubDate>
            <atom:updated>2025-11-25T10:26:09.841Z</atom:updated>
            <content:encoded><![CDATA[<h3>A Visual Deep Dive Into Regression Error Metrics : The Metrics that Matter in ML</h3><p>If you’re new to Data Science, one of the first questions you’ll eventually ask is: <em>“My model gives predictions… but how do I know if they’re actually good?”</em></p><p>Every ML beginner (and honestly, many pros) hits that moment where predictions look fine, but nothing tells you whether the model is trustworthy. That’s where <strong>regression error metrics</strong> step in — the quiet heroes🧑‍🔬 that help you understand how your model behaves in the real world<em>.</em></p><p>Machine learning models don’t fail because they make bad predictions — They fail because we never measure <em>how bad</em> those predictions really are.</p><p>There are several Machine Learning Algorithms in the world of a Data science sharing the overall flow for ML Learnings</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*v_r2kE9Rk066eCjntlyNvw.jpeg" /></figure><h3>🌱 So What’s Regression?</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4sona_3hm6udcAOgwIee8w.jpeg" /></figure><p>If you’ve just stepped into the world of machine learning, you’ve probably heard the word <strong><em>regression </em></strong>everywhere.</p><blockquote>Regression is a technique that allows us to predict a specific numerical value based on input data.</blockquote><blockquote>Regression is a statistical + machine learning method used to predict a<em> </em><strong>continuous</strong><em> value</em> based on data.</blockquote><p>Think of regression as discovering the relationship between:</p><ul><li><strong>Input (X):</strong> What you already know</li><li><strong>Output (Y):</strong> What you want to predict</li></ul><p>The model learns this relationship by drawing the best-fit line (or curve) through the data, allowing it to make accurate predictions for new inputs.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SI36sgvRnIbFYIZT3y6CMQ.jpeg" /></figure><h3>🧩 Why is Regression Used?</h3><p>Regression is used across for several attributes such as,</p><ul><li>Prediction</li><li>Understanding relationships</li><li>Forecasting</li><li>Trend analysis</li><li>Decision making</li></ul><p><strong>💡So what’s an Error Metric?</strong></p><p>Error metrics simply measure how bad your predictions are.</p><p>But here’s the truth most people forget to tell you:</p><p>👉 <em>Predicting is easy.<br>Knowing how good your predictions are is what actually matters.</em></p><p>That’s where regression error metrics come in.</p><p>In this blog, I’m going to explain the most important error metrics in regression using simple everyday examples — no heavy math, no complexity.</p><h3>🌟 Why Do We Need Error Metrics?</h3><p>Error metrics tell us:</p><ul><li>How wrong we are</li><li>How often we are wrong</li><li>How big the mistakes are</li><li>Whether adding more features is helping or hurting</li></ul><p>They are like the report card of your regression model.</p><p><em>For example, imagine you’re running a food delivery app.</em></p><p><em>Actual delivery time = 30 minutes<br>Your predicted delivery time = 40 minutes</em></p><p><em>The difference = 10 minutes<br>This difference is an error.</em></p><p>We have the below Error Metrics defined for an Regression Model</p><ol><li>Sum of Squared Errors (SSE)</li><li>Mean Absolute Error (MAE)</li><li>Mean Squared Error (MSE)</li><li>Root Mean Squared Error (RMSE)</li><li>Mean Absolute Percentage Error (MAPE)</li><li>R-squared (R²)</li></ol><p>Now lets revisit these error metrics on a plain mathematical way to understand the theories behind it, <em>Hey No big</em> theories or Math here keeping it simple crisp and clean</p><h3>⏹️ Sum of Squared Errors (SSE)</h3><p><strong>SSE </strong>= Sum of Squared Errors is one of the most basic ways to measure the total error in a regression model.</p><ul><li>Error = difference between the actual value and the predicted value.</li><li>SSE squares each error (to remove negative signs and emphasize bigger mistakes) and adds them all up.</li></ul><p>Formula (simple version):</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/514/1*OsEXSCHgzkp66KrBwIx2HQ.png" /></figure><p>Where:</p><ul><li>yi = actual value</li><li>y^i = predicted value</li><li>n = number of observations</li></ul><p>🔹 <strong>Why square the errors?</strong></p><ol><li>To avoid positive and negative errors canceling each other out.</li><li>To penalize larger mistakes more heavily- Squaring makes the big mistake “heavier” so the model<strong> </strong>pays more attention to fixing it. (Like a prediction that’s off by 10 counts more than two predictions off by 5 each).</li></ol><p><strong>SSE is Used to understand performance when:</strong></p><ul><li>SSE tells you <strong>how far off your predictions are in total</strong>.</li><li>If SSE is very high → model is performing poorly</li><li>If SSE is low → model is doing a good job predicting the target</li></ul><blockquote><strong>Why SSE alone is not enough</strong></blockquote><ul><li><strong>SSE</strong> is just the <strong>total sum of squared errors</strong>.</li><li>Its value depends on <strong>how many data points you have</strong>.</li><li>More data → naturally bigger SSE, even if your model is good.</li><li>It’s <strong>hard to interpret in the units of your target variable</strong>, because the errors are squared.</li></ul><p>📍That’s why we also go to Other Core Error Metrics:</p><h3>📏 1. Mean Absolute Error (MAE)</h3><p><strong>Definition:<em> MAE</em></strong> is a metric that tells us, <strong>on average, how far off our predictions are from the actual values</strong>.</p><ul><li>It takes the <strong>absolute value of each error</strong> (so negative and positive errors don’t cancel out).</li><li>Then it calculates the <strong>average of all those absolute errors</strong>.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/407/1*2kK5bkloRTtYNC7kOMp5Hw.png" /></figure><p><strong>Why it’s useful</strong></p><ul><li>Shows the <strong>average “mistake”</strong> in your predictions.</li><li>Easy to understand because it’s in the <strong>same units as your target variable</strong>.</li></ul><p>Less sensitive to <strong>very large errors</strong> compared to MSE/RMSE.</p><h3>📐 2. Mean Squared Error (MSE)</h3><p><strong>Definition: </strong>It tells us, on average, <strong>how far off our predictions are from the actual values</strong>, but with a twist:</p><ul><li>Each error is <strong>squared</strong>, so bigger mistakes count more.</li></ul><p>Then we take the <strong>average of all squared errors</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/650/1*ayegQVtHaMFC6-ygzFI2fg.png" /></figure><p><strong>Why use MSE?</strong></p><ol><li>Squaring avoids cancellation of positive and negative errors.</li><li>Bigger errors are penalized more heavily, which helps models focus on avoiding large mistakes.</li><li>Commonly used as a loss function when training regression models.</li></ol><p>✅ <strong>Key Takeaway:</strong></p><ul><li>A bigger MSE than MAE is <strong>normal and expected</strong>.</li><li>Use <strong>MAE</strong> when you want <strong>average error in real units</strong>.</li><li>Use <strong>MSE/RMSE</strong> when you want to <strong>penalize large mistakes more</strong>.</li></ul><h3>📉 3. Root Mean Squared Error (RMSE)</h3><p><strong>Definition: RMSE</strong> stands for <strong>Root Mean Squared Error</strong>.</p><ul><li>It’s built on <strong>MSE (Mean Squared Error)</strong>.- Square root of MSE</li><li>RMSE tells us, on average, <strong>how far our predictions are from the actual values</strong>, but in the <strong>same units as the target variable</strong>.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/578/1*fc9RRMRtFraLEA_E3CT5Fw.png" /></figure><p>Where:</p><ul><li>yi = actual value</li><li>y^i = predicted value</li><li>n = number of observations</li></ul><h3>📊 4. Mean Absolute Percentage Error (MAPE)</h3><p><strong>Definition: MAPE</strong> tells us, on average, <strong>how far off our predictions are as a percentage of the actual values</strong>.</p><ul><li>Instead of looking at absolute numbers (like minutes or dollars), it shows <strong>error in percentage terms</strong>, which makes it easier to compare across different scales.</li><li>Useful when you want to understand <strong>relative error</strong>.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/486/1*V9zNElQesy6qM8MXaQcovg.png" /></figure><p>Where:</p><ul><li>yi = actual value</li><li>y^i = predicted value</li><li>n = number of observations</li></ul><h3>5. R-squared (R²)</h3><p><strong>Definition: R-squared</strong> measures <strong>how well your regression model explains the variation in the target variable</strong>.</p><ul><li>It tells us the <strong>proportion of the total variability in the data that the model can explain</strong>.</li><li>Values range from <strong>0 to 1</strong>:</li><li><strong>0</strong> → model explains none of the variability (bad)</li><li><strong>1</strong> → model explains all of the variability (perfect)</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/578/1*WTIiGEXovQJAZEmpyRqatQ.png" /></figure><p>Where — yˉˉ​ = mean of actual values</p><p>Here’s a <strong>clear table</strong> summarizing <strong>when to use each regression metric</strong>, tailored to real-world prediction scenarios:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/530/1*BpSHC9ENUdZB0XEVl7KqOA.png" /></figure><h4><strong>Too Big? Got a quick cheat sheet covered for you:</strong></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8M53VlRW5FStyxbtDYlnsQ.jpeg" /></figure><h3>🚚 Scenario: Predicting Food Delivery Time</h3><p>Just an example to understand the results, for each error metric.</p><p>You built a model to predict delivery times (in minutes).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/605/1*V60s2uLObZp0POQzZrc9yQ.png" /></figure><p><strong>Step 1:</strong> Calculate the sums</p><ul><li><strong>Sum of Absolute Errors</strong> = 10 + 5 + 5 + 15 + 2 = <strong>37</strong></li><li><strong>Sum of Squared Errors</strong> = 100 + 25 + 25 + 225 + 4 = <strong>379</strong></li><li><strong>Sum of Percentage Errors</strong> = 33.3 + 20 + 10 + 33.3 + 5.7 ≈ <strong>102.3%</strong></li></ul><p><strong>Step 2:</strong> Compute the metrics:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/706/1*EtqJEA1pcSkflGnleDF3VQ.png" /></figure><h3>📏 1. MAE — Mean Absolute Error</h3><p>MAE = 7.4</p><p>✔️On average, the delivery predictions are off by 7.4 minutes.</p><p>✔️ It tells you the typical mistake in real units (minutes).</p><p>Good for interpretability — managers and customers understand “minutes.”</p><h3>📐 2. MSE — Mean Squared Error</h3><p>MSE = 75.8</p><p>✔️ This number is higher because big errors are punished more.</p><p>Order 4 had a 15-minute error, so MSE shoots up.</p><p>✔️ If large delays matter (like late deliveries hurting ratings), MSE highlights them strongly.</p><h3>📉 3. RMSE — Root Mean Squared Error</h3><p>RMSE = 8.7</p><p>✔️ Your model is roughly 8.7 minutes wrong, on average.</p><p>It’s similar to MAE but gives more weight to big mistakes.</p><p>✔️ RMSE is easier to read than MSE because it’s in minutes, not squared minutes.</p><h3>📊 4. MAPE — Mean Absolute Percentage Error</h3><p>MAPE = 20.46%</p><p>✔️ Your predictions are 20.46% inaccurate.</p><p>✔️ Helps compare performance across different restaurants or locations, even if their delivery durations differ.</p><h3>🧮 5. R² — R-squared</h3><p>Let’s simplify the calculation logic:</p><p>Total variation in actual times (SST)</p><p>Variation not explained by model (SSE)</p><p>Assume we compute:</p><p>R² = 0.78</p><p>✔️Your model explains 78% of the variation in delivery times.</p><p>✔️ Tells you how well the model fits the data.</p><p>⭐ <strong>Summary of All Results:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/566/1*Aa5T7oeR-ZLLty1lQp5qZg.png" /></figure><h3>📌 What Do You Actually Do With Error Metrics?</h3><p>Once you calculate metrics like <strong>SSE, MSE, RMSE, MAPE, and R²</strong>, the real question is:<br> <strong>What do these numbers help you decide?</strong></p><p>Most beginners stop at calculating the metrics, but the real value comes from how you <em>use</em> them.<br> Here’s a clear, practical breakdown.</p><h3>✅ 1. Use Metrics to Choose the Best Model</h3><p>Often, you build multiple models:</p><ul><li>Linear Regression</li><li>Decision Tree</li><li>Random Forest</li><li>XGBoost</li><li>Neural Network</li></ul><p>You then compare each model using your metrics.</p><p>Pick the model with:</p><ul><li><strong>Lowest</strong> SSE / MSE / RMSE / MAPE</li><li><strong>Highest</strong> R²</li></ul><p>This becomes your <strong>final selected model</strong>.</p><h3>✅ 2. Use Metrics to Understand What’s Going Wrong</h3><p>Each metric exposes a different type of error:</p><ul><li><strong>MAE / RMSE high</strong> → Model makes big mistakes</li><li><strong>MAPE high</strong> → Accuracy poor in percentage terms</li><li><strong>SSE high</strong> → Overall errors are large</li><li><strong>R² low</strong> → Model is not capturing patterns in data</li></ul><p>These insights tell you <em>why</em> the model is struggling.</p><h3>✅ 3. Use Metrics to Improve Your Model</h3><p>Metrics guide your next steps in tuning the model.</p><p>If RMSE or MSE is high:</p><p>→ Remove outliers, add features, try a more complex model.</p><p>If MAPE is high:</p><p>→ Data has large scale differences → use log transforms or MSLE.</p><p>If R² is low:</p><p>→ Model is too simple → try nonlinear models or feature engineering.</p><p>Metrics give you a <strong>diagnosis</strong>, so you know how to fix the model.</p><h3>✅ 4. Use Metrics to Check Whether the Model Is Good Enough</h3><p>Metrics help you decide if the model is ready for production.</p><p>Examples:</p><ul><li>Delivery-time model with <strong>MAE = 6 min</strong> → acceptable</li><li>Delivery-time model with <strong>MAE = 25 min</strong> → useless</li><li>House price model <strong>RMSE = ₹1.2 lakh</strong> → good</li><li>House price model <strong>RMSE = ₹15 lakh</strong> → not usable</li><li>Metrics show whether the predictions are within <strong>real-world tolerance</strong>.</li></ul><h3>✅ 5. Use Metrics to Communicate Performance</h3><p>You need to report model performance to:</p><ul><li>Business teams</li><li>Clients</li><li>Managers</li><li>Data scientists</li></ul><p>Metrics help you clearly explain your model’s reliability.</p><p><strong>Example:</strong></p><p>“The model achieves RMSE = 8.7 minutes and R² = 0.78,<br> meaning it explains most of the variation and is accurate enough for deployment.”</p><p>This makes your results <strong>understandable, transparent, and trustworthy</strong>.</p><h3>⭐ Final Takeaway</h3><p>Error metrics are not just numbers — <br> They are <strong>decision-making tools</strong>.</p><p>You use them to:</p><ul><li>Select models</li><li>Diagnose issues</li><li>Guide improvements</li><li>Validate accuracy</li><li>Communicate results</li></ul><p>Together, they help you build <strong>better, more reliable</strong> regression models.</p><p>Again a Reliable cheat sheet,</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LRjWLIJ5yR2P4skRDA2Bpg.jpeg" /></figure><h3>🔚 Closing Thoughts</h3><p>Understanding regression error metrics is more than a math exercise — it’s the foundation of building trustworthy machine learning models. Whether you’re predicting delivery times, house prices, or customer demand, these metrics give you the language to evaluate your model, the tools to improve it, and the confidence to deploy it.</p><h4><strong>By now, you know:</strong></h4><ul><li><strong>Which metric to choose</strong> depending on your data</li><li><strong>How to interpret</strong> metrics like SSE, MSE, RMSE, MAPE, and R²</li><li><strong>What to do after calculating them</strong></li><li><strong>How to use metrics to refine, validate, and communicate</strong> model performance</li></ul><p>And that’s the real goal:<br> Not just building models, but understanding them deeply enough to make smarter decisions.</p><p>If you’re just getting started, treat these metrics as your <strong>cheat sheet</strong>.<br> If you’re already in the ML space, use them as your <strong>quality control checklist</strong>.</p><p>Machine learning isn’t just about prediction — <br> it’s about <strong>knowing how good your predictions really are.</strong></p><p>Thanks for reading!<br> If you want more breakdowns like this (with infographics!), feel free to follow along. 🚀</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5164f7d764d3" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>