<?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 Krishna Sahani on Medium]]></title>
        <description><![CDATA[Stories by Krishna Sahani on Medium]]></description>
        <link>https://medium.com/@mrkrishna551?source=rss-dd9f42ab0b1e------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*EZqk7WJy3Fi3BzPjWBrLtw.jpeg</url>
            <title>Stories by Krishna Sahani on Medium</title>
            <link>https://medium.com/@mrkrishna551?source=rss-dd9f42ab0b1e------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 28 Nov 2026 06:41:57 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@mrkrishna551/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[Gradient Descent: How Does a Machine Learn From Its Mistakes?]]></title>
            <link>https://medium.com/@mrkrishna551/gradient-descent-how-does-a-machine-learn-from-its-mistakes-bd7b4cb53413?source=rss-dd9f42ab0b1e------2</link>
            <guid isPermaLink="false">https://medium.com/p/bd7b4cb53413</guid>
            <dc:creator><![CDATA[Krishna Sahani]]></dc:creator>
            <pubDate>Tue, 24 Nov 2026 06:01:36 GMT</pubDate>
            <atom:updated>2026-11-24T06:01:36.089Z</atom:updated>
            <content:encoded><![CDATA[<p>What if I told you that a machine learns in almost the same way we do – by making mistakes, correcting them, and trying again?</p><ol><li>The Question That Changed How I Understood Machine Learning</li></ol><p>When I was learning Machine Learning, one question kept coming to my mind:</p><p>If a machine makes a wrong prediction, how does it know what to change to make a better prediction next time?</p><p>Think about it.</p><p>Imagine you are trying to hit a target with a ball. You throw it, but it falls short. On your next attempt, you throw it a little harder. This time, it goes too far. So, you adjust your force again.</p><p>You keep making small adjustments until you get closer to the target.</p><p>While thinking about this, an idea came to my mind:</p><p>What if a machine could improve its predictions in a similar way?</p><p>It makes a prediction, measures how wrong it is, adjusts its parameters, and tries again.</p><p>This is the basic idea behind one of the most important optimization algorithms in Machine Learning: Gradient Descent.</p><p>But how does a mathematical algorithm actually perform this process?</p><p>Let’s explore!</p><p>2. Imagine Standing on a Mountain With Your Eyes Closed</p><p>Before jumping into equations, imagine a simple situation.</p><p>You are standing somewhere on a mountain, and your goal is to reach the lowest point in the valley. However, there is one problem: thick fog surrounds you, so you cannot see the entire mountain.</p><p>What would you do?</p><p>You would feel the slope beneath your feet, identify the downward direction, take a small step, and repeat the process.</p><p>Eventually, you would reach the bottom or get very close to it.</p><p>This is the basic intuition behind Gradient Descent.</p><p>In Machine Learning:</p><ul><li>The mountain represents the Loss Function.</li><li>- Your current position represents the model parameters.</li><li>- The slope represents the gradient.</li><li>- Each step represents a parameter update.</li><li>- The lowest point represents the minimum loss.</li></ul><p>The objective is simple: keep moving in the direction that reduces the error.</p><p>3. First, Understand What the Model Is Trying to Fix</p><p>Let’s take Linear Regression as an example.</p><p>Suppose we want to predict house prices based on their area.</p><p>A Linear Regression model uses the following equation:</p><p>ŷ = mx + b</p><p>Where:</p><ul><li>x = Input feature.</li><li>ŷ = Predicted output.</li><li>m = Slope or weight.</li><li>b = Intercept or bias.</li></ul><p>Imagine our model predicts that a house costs ₹20 lakh, but its actual price is ₹25 lakh.</p><p>The difference between these values tells us that our prediction is not accurate.</p><p>But how can we measure the overall error across the entire dataset?</p><p>This is where the Loss Function comes in.</p><p>4. Meet the Loss Function: The Scorecard of a Machine Learning Model</p><p>Think of the Loss Function as a scorecard.</p><p>It tells us how well or poorly our model is performing.</p><p>A smaller loss generally means better predictions.</p><p>For Linear Regression, we commonly use Mean Squared Error (MSE).</p><p>MSE = (1/n) × Σ (yᵢ − ŷᵢ)²</p><p>Here, the summation runs from i = 1 to n.</p><p>Substituting the Linear Regression equation:</p><p>J(m,b) = (1/n) × Σ[yᵢ − (mxᵢ + b)]²</p><p>Where:</p><ul><li>J(m,b) = Cost Function.</li><li>n = Number of training examples.</li><li>yᵢ = Actual output.</li><li>ŷᵢ = Predicted output.</li></ul><p>Our objective is:</p><p>Minimize J(m,b)</p><p>This means finding the values of m and b that minimize the cost function.</p><p>But there is another question:</p><p>How does the model know which direction to change its parameters?</p><p>5. The Mathematics Behind Learning: Enter Derivatives</p><p>This is where the real magic happens.</p><p>Remember the mountain analogy?</p><p>If you are standing on a slope, you need to know whether the ground rises or falls in a particular direction.</p><p>In mathematics, derivatives help us understand how a function changes when its input changes.</p><p>Gradient Descent uses partial derivatives to determine how the loss changes when we adjust model parameters.</p><p>Our cost function is:</p><p>J(m,b) = (1/n) × Σ [yᵢ − (mxᵢ + b)]²</p><p>Since we have two parameters, m and b, we calculate two partial derivatives.</p><ol><li>Derivative with respect to slope (m):</li></ol><p>∂J/∂m = −(2/n) × Σ [xᵢ × (yᵢ − (mxᵢ + b))]</p><p>2. Derivative with respect to intercept (b):</p><p>∂J/∂b = −(2/n) × Σ[yᵢ − (mxᵢ + b)]</p><p>In both expressions, the summation runs from i = 1 to n.</p><p>These derivatives tell us how sensitive the loss is to changes in each parameter.</p><ul><li>Positive gradient: Increasing the parameter locally increases the loss.</li><li>- Negative gradient: Increasing the parameter locally decreases the loss.</li><li>- Zero gradient: The function has a stationary point.</li></ul><p>Now we have the information needed to update our parameters.</p><p>6. The Learning Rule: How the Model Corrects Its Mistakes</p><p>Now that we have calculated the gradients, we can update our model parameters.</p><p>Gradient Descent updates both parameters using the following mathematical rules.</p><ol><li>Updating Slope (m):</li></ol><p>m_new = m_old − α × (∂J/∂m)</p><p>2. Updating Intercept (b):</p><p>b_new = b_old − α × (∂J/∂b)</p><p>Where:</p><ul><li>m_old = Previous slope value.</li><li>- b_old = Previous intercept value.</li><li>- m_new = Updated slope value.</li><li>- b_new = Updated intercept value.</li><li>- α = Learning Rate.</li><li>- ∂J/∂m = Gradient of loss with respect to slope.</li><li>- ∂J/∂b = Gradient of loss with respect to intercept.</li></ul><p>But why do we subtract the gradient?</p><p>Remember, our goal is to minimize the loss function.</p><p>The gradient tells us the direction of the steepest increase in loss. Therefore, we move in the opposite direction by subtracting the gradient.</p><p>The learning rate (α) controls the size of each update.</p><ul><li>Small learning rate: Learning becomes slow.</li><li>- Large learning rate: The algorithm may overshoot the minimum or fail to converge.</li><li>- Appropriate learning rate: Helps the algorithm converge efficiently.</li></ul><p>By repeatedly updating the parameters, the model gradually moves towards a minimum of the loss function.</p><p>7. Let’s Visualize How Gradient Descent Learns</p><p>Imagine plotting the loss against a model parameter.</p><p>At first, the model may start at a point where the loss is very high.</p><p>With every update, it moves towards a lower-loss region.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/768/1*oCUKVXyqsJNP2U20Ebg6JA@2x.jpeg" /></figure><p>In this diagram:</p><ul><li>X-axis represents the parameter value.</li><li>- Y-axis represents the loss.</li><li>- The starting point represents the initial parameter value.</li><li>- The lowest point represents the minimum loss.</li><li>- The arrows represent successive parameter updates.</li></ul><p>The central idea is simple: calculate the gradient and move in the opposite direction to reduce the loss.</p><p>8. Let’s Make the Machine Learn Using Python</p><p>Now that we understand the intuition and mathematics, let’s implement Gradient Descent from scratch.</p><p>We will use a small dataset where the actual relationship between input and output is:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/768/1*Tw6tUYrQy7WLWq0nitODbw@2x.jpeg" /></figure><p>Our goal is to make the model discover the slope and intercept.</p><p>What is happening behind the scenes?</p><ol><li>We initialize m and b with zero.</li><li>2. The model makes predictions.</li><li>3. We calculate the gradients using derivatives.</li><li>4. We update both parameters using the learning rate.</li><li>5. We repeat the process for 1000 iterations.</li></ol><p>Eventually, the model learns values close to:</p><p>m = 2</p><p>b = 1</p><p>Our final equation becomes:</p><p>ŷ = 2x + 1</p><p>The model has learned the relationship from the training data!</p><p>9. Three Ways to Perform Gradient Descent</p><p>There are three commonly used variations.</p><ol><li>Batch Gradient Descent</li></ol><p>Uses the entire training dataset to calculate gradients before each update.</p><ul><li>Stable gradient estimates.</li><li>- Can be computationally expensive for large datasets.</li></ul><p>2. Stochastic Gradient Descent (SGD)</p><p>Uses one training example per update.</p><ul><li>More frequent updates.</li><li>- Updates can be noisy.</li></ul><p>3. Mini-Batch Gradient Descent</p><p>Uses a small batch of training examples per update.</p><ul><li>Balances computational efficiency and stability.</li><li>- Commonly used in Deep Learning.</li></ul><p>10. Final Thoughts: Learning Is a Process of Continuous Improvement</p><p>When I first started learning Gradient Descent, I thought it was just another mathematical optimization algorithm.</p><p>But after understanding its intuition, I realized that its fundamental idea is quite familiar.</p><p>We make mistakes, understand where we went wrong, make adjustments, and try again.</p><p>Gradient Descent follows a similar process.</p><p>It measures prediction error, calculates gradients, updates parameters, and gradually minimizes the loss.</p><p>This simple idea forms the foundation of many Machine Learning and Deep Learning algorithms.</p><p>A machine doesn’t become accurate in one attempt. It improves through thousands of small corrections.</p><p>And that is the real beauty of Gradient Descent.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bd7b4cb53413" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Statsmodels in Python: Understanding Linear Regression with OLS]]></title>
            <link>https://medium.com/@mrkrishna551/statsmodels-in-python-understanding-linear-regression-with-ols-bf911a8bfddb?source=rss-dd9f42ab0b1e------2</link>
            <guid isPermaLink="false">https://medium.com/p/bf911a8bfddb</guid>
            <category><![CDATA[linear-regression-model]]></category>
            <category><![CDATA[ol]]></category>
            <category><![CDATA[python-programming]]></category>
            <category><![CDATA[towards-data-science]]></category>
            <category><![CDATA[python-statsmodel]]></category>
            <dc:creator><![CDATA[Krishna Sahani]]></dc:creator>
            <pubDate>Mon, 09 Nov 2026 13:26:27 GMT</pubDate>
            <atom:updated>2026-11-09T13:26:27.773Z</atom:updated>
            <content:encoded><![CDATA[<h3>1. Introduction</h3><p>Have you ever wondered whether studying for more hours helps you get better marks?</p><p>Or why your food delivery arrives in 15 minutes one day but takes almost an hour on another day?</p><p>We face these situations in everyday life. But can we use data and Python to find answers to such questions?</p><p>Yes! This is where <strong>Linear Regression</strong> comes in.</p><p>While learning Machine Learning, I came across a Python library called <strong>Statsmodels</strong>.</p><p>It helps us understand how different things are connected. It also tells us how useful our model is and what its results mean.</p><p>In this article, we’ll learn what Statsmodels is, understand OLS, build a simple model, and explore some interesting project ideas.</p><p>Let’s start!</p><h3>2. What is Statsmodels?</h3><p>Statsmodels is a Python library used for working with statistics and data.</p><p>Let’s understand this with an example.</p><p>Suppose we want to know whether students who study for more hours generally get better marks.</p><p>We can collect information about their study hours and exam marks. Then, we can use Statsmodels to study the relationship between them.</p><p>But here’s something interesting.</p><p>Statsmodels doesn’t just help us predict marks. It also gives us information about our model, such as how well it fits the data and whether the results are statistically meaningful.</p><h3>3. What is OLS?</h3><p>OLS stands for <strong>Ordinary Least Squares</strong>.</p><p>The name might sound complicated, but the idea is quite simple.</p><p>Imagine we have collected the study hours and exam marks of eight students.</p><p>Now, we want to draw a straight line that represents the relationship between study hours and exam marks.</p><p>But how do we decide which line is the best?</p><p>This is where OLS helps us.</p><p>It compares the actual marks with the marks predicted by the line.</p><p>Then, it squares the differences and tries to make their total as small as possible.</p><p>In simple words, <strong>OLS finds the line that fits our data as closely as possible.</strong></p><h3>4. Understanding OLS Assumptions</h3><p>Before building an OLS model, we should know about some basic conditions. These are called <strong>OLS assumptions</strong>.</p><p>Why do we need them?</p><p>Because getting a result from Python doesn’t always mean that the result is reliable.</p><p>These assumptions help us understand whether our model and its statistical results can be trusted.</p><p>Let’s understand each one with a simple example.</p><h3>1. Linearity</h3><p>It means that the relationship between our input and output should be something that a linear equation can represent.</p><p><strong>Example:</strong></p><p>Suppose we want to understand the relationship between study hours and exam marks.</p><p>Generally, students who study more may get better marks.</p><p>If we can show this relationship using a straight line, the linearity assumption may be reasonable.</p><p>But if studying for too many hours makes students tired and their performance starts falling, the relationship may not follow a straight line.</p><p>That’s why we should check whether Linear Regression is suitable for our data.</p><h3>2. Independence of Errors</h3><p>It means that the errors made by our model should not be connected to each other.</p><p><strong>Example:</strong></p><p>Suppose we’re predicting daily ice cream sales.</p><p>Today, sales are high because of a festival. Tomorrow, sales may also be high because the festival is still going on.</p><p>So, today’s sales and tomorrow’s sales may be connected.</p><p>If the errors in our predictions are also connected, we may have a problem called <strong>autocorrelation</strong>.</p><h3>3. Homoscedasticity</h3><p>It means that the size of our prediction errors should remain roughly the same.</p><p><strong>Example:</strong></p><p>Suppose we’re predicting exam marks based on study hours.</p><p>For students who study for 2 hours, our predictions may be wrong by around 5 marks.</p><p>But for students who study for 8 hours, our predictions may be wrong by 20 marks.</p><p>If the prediction errors keep getting bigger, we may have a problem.</p><p>This problem is called <strong>heteroscedasticity</strong>.</p><p>It can affect the accuracy of our usual statistical tests and confidence intervals.</p><h3>4. Normality of Errors</h3><p>It means that our prediction errors should look roughly like a bell-shaped curve.</p><p><strong>Example:</strong></p><p>Suppose our model predicts marks for 100 students.</p><p>Some students score a little higher than predicted, while others score a little lower.</p><p>If most errors are close to zero and only a few errors are very large, the errors may look like a bell-shaped curve.</p><p>This is what we call a normal distribution.</p><p>One important thing: we don’t need normally distributed errors just to calculate OLS coefficients. This assumption is mainly useful when performing certain statistical tests, especially with smaller datasets.</p><h3>5. No Perfect Multicollinearity</h3><p>It means that two or more input variables should not contain exactly the same information.</p><p><strong>Example:</strong></p><p>Suppose we want to predict exam marks using two variables:</p><ul><li>Study hours</li><li>Study time in minutes</li></ul><p>But we already know that:</p><p>1 hour = 60 minutes.</p><p>So, both variables are telling us exactly the same thing.</p><p>There is no need to include both in our model.</p><p>This problem is called <strong>Perfect Multicollinearity</strong>.</p><h3>6. Zero Conditional Mean</h3><p>It means that our model’s errors should not be related to the input variables.</p><p>Let’s understand this with an example.</p><p>Suppose we’re predicting exam marks using only study hours.</p><p>But marks can also depend on other things, such as:</p><ul><li>Previous preparation</li><li>Attendance</li><li>Sleep</li><li>Understanding of the subject</li></ul><p>Now imagine that students who study more also have better previous preparation.</p><p>If we ignore previous preparation, our model may give too much importance to study hours.</p><p>As a result, the estimated effect of study hours may be incorrect.</p><p>This can lead to biased results.</p><h3>Why Are These Assumptions Important?</h3><p>Let’s quickly revise what we learned:</p><ul><li><strong>Linearity:</strong> Our model should be able to represent the relationship using a linear equation.</li><li><strong>Independence:</strong> Prediction errors should not be connected.</li><li><strong>Homoscedasticity:</strong> The size of errors should remain roughly the same.</li><li><strong>Normality:</strong> Errors should look approximately like a bell-shaped curve for certain statistical tests.</li><li><strong>No Perfect Multicollinearity:</strong> Input variables should not contain exactly the same information.</li><li><strong>Zero Conditional Mean:</strong> Errors should not be related to our input variables.</li></ul><p>You don’t need to memorise all these definitions at once. Just try to understand what each assumption means.</p><h3>5. Installing Statsmodels</h3><p>Before using Statsmodels, we need to install it.</p><p>Open your terminal or Anaconda Prompt and run:</p><pre>pip install statsmodels</pre><p>If you’re using Jupyter Notebook, you can also run:</p><pre>%pip install statsmodels</pre><p>Now let’s import the libraries we’ll need:</p><pre>import pandas as pd<br>import statsmodels.api as sm</pre><p>That’s it! We’re ready to work with Statsmodels.</p><h3>6. Creating Our Dataset</h3><p>Let’s create a small dataset containing the study hours and exam marks of eight students.</p><pre>data = {<br>    &#39;Study_Hours&#39;: [1, 2, 3, 4, 5, 6, 7, 8],<br>    &#39;Exam_Marks&#39;: [35, 42, 48, 54, 63, 67, 76, 82]<br>}</pre><pre>df = pd.DataFrame(data)</pre><pre>print(df)</pre><p>Now, we need to separate our input and output variables.</p><pre>X = df[[&#39;Study_Hours&#39;]]<br>y = df[&#39;Exam_Marks&#39;]</pre><p>Here:</p><ul><li>X contains study hours. It is our independent variable.</li><li>y contains exam marks. It is our dependent variable.</li></ul><p>In simple words, we want to see how study hours are related to exam marks.</p><h3>7. Building Our First OLS Model</h3><p>Now comes the interesting part!</p><p>First, we need to add a constant to our input variable.</p><pre>X_new = sm.add_constant(X)</pre><p>But why are we doing this?</p><p>In Statsmodels, the OLS() function does not add an intercept automatically.</p><p>So, we use add_constant() to add a constant column to our data.</p><p>This allows the model to calculate the intercept of the regression line.</p><p>Now let’s build our model:</p><pre>result = sm.OLS(y, X_new).fit()</pre><p>Let’s understand this line:</p><ul><li>sm.OLS() creates our OLS regression model.</li><li>y contains the actual exam marks.</li><li>X_new contains study hours and the constant column.</li><li>.fit() calculates the best-fitting regression coefficients.</li></ul><p>Now, let’s see the complete report of our model.</p><pre>print(result.summary())</pre><p>You’ll see a table containing different values that help us understand our model.</p><h3>8. Understanding the OLS Summary</h3><p>When you run result.summary(), you&#39;ll see many numbers and technical terms.</p><p>At first, the table might look confusing.</p><p>But don’t worry! Let’s understand some important values.</p><p><strong>1. R-squared</strong></p><p>R-squared tells us how much of the change in our output variable is explained by the model.</p><p>For example, if R-squared is 0.80, it means our model explains 80% of the variation in exam marks in our dataset.</p><p><strong>2. Adjusted R-squared</strong></p><p>It is similar to R-squared, but it also considers how many input variables we’ve used.</p><p>It is useful when comparing models with different numbers of input variables.</p><p><strong>3. Coefficients</strong></p><p>Coefficients tell us how much our predicted output changes when an input variable increases by one unit, assuming other variables remain the same.</p><p>For example, the coefficient of Study_Hours tells us how much the predicted marks change when study hours increase by one hour.</p><p><strong>4. P-values</strong></p><p>P-values help us check whether there is enough statistical evidence to say that a coefficient is different from zero.</p><p>A small p-value generally means stronger evidence of a relationship, assuming our model is suitable.</p><p>You don’t need to remember everything right now. Just understand what these values tell us.</p><h3>9. Making Predictions</h3><p>Now suppose we want to predict the marks of a student who studies for six hours.</p><p>We can use the predict() function.</p><pre>new_student = pd.DataFrame({<br>    &#39;const&#39;: [1],<br>    &#39;Study_Hours&#39;: [6]<br>})</pre><pre>prediction = result.predict(new_student)</pre><pre>print(prediction)</pre><p>Our model will now give us an estimated exam score for a student who studies for six hours.</p><p>You might have noticed that we also added const: [1].</p><p>Why?</p><p>Because we added a constant while building our original model.</p><p>So, we need to provide the same columns when making predictions.</p><p>Remember, this is only an estimated score. Actual marks also depend on preparation, sleep, attendance, and many other things.</p><h3>10. Why Is OLS Useful?</h3><p>You might be thinking:</p><p>Why should we learn OLS when SCIKIT LEARN IS already present ??</p><p>Well, OLS does more than just predict numbers.</p><p>It helps us understand how different things are related.</p><p>For example:</p><ul><li><strong>Healthcare:</strong> How are age and weight related to certain health measurements?</li><li><strong>Business:</strong> Does spending more money on advertising relate to higher sales?</li><li><strong>Education:</strong> Do students with better attendance generally get better marks?</li><li><strong>Manufacturing:</strong> How does temperature affect product quality?</li><li><strong>Economics:</strong> How are income and monthly expenses related?</li></ul><p>Another useful thing is that Statsmodels gives us values like coefficients, p-values, and confidence intervals.</p><p>These help us understand our results instead of just looking at the final prediction.</p><h3>11. Some Interesting Projects You Can Build Using OLS</h3><p>Now that we’ve understood the basics, let’s look at some project ideas.</p><p>And no, every project doesn’t have to be about house prices or student marks!</p><p>We can use data to answer some interesting questions from our daily lives.</p><p>Project The Question Behind It<br>🍕 <strong>Food Delivery Time Prediction: </strong>Does ordering food during heavy rain mean waiting longer for your pizza?<br>🍿 <strong>Netflix Watching Analysis : </strong>Does having more free time mean watching more episodes?<br>⚡ <strong>Electricity Bill Prediction : </strong>Does running an AC all night make our electricity bill look like a horror story?<br>🏍️ <strong>Petrol Consumption Analysis : </strong>Does riding faster affect our bike’s mileage?<br>🍔 <strong>Food Order Demand Prediction : </strong>Do people order more food on weekends and rainy days?<br>▶️<strong>YouTube Views Prediction : </strong>Are video length and audience engagement related to views?<br>🔋 <strong>Smartphone Battery Drain Prediction : </strong>Why does our phone battery drop just when we need Google Maps the most?<br>🏠 <strong>House Rent Prediction : </strong>Why does a small flat near a metro station sometimes cost more than a bigger flat far away?<br>💪 <strong>Gym Progress Analysis : </strong>Does spending three hours in the gym automatically mean better results?<br>🛒 <strong>Online Shopping Spending Analysis : </strong>Why does adding just one item to our cart somehow become a ₹5,000 order?<br>🚗 <strong>Traffic Time Prediction : </strong>Why does a 15-minute journey suddenly become a 45-minute journey during office hours?<br>🍦 <strong>Ice Cream Sales Prediction : </strong>Do ice cream shops sell more during Indian summers?</p><h3>12. Statsmodels vs Scikit-learn</h3><p>While learning Linear Regression, you might also come across another popular Python library called Scikit-learn.</p><p>So, what’s the difference between them?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/925/1*jqeGXKXYsT78arUDdJYWwA.png" /></figure><h3>13. Conclusion</h3><p>When I started learning Linear Regression, I mainly focused on how the model makes predictions.</p><p>But after learning Statsmodels, I started looking at regression in a different way.</p><p>Instead of only asking, “What will the model predict?”, we can also ask:</p><ul><li>Why is it making this prediction?</li><li>How are these variables related?</li><li>How reliable are our results?</li></ul><p>We started with a simple example of study hours and exam marks. But the same idea can also be used for food delivery, electricity bills, petrol consumption, online shopping, and many other real-life problems.</p><p>My suggestion is simple: don’t just learn Python functions. Try small projects, play with different datasets, and ask questions.</p><p>Because learning Data Science becomes much more interesting when we connect it with things we see in our everyday lives!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bf911a8bfddb" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>