<?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 Chethan on Medium]]></title>
        <description><![CDATA[Stories by Chethan on Medium]]></description>
        <link>https://medium.com/@mail.chethanc?source=rss-1f6c7ff75dd8------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*_S0CADipcCHiRxHv</url>
            <title>Stories by Chethan on Medium</title>
            <link>https://medium.com/@mail.chethanc?source=rss-1f6c7ff75dd8------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 04 Dec 2026 09:04:36 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@mail.chethanc/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[Unraveling Regression Analysis: Exploring the Core Concepts]]></title>
            <link>https://medium.com/@mail.chethanc/unraveling-regression-analysis-exploring-the-core-concepts-f166fbe67b10?source=rss-1f6c7ff75dd8------2</link>
            <guid isPermaLink="false">https://medium.com/p/f166fbe67b10</guid>
            <category><![CDATA[deep-learning]]></category>
            <category><![CDATA[regression-analysis]]></category>
            <category><![CDATA[inferential-statistics]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[machine-learning]]></category>
            <dc:creator><![CDATA[Chethan]]></dc:creator>
            <pubDate>Wed, 16 Aug 2023 13:58:37 GMT</pubDate>
            <atom:updated>2023-08-16T13:58:37.733Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>About Machine Learning:</strong></p><p>At its core, machine learning, a subset of AI, transforms data inputs into outputs by unveiling patterns and rules. Unlike traditional programming where rules are explicitly defined, machine learning seeks to identify encoding functions that convert inputs (X) into outputs, aiming to approximate actual results. In essence, machine learning involves the quest for algorithms that map inputs to desired outputs.</p><p><strong>Introduction about Regression Analysis:</strong></p><p>At the heart of machine learning, we encounter a bit of a mystery: the function. This function, often written as <strong><em>y = f(x)</em></strong>, acts like a bridge between our inputs and the outcomes we want. But it’s a bit like peering into a black box — we can’t see everything that’s going on inside.</p><p>Within this function, there’s something called ‘<strong>noise</strong>’. Think of it as the stuff we can’t really measure or fit into neat mathematical rules. It’s like those unexpected things that pop up in real life and mess with our predictions.</p><p>Imagine we’re looking at a bunch of employee salaries. Normally, skills and experience determine how much someone gets paid. But sometimes, there’s a surprise — someone with little experience gets a big salary. That surprise is the noise. Maybe this person knows the company owner, which explains the anomaly.</p><p>So, the function is really <strong><em>y = f’(x) + Σ</em></strong>, where <strong><em>Σ</em></strong> represents the noise — those unmeasurable factors that throw a wrench in our calculations and x represents the inputs given to the model.</p><p>So, let’s calculate variance of a function approximated by the ML model,</p><p>Var(y) = Var(f’(x) + Σ)</p><p>using the property of variance, Var(aX + bY) = a²Var(X) + b²Var(Y) + 2abCov(X, Y), So, applying the property:</p><p>Var(f’(x) + Σ) = Var(f’(x)) + Var(Σ)</p><p>The expanded equation “Var(y) = Var(f’(x)) + Var(Σ)” tells us that the variance of the total output “y” can be decomposed into two parts:</p><ol><li>The variance of the function’s output “f’(x)” (Var(f’(x))), which represents the variability explained by the relationships between inputs and outputs.</li><li>The variance of the noise “<strong><em>Σ</em></strong>” (Var(<strong><em>Σ</em></strong>)), which represents the unmeasured and unpredictable factors that contribute to the overall variability in the output</li></ol><p>In the world of machine learning, we’re a bit like detectives. We’re trying to uncover the secrets of the function while steering clear of the noise. We use algorithms and models to bring the function into focus, so we can make predictions that match what actually happens.</p><p>Before exploring regression analysis, there are few topics need to know and they are presented below,</p><p><strong><em>Total Sum of Squares(TSS):</em></strong></p><p>This is like a yardstick that helps us measure the impact of our predictions. Imagine if we were to simply take the average of all the outputs (y-values) we have. This average, often referred to as the mean, forms a baseline. We can then calculate how much each individual output differs from this mean.</p><p>Picture this: the total sum of squares is like the sum of all those differences squared. It’s a way of quantifying how much the outputs are scattered around that mean. In other words, it’s like a measure of how spread out the data points are from that baseline average.</p><p>When we’re working with machine learning, our goal is to come up with a model that does better than just predicting the mean all the time. We want a model that can capture the relationships between inputs (x-values) and outputs (y-values), reducing that scatter in a meaningful way. This reduction in scatter, often represented by the ‘<strong><em>explained sum of squares</em></strong>’, indicates how much our model contributes to explaining the variability in the data beyond just the average.</p><p>So, in essence, we’re aiming to shrink that total sum of squares by capturing as much as we can with our model. This journey from the mean to a more accurate prediction is the heart of what we’re trying to achieve with machine learning.</p><p><strong><em>Explained Sum of Squares(ESS) and Residuals Sum of Squares(RSS):</em></strong></p><p>Imagine that our model has been put to work, learning from the data to make predictions. The explained sum of squares steps onto the stage to showcase how much our model has managed to capture and explain. This <strong><em>ESS(Explained Sum of Squares)</em></strong> quantifies the portion of variability in the outputs (y-values) that our model successfully explains. It’s like the applause our model receives for its accurate predictions — the more applause, the better our model is at explaining the data.</p><p>But, just as there’s applause, there’s also the lingering murmur of uncertainty. This is where the residual sum of squares comes into play. The RSS(Residual Sum of Squares) takes center stage to highlight the part of variability that our model couldn’t account for — those unpredictable deviations that are left unexplained. It’s as if the RSS sheds light on the aspects where our model still struggles to make sense of the data.</p><p>Think of it this way: the ESS and the RSS dance together on the stage, revealing how well our model captures the data’s essence and how much of the puzzle remains unsolved. Balancing these two sums helps us gauge the effectiveness of our model and identify where improvements might be needed.</p><p>In the grand performance of machine learning, the journey of minimizing the RSS and maximizing the ESS leads us to a model that embraces the nuances of the data while diminishing the shadows of unpredictability.”</p><p>In the grand pursuit of machine learning, our mission is clear: to uncover the inner workings of that mysterious function, the one that links inputs to outputs. It’s a bit like trying to find the best-fitting piece in a jigsaw puzzle. But there’s a twist — the puzzle is dynamic, and not all the pieces are a perfect match.</p><p>Enter the ‘residual sum of squares’ (RSS), which encapsulates both the <strong><em>reducible</em></strong> and the <strong><em>irreducible errors</em></strong>. The <strong><em>reducible error</em></strong> is like the part of the puzzle that can be solved with the right algorithms — it’s the difference between our model’s predictions and the actual outcomes. Machine learning algorithms work tirelessly to minimize this error, refining our model’s accuracy and bridging the gap between prediction and reality.</p><p>As we tweak our model, fine-tuning the parameters and adjusting the rules, we inch closer to our goal. Our model converges toward the elusive function, driven by the desire to capture as much of the data’s essence as possible. But here’s the catch — while we can diminish the reducible error, there’s another factor at play: the irreducible error.</p><p>This <strong><em>irreducible error</em></strong> is like the noise in the background, the unpredictable quirks of reality that elude mathematical explanation. Try as we might, there are elements beyond our grasp, outliers and complexities that resist our models’ best efforts.</p><p>And this is where the delicate dance of ‘overfitting’ enters the scene. In a bid to explain every twist and turn, our model might end up squeezing itself into every crevice, embracing even the noise. This might seem like a success, but it’s a pitfall — a trap that lures our model into a world of mirages, where the line between reality and randomness blurs.</p><p>In the end, machine learning strives for balance. We aim to approximate the function, get as close as possible, and yet remain cautious of overstepping into the realm of overfitting. It’s a journey that celebrates the progress made while humbly acknowledging the limits we face in our pursuit of understanding.</p><p><strong><em>Degrees of freedom:</em></strong></p><p>In the realm of statistics, the concept of degrees of freedom assumes the role of a crucial guiding factor. Imagine degrees of freedom as the leeway for change, the room for variation that can be explored. When it comes to linear regression, a vivid illustration can be found. Imagine plotting a line on a graph. To create this line, we need at least two points — they essentially fix the line in place. As a result, the line has no degrees of freedom; it’s tightly bound by those two points.</p><p>Now, imagine we add a third point to the mix. Suddenly, a new layer of flexibility emerges. With this third point, the line can take on variations while still passing through these three points. This newfound freedom is denoted by one degree of freedom — a single parameter that can shift the line’s position to align with different sets of points.</p><p>In the world of machine learning, degrees of freedom take on a role of similar importance. In machine learning, particularly in regression tasks, we assume that predicting outputs requires estimating certain parameters. These parameters, often referred to as weights (represented by ‘k’), guide the model’s behaviour. But it’s not just about estimating parameters; it’s also about understanding the influence of various variables. The degrees of freedom help us quantify the number of variables contributing to the residual sum of errors — a measure of how much unpredictability remains in our model’s predictions.</p><p>Degrees of freedom form a thread that links statistics and machine learning, intertwining the realms of fixed structure and adaptive exploration. They serve as the compass that guides our understanding of how much variation and flexibility we can embrace while still staying grounded in the realm of meaningful insights.</p><p>The degree of freedom in a regression model presents itself as a blend of two essential components: the degree of freedom of the model itself, denoted as ‘k,’ and the degree of freedom of the residual sum of squares, represented as ‘n — (k + 1).’ Let’s delve into these terms to unearth their significance.</p><p>First, consider the degree of freedom of the model, usually designated as ‘k.’ In regression, we’re on a mission to estimate weights that bring us closer to the true output. These weights are like the secret ingredients that guide our model’s predictions. In statistical terms, we’re granted the freedom to adjust these ‘k’ parameters, tinkering with their values to align our predictions with reality.</p><p>Now, shift your focus to the residual sum of squares. Imagine it as a yardstick that measures the gap between our predictions and the actual outcomes. In statistical parlance, we can think of this as a loss function — a way of assessing how far off our model’s predictions are from the real world. This residual sum of squares has its own degree of freedom, an equation marked by ‘(n — (k + 1)).’</p><p>Peeling back the layers of this equation, we find ’n’ standing for the number of input samples, ‘k’ symbolizing the parameters we’re estimating, and the ‘+ 1’ gracefully accounting for a bias term. In statistical terms, this setup means that to estimate the unexplained variance, we need a mere ‘n — k — 1’ data points. In the grander scope of machine learning, it’s about gauging the space that bridges the n-sampled reality and the realm of model predictions.</p><p>Degrees of freedom, a notion gracefully entwining both statistics and machine learning, paint a picture of flexibility within structure. They’re the threads that tie model estimation and prediction evaluation together, ushering us toward deeper understanding and mastery.</p><p>Degrees of Freedom = Degrees of Freedom of Model + Degrees of Freedom of RSS<br>Degrees of Freedom = k + (n -k-1)<br>Degrees of Freedom = n-1</p><p>This final result of n — 1 indicates that for regression analysis, you typically need n — 1 data points to achieve meaningful results in terms of degrees of freedom.</p><p><strong><em>R-Squared (R2) Score:</em></strong></p><p>Now, let’s unveil a metric that acts as a beacon in the sea of regression analysis: the R-squared (R2) score. Imagine it as a compass that guides us toward evaluating how well our model aligns with the data’s essence.</p><p>At its core, the R2 score encapsulates the relationship between the explained sum of squares (ESS) and the total sum of squares (TSS). ESS represents the portion of variability our model successfully explains, while TSS encompasses the entirety of variability in the data.</p><p>Breaking down the formula, we find that ESS is like a spotlight that shines on the model’s success, while the residual sum of squares (RSS) takes center stage to reveal the areas left unexplained. As ESS = TSS — RSS, we’re left with the simplified equation of 1 — (RSS/TSS).</p><p>This condensed equation, spanning between 0 and 1, holds the key to comprehending our model’s performance. A value close to 1 signifies a model that captures the data’s nuances exceptionally well — it’s like gazing at a near-perfect fit. On the other hand, a value inching closer to 0 conveys a model that struggles to capture the essence of the data.</p><p>Imagine the R2 score as a spectrum. A score above 0.5 suggests that the model is effectively capturing a significant portion of the data’s variability. When the score gets close to 1, it’s a sign that the model is an adept storyteller, painting the data’s narrative with precision. Conversely, a score below 0.5 nudges us to inspect the model’s performance more closely, as it may be falling short in explaining the data’s intricacies.</p><p>In the grand dance of regression, the R2 score becomes our performance gauge, an indicator of how well our model navigates the sea of variability and how tightly it aligns with the heartbeats of the data.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f166fbe67b10" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>