<?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 Aditya Gujar on Medium]]></title>
        <description><![CDATA[Stories by Aditya Gujar on Medium]]></description>
        <link>https://medium.com/@aditya.gujar20?source=rss-3e6a1fe3636------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*96javtO_Wffi14Mz8ksa4w.jpeg</url>
            <title>Stories by Aditya Gujar on Medium</title>
            <link>https://medium.com/@aditya.gujar20?source=rss-3e6a1fe3636------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 01 Dec 2026 14:48:48 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@aditya.gujar20/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[How does the Gradient Descent optimizer work?]]></title>
            <link>https://medium.com/@aditya.gujar20/how-does-the-gradient-descent-optimizer-work-8f71422503f5?source=rss-3e6a1fe3636------2</link>
            <guid isPermaLink="false">https://medium.com/p/8f71422503f5</guid>
            <category><![CDATA[mathematics]]></category>
            <category><![CDATA[optimization]]></category>
            <category><![CDATA[gradient-descent]]></category>
            <category><![CDATA[deep-learning]]></category>
            <category><![CDATA[python]]></category>
            <dc:creator><![CDATA[Aditya Gujar]]></dc:creator>
            <pubDate>Thu, 23 Jan 2025 14:49:40 GMT</pubDate>
            <atom:updated>2025-01-23T14:59:41.409Z</atom:updated>
            <content:encoded><![CDATA[<p>In machine learning, training a model involves fine-tuning various parameters, like weights and biases, to make the model as accurate as possible. The process behind this fine-tuning is called <strong>gradient descent</strong>, an optimization technique that helps the model learn from its mistakes and improve iteratively. In this article, we’ll break down the key components of gradient descent and explain how they work together to minimize errors (cost function).</p><h4>Unveiling Weights and Biases</h4><p>To understand gradient descent, we first need to know about <strong>weights</strong> and <strong>biases</strong>. These are the parameters that a machine learning model uses to make predictions. Weights control the importance of each input feature, while biases shift the output to better fit the data.</p><p>Imagine you’re predicting house prices based on features like square footage, number of bedrooms, etc. The weights would indicate how much each of these features influences the final price, and the bias ensures that the model can make predictions even when all features are zero.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/533/1*ROxum8mMmHiLek4NwjNL7A.png" /></figure><p>The goal of gradient descent is to adjust these weights and biases to reduce the difference between the model’s predictions and the actual values (known as the <strong>cost function</strong>).</p><h4>Decoding the Cost Function: Why MSE is Key to Optimization</h4><p>The <strong>cost function</strong> quantifies how well a model’s predictions match the actual outcomes. The most common cost function used in regression problems is <strong>Mean Squared Error (MSE)</strong>, which measures the average squared difference between predicted and true values.</p><p>Mathematically, MSE is defined as:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/354/1*GcubpXi3xVHNFsRS8-Aipw.png" /></figure><p>Where:</p><ul><li>ypredicted​ is the predicted value.</li><li>ytrue​ is the actual value.</li><li>n is the number of data points.</li></ul><p>The smaller the MSE, the better the model is at making accurate predictions. Gradient descent aims to minimize this MSE by adjusting the weights and biases during each iteration.</p><h4>The Power of the Slope</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/364/1*cQ9-A0GItdWQ6VEZGZ3_hA.png" /></figure><p><strong>Gradient Descent Curve:</strong> Gradient descent is like navigating a mountain terrain to find the lowest valley, where each step represents an intelligent adjustment of model parameters (weights and biases). Imagine standing on a complex, undulating landscape where your goal is to reach the absolute lowest point as efficiently as possible. The curve represents how model error changes with different parameter configurations, creating a topographical map of potential solutions.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*C6hPBo8qs5y_LNkU8LFuEQ.png" /></figure><p><strong>Slope:</strong> A slope at a particular point on a curve represents the instantaneous rate of change at that specific location. Think of it as drawing a straight line that just touches the curve at one point, without cutting through it. This line’s angle reveals how steeply the curve is rising or falling at that exact moment. In mathematical terms, the slope is the derivative of the curve at a specific parameter value. It shows the curve’s behavior — whether it’s increasing, decreasing, or momentarily flat — providing insight into the function’s characteristics at that precise point.</p><h4>Finding the Slope at a Specific Parameter Value</h4><p>Before understanding how to calculate slope let’s understand what are derivatives and partial derivatives</p><p><strong>Derivative: </strong>Imagine you’re driving a car. Your speed is constantly changing, right? The derivative is like a speedometer that tells you how fast your speed is changing at any given moment. It’s the rate of change of a function at a specific point.</p><p><strong>Partial Derivative:</strong> Now, imagine you’re driving a car in a city with lots of traffic lights and turns. Your speed depends not only on time but also on your direction. The partial derivative is like a speedometer that tells you how fast your speed is changing in one specific direction, while keeping all other directions constant. It’s the rate of change of a multivariable function with respect to one variable, while holding all other variables constant.</p><p><strong>Dataset Example:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/887/1*AxZaHTLjoWRNXsu3zfhgpw.png" /></figure><p><strong>Model:</strong> We can create a simple linear model to predict the price based on these features:</p><pre>Price = w1 * Size + w2 * Bedrooms + b</pre><p>where:</p><ul><li>w1 and w2 are the weights, representing the influence of size and bedrooms on the price, respectively.</li><li>b is the bias term.</li></ul><p><strong>Derivative:</strong></p><ul><li><strong>Interpretation:</strong> The derivative of the price with respect to the size (dPrice/dSize) tells us how much the price changes for a unit change in the size of the house, keeping the number of bedrooms constant.</li><li><strong>Example:</strong> If dPrice/dSize is 100, it means that for every additional square foot, the price increases by $100, assuming the number of bedrooms remains the same.</li></ul><p><strong>Partial Derivative:</strong></p><ul><li><strong>Interpretation:</strong> The partial derivative of the price with respect to the size (∂Price/∂Size) is similar to the derivative, but in the context of a multivariable function. It tells us how much the price changes for a unit change in the size, while holding the number of bedrooms constant.</li><li><strong>Example:</strong> In our model, the partial derivative of the price with respect to the size would be w1. This means that for every additional square foot, the price changes by w1 dollars, regardless of the number of bedrooms.</li></ul><p><strong>Why Partial Derivatives are Used in Gradient Descent?</strong></p><p><strong>Why Not Derivatives?</strong></p><ul><li><strong>Dealing with Multivariable Functions:</strong> In most machine learning models, the cost function is a function of multiple parameters (weights, biases, etc.).</li><li><strong>Derivatives Capture Change in One Variable:</strong> A simple derivative only captures how the function changes with respect to a single variable. It wouldn’t account for the simultaneous influence of all the parameters on the cost.</li></ul><p><strong>Why Partial Derivatives?</strong></p><ul><li><strong>Capturing Influence of Individual Parameters:</strong> Partial derivatives allow us to isolate the impact of each individual parameter on the cost function. We calculate the partial derivative of the cost function with respect to one parameter while holding all other parameters constant.</li><li><strong>Guiding Parameter Updates:</strong> By calculating the partial derivative for each parameter, we obtain the gradient vector. This vector indicates the direction of the steepest increase in the cost function. In gradient descent, we move in the opposite direction of the gradient to minimize the cost.</li></ul><p>The slope of the gradient descent curve is directly related to the magnitude of the partial derivatives. Here’s how:</p><ul><li><strong>Steeper Slope, Larger Step:</strong> When the partial derivatives are large (indicating a steep slope in the cost function), the gradient descent algorithm takes larger steps. This is because the direction of steepest descent is more pronounced, and the algorithm can confidently move further in that direction.</li><li><strong>Shallower Slope, Smaller Step:</strong> As the algorithm approaches the minimum of the cost function, the partial derivatives become smaller. This results in smaller steps taken by the gradient descent algorithm. This is because the slope is gentler, and the algorithm needs to be more cautious to avoid overshooting the minimum.</li></ul><h4>Learning Rate (η (eta))</h4><p>The learning rate is a crucial hyperparameter in gradient descent. It determines the size of the steps taken during each iteration of the algorithm as it moves towards the minimum of the cost function.</p><p><strong>How it Works:</strong></p><ul><li><strong>Step Size Control:</strong> The learning rate directly controls the magnitude of the parameter updates. A higher learning rate means larger steps, while a lower learning rate means smaller steps.</li><li><strong>Convergence:</strong> The choice of learning rate significantly impacts the convergence of the gradient descent algorithm.</li></ul><p><strong>Impact of Learning Rate:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*a95uERrBz7LOr3EIPtAmIA.png" /></figure><p><strong>Too High:</strong></p><ul><li><strong>Overshooting:</strong> The algorithm may overshoot the minimum of the cost function, leading to divergence or oscillation.</li><li><strong>Missing the Minimum:</strong> It might jump over the optimal solution and never converge.</li></ul><p><strong>Too Low:</strong></p><ul><li><strong>Slow Convergence:</strong> The algorithm will take a very long time to reach the minimum, potentially making the training process inefficient.</li></ul><h4>Updating the parameters</h4><p>new_parameter = old_parameter — (learning_rate * gradient)</p><p><strong>Key Points:</strong></p><ul><li>The gradient provides the direction of steepest ascent.</li><li>The learning rate controls the step size.</li><li>The update rule moves the parameters in the direction of steepest descent to minimize the cost function.</li></ul><h4>Putting It All Together</h4><ol><li><strong>Initialize Parameters:</strong> Start with random initial values for the model’s weights and biases.</li><li><strong>Forward Pass:</strong> Feed the input data into the model to obtain predictions.</li><li><strong>Calculate Loss:</strong> Compute the difference between the model’s predictions and the actual target values using the cost function (e.g., MSE).</li><li><strong>Backward Pass (Backpropagation):</strong> Calculate the gradient of the loss function with respect to each parameter. This involves computing partial derivatives of the loss function.</li><li><strong>Parameter Update:</strong></li></ol><ul><li>Multiply the gradient of each parameter by the learning rate.</li><li>Subtract this value from the current value of the parameter.</li><li>This effectively moves the parameter in the opposite direction of the gradient, towards the region of lower loss.</li></ul><h4><strong>Gradient Descent Example</strong></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/737/1*ATboNCfP8Yba1LYKF5ggAg.png" /></figure><p><strong>Scenario:</strong></p><p><strong>Model:</strong> Linear Regression with 3 input features (x1, x2, x3), 1 bias term (b).</p><p><strong>Initial Values:</strong></p><ul><li><strong>Weights (w1, w2, w3):</strong> (0.5, 0.2, -0.1)</li><li><strong>Bias (b):</strong> 0.3</li><li><strong>Learning Rate (η):</strong> 0.01</li></ul><p><strong>Model:</strong></p><pre>y_pred = w1*x1 + w2*x2 + w3*x3 + b</pre><p><strong>MSE Calculation:</strong></p><pre>squared_error = (y - y_pred)^2<br>MSE = (1/n) * Σ(squared_error)</pre><p><strong>Parameter Update:</strong></p><pre>new_weight = old_weight - η * gradient_weight<br>new_bias = old_bias - η * gradient_bias</pre><p><strong>Iterations 1</strong></p><p>Initial Parameters:<br> — w1 = 0.5, w2 = 0.2, w3 = -0.1, b = 0.3<br> — Learning rate (η) = 0.01<br> <br><strong> Step 1:</strong> Calculate y_pred for all rows in the dataset<br> Model:<br> y_pred = w1 * x1 + w2 * x2 + w3 * x3 + b<br> <br> Row 1 (x1 = 1, x2 = 2, x3 = 3):<br> y_pred = 0.5 * 1 + 0.2 * 2 + (-0.1) * 3 + 0.3 = 0.9<br> <br> Row 2 (x1 = 4, x2 = 5, x3 = 6):<br> y_pred = 0.5 * 4 + 0.2 * 5 + (-0.1) * 6 + 0.3 = 2.7<br> <br> Row 3 (x1 = 7, x2 = 8, x3 = 9):<br> y_pred = 0.5 * 7 + 0.2 * 8 + (-0.1) * 9 + 0.3 = 4.5<br> <br><strong> Step 2:</strong> Compute Gradients for Iteration 1<br> Target y: [10, 20, 30]<br> Predictions y_pred: [0.9, 2.7, 4.5]<br> Errors y — y_pred: [9.1, 17.3, 25.5]<br> <br> Gradients:<br> Gradient_w1 = -(2/n) * Σ((y — y_pred) * x1)<br> Gradient_w2 = -(2/n) * Σ((y — y_pred) * x2)<br> Gradient_w3 = -(2/n) * Σ((y — y_pred) * x3)<br> Gradient_b = -(2/n) * Σ(y — y_pred)<br> <br> Calculations:<br> n = 3<br> <br> Gradient_w1 = -2/3 * (9.1 * 1 + 17.3 * 4 + 25.5 * 7) = -171.2<br> Gradient_w2 = -2/3 * (9.1 * 2 + 17.3 * 5 + 25.5 * 8) = -205.8<br> Gradient_w3 = -2/3 * (9.1 * 3 + 17.3 * 6 + 25.5 * 9) = -240.4<br> Gradient_b = -2/3 * (9.1 + 17.3 + 25.5) = -34.6<br> <br><strong> Step 3:</strong> Update Parameters for Iteration 1<br> New w1 = w1 — η * Gradient_w1 = 0.5–0.01 * (-171.2) = 2.212<br> New w2 = w2 — η * Gradient_w2 = 0.2–0.01 * (-205.8) = 2.258<br> New w3 = w3 — η * Gradient_w3 = -0.1–0.01 * (-240.4) = 2.304<br> New b = b — η * Gradient_b = 0.3–0.01 * (-34.6) = 0.646<br> <br> Updated Parameters after Iteration 1:<br> w1 = 2.212, w2 = 2.258, w3 = 2.304, b = 0.646</p><p><strong>Iteration 2</strong></p><p>Repeat the process with the updated parameters to compute new gradients and update the parameters again.</p><p><em>Continue updating the weights until the cost function becomes minimal.</em></p><h4><strong>Python Code</strong></h4><pre>import numpy as np<br><br># Define the dataset<br>x = np.array([<br>    [1, 2, 3],<br>    [4, 5, 6],<br>    [7, 8, 9]<br>])<br>y = np.array([10, 20, 30])<br><br># Initialize parameters<br>w = np.array([0.5, 0.2, -0.1])  # weights w1, w2, w3<br>b = 0.3  # bias<br>learning_rate = 0.01<br>threshold = 1e-4  # Threshold for small cost function<br><br># Helper function to calculate predictions<br>def predict(x, w, b):<br>    return np.dot(x, w) + b<br><br># Helper function to calculate the Mean Squared Error<br>def compute_cost(y, y_pred):<br>    return np.mean((y - y_pred) ** 2)<br><br># Gradient calculations<br>def compute_gradients(x, y, y_pred):<br>    n = len(y)<br>    gradient_w = -(2 / n) * np.dot((y - y_pred), x)<br>    gradient_b = -(2 / n) * np.sum(y - y_pred)<br>    return gradient_w, gradient_b<br><br># Training loop<br>iteration = 0<br>while True:<br>    y_pred = predict(x, w, b)  # Make predictions<br>    cost = compute_cost(y, y_pred)  # Calculate cost<br><br>    if cost &lt; threshold:  # Check if the cost is small enough<br>        break<br><br>    gradient_w, gradient_b = compute_gradients(x, y, y_pred)  # Compute gradients<br><br>    # Update weights and bias<br>    w -= learning_rate * gradient_w<br>    b -= learning_rate * gradient_b<br><br>    iteration += 1<br><br>    # Print progress every 10 iterations<br>    if iteration % 10 == 0:<br>        print(f&quot;Iteration {iteration}: Cost = {cost:.6f}&quot;)<br><br># Final results<br>print(&quot;Training complete!&quot;)<br>print(f&quot;Final Weights: {w}&quot;)<br>print(f&quot;Final Bias: {b}&quot;)</pre><h4>Gradient Descent Key Takeaways:</h4><ol><li><strong>Purpose</strong>: To minimize the cost function (like MSE) by adjusting weights and biases.</li><li><strong>Gradient</strong>: Tells us the slope (rate of change) of the cost function. Partial derivatives are used for each parameter.</li><li><strong>Learning Rate</strong>: Controls step size. Too high = overshoot, too low = slow convergence.</li><li><strong>Update Rule</strong>: new_parameter = old_parameter — (learning_rate * gradient)</li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8f71422503f5" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How AI is Changing Renewable Energy: Ethical Concerns and Solutions]]></title>
            <link>https://medium.com/@aditya.gujar20/how-ai-is-changing-renewable-energy-ethical-concerns-and-solutions-6691a69ac2ee?source=rss-3e6a1fe3636------2</link>
            <guid isPermaLink="false">https://medium.com/p/6691a69ac2ee</guid>
            <dc:creator><![CDATA[Aditya Gujar]]></dc:creator>
            <pubDate>Fri, 13 Sep 2024 17:30:17 GMT</pubDate>
            <atom:updated>2024-09-13T17:31:04.792Z</atom:updated>
            <content:encoded><![CDATA[<p>Artificial Intelligence (AI) is making renewable energy smarter and more efficient. It helps manage energy from sources like wind and solar in ways that humans can’t. But as we embrace AI, we must be careful about the ethical challenges it brings. In this blog, we’ll explore the key ethical concerns and suggest some solutions to make AI in renewable energy not only powerful but also responsible.</p><h3>Problem: Why Does AI Matter in Renewable Energy?</h3><p>Renewable energy is unpredictable — sunshine and wind aren’t constant. AI helps solve this problem by predicting how much energy will be produced and optimizing its use. But while AI is helping, it can also create issues, such as lack of transparency, privacy concerns, job losses, and environmental impacts.</p><p>Let’s dive into each issue and look at how we can solve them.</p><h3>1. Transparency: Who Controls the Algorithms?</h3><p>AI algorithms are used to decide how energy is distributed, but the way they make these decisions isn’t always clear. If an AI system sends more energy to one city over another, we need to know why.</p><p><strong>Solution:</strong></p><ul><li><strong>Open-Source AI Models</strong>: One way to increase transparency is by making AI models open-source, so anyone can see how decisions are made. This ensures that the processes behind AI are open to public scrutiny.</li><li><strong>Explainable AI</strong>: AI developers should focus on creating systems that can explain their decisions in a simple way to humans. This way, people will understand how energy is being distributed and why certain decisions are made.</li></ul><h3>2. Data Privacy: Who Has Your Energy Data?</h3><p>AI systems rely on data — lots of it — to function properly. They collect data on how much energy people use, when they use it, and even how appliances work. But who controls this data, and is it safe?</p><p><strong>Solution:</strong></p><ul><li><strong>Stricter Data Regulations</strong>: Governments should implement stricter regulations for energy companies using AI. These rules should ensure that user data is anonymized and protected from misuse.</li><li><strong>User Consent</strong>: Energy companies should ask for clear consent from users before collecting any data. People should know what data is being collected and how it will be used.</li></ul><h3>3. Human Oversight: Should AI Make All the Decisions?</h3><p>AI is powerful, but should it make decisions without human oversight? In renewable energy, some critical decisions — like managing power in emergencies — might be too important to leave entirely to machines.</p><p><strong>Solution:</strong></p><ul><li><strong>AI as a Support Tool:</strong> Instead of giving AI full control, it should act as a tool to support human decision-making. AI can analyze data and provide recommendations, but humans should have the final say, especially in critical situations.</li><li><strong>Clear Accountability:</strong> There should be a clear system in place for who is responsible when AI makes mistakes. This ensures that humans remain in control and accountable.</li></ul><h3>Conclusion: Can AI Help Renewable Energy Without Ethical Problems?</h3><p>AI has the power to revolutionize renewable energy, but we need to handle it responsibly. Transparency, data privacy, job security, and the environmental impact of AI are issues we must address. By implementing the right solutions, we can ensure that AI helps create a future where energy is not only smart but also ethical and fair for everyone.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6691a69ac2ee" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Overfitting and Underfitting]]></title>
            <link>https://medium.com/@aditya.gujar20/overfitting-and-underfitting-25912b80dc41?source=rss-3e6a1fe3636------2</link>
            <guid isPermaLink="false">https://medium.com/p/25912b80dc41</guid>
            <category><![CDATA[classification]]></category>
            <category><![CDATA[linear-algebra]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[regression]]></category>
            <category><![CDATA[mathematics]]></category>
            <dc:creator><![CDATA[Aditya Gujar]]></dc:creator>
            <pubDate>Mon, 15 Apr 2024 07:20:23 GMT</pubDate>
            <atom:updated>2024-04-18T12:01:13.104Z</atom:updated>
            <content:encoded><![CDATA[<p>Before understanding overfitting and underfitting, let’s understand what is bias and variance.</p><p><strong><em>Bias:</em></strong> Bias is like having a strong opinion or belief about something, and you stick to it no matter what. In machine learning, it’s about the assumptions your model makes about the data. A model with high bias might simplify the problem too much, making it unable to capture the true underlying patterns in the data. It’s like wearing blinders that prevent you from seeing the full picture. For example, if you’re trying to predict housing prices and your model always underestimates the prices, regardless of the features of the houses, it has a bias towards lower prices.</p><p><strong><em>Variance:</em></strong><em> </em>Variance is like being easily influenced by different situations. In machine learning, it’s about how much your model’s predictions change depending on the training data it’s exposed to. A model with high variance is like a chameleon, changing its colors too much based on the environment. It might perform really well on the training data, but when faced with new, unseen data, it struggles because it’s too sensitive to the noise or random fluctuations in the training data. For instance, if you train a model to recognize dogs and it gets confused by new pictures of dogs because it’s only seen a limited variety during training, it has high variance.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/934/1*5Mw_0KfAYXN33GYKMJmH7A.png" /></figure><h4><strong><em>Overfitting</em></strong></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/849/1*wnBVuy1BfGKhY9YAq74GMA.png" /><figcaption>Low Bias and High Variance</figcaption></figure><p>Overfitting occurs when a model captures noise or random fluctuations in the training data as if they were significant patterns. This happens when the model is too complex relative to the amount of training data available. In essence, the model becomes highly tailored to the quirks of the training data and fails to generalize well to new, unseen data.</p><p><em>Key points:</em></p><ol><li><em>High Model Complexity:</em> Overfitting often arises from models with high complexity, such as those with a large number of parameters or a high degree of flexibility.</li><li><em>Memorization of Training Data:</em> An overfitted model essentially memorizes the training data instead of learning the underlying relationships. This leads to poor performance when applied to new data.</li></ol><h4><strong><em>Underfitting</em></strong></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/849/1*S1tmp5O0OO-yvZCyXuDuzw.png" /><figcaption>High bias and High Variance</figcaption></figure><p>Underfitting occurs when a model is too simplistic to capture the underlying structure of the data. This typically arises when the model is not complex enough to represent the true relationships present in the data. As a result, the model performs poorly both on the training data and on new, unseen data.</p><p><em>Key points:</em></p><ol><li><em>Low Model Complexity:</em> Underfitting is characterized by models with low complexity, such as those with too few parameters or insufficient flexibility to capture the true data distribution.</li><li><em>Failure to Capture Patterns:</em> An underfitted model fails to capture the essential patterns and relationships in the data, resulting in a poor fit to the training data and suboptimal performance on unseen data.</li><li><em>Insufficient Training:</em> Underfitting can also occur when the model is not trained for a sufficient number of iterations or epochs, leading to incomplete learning of the data patterns.</li></ol><h4>Techniques to balance overfitting and underfitting.</h4><ul><li><em>Model Regularization</em></li><li><em>Cross-Validation</em></li><li><em>Feature Engineering</em></li><li><em>Ensemble Methods</em></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=25912b80dc41" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[R² (Coefficient of Determination)]]></title>
            <link>https://medium.com/@aditya.gujar20/r%C2%B2-coefficient-of-determination-908b987d67c4?source=rss-3e6a1fe3636------2</link>
            <guid isPermaLink="false">https://medium.com/p/908b987d67c4</guid>
            <category><![CDATA[linear-regression]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[mathematics]]></category>
            <dc:creator><![CDATA[Aditya Gujar]]></dc:creator>
            <pubDate>Sun, 14 Apr 2024 10:06:10 GMT</pubDate>
            <atom:updated>2024-04-14T13:12:01.819Z</atom:updated>
            <content:encoded><![CDATA[<p>In machine learning, R-squared (often denoted as R²) is a measure of how well the independent variables (features) <em>explain the variance in the dependent variable (target)</em>. It’s a statistical measure that ranges from 0 to 1.</p><p>If R² is closer to 1, it means that the model explains a large proportion of the variance in the target variable and thus fits the data well. If R² is closer to 0, it means that the model doesn’t explain much of the variance and doesn’t fit the data very well.</p><p>Let’s say you’re using a machine learning model to predict housing prices based on features like square footage, number of bedrooms, and location. If your model has an R² value of 0.8, it means that 80% of the variability in housing prices can be explained by the features included in the model.</p><h4><strong>Formula:</strong></h4><figure><img alt="R² formula" src="https://cdn-images-1.medium.com/max/1024/1*TIiFSWnvgwSMqtsonm8dBQ.png" /></figure><h4>Understanding the formula with graphs:</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/618/1*7juKr9Ct-NxW7O8iQO2EuA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/627/1*k47KkH2d-CVxMxOLUmR96A.png" /></figure><h4>Calculating R² in Jupyter notebook</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/421/1*XeMYlDXDvK3gp--eTzUxGQ.png" /><figcaption>0.88 indicates that the model explains 88% of the variability in the dependent variable (the target) using the independent variables (the features) included in the model</figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=908b987d67c4" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>