<?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 Lakshmi Sruthi on Medium]]></title>
        <description><![CDATA[Stories by Lakshmi Sruthi on Medium]]></description>
        <link>https://medium.com/@sruthils22?source=rss-20f552c51232------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*2NgAAKNBf6zMTm3lwobKrQ.jpeg</url>
            <title>Stories by Lakshmi Sruthi on Medium</title>
            <link>https://medium.com/@sruthils22?source=rss-20f552c51232------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 21 Nov 2026 19:25:55 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@sruthils22/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[Generative AI: Shaping the Future of Creativity, Work, and Everyday Life.]]></title>
            <link>https://sruthils22.medium.com/generative-ai-shaping-the-future-of-creativity-work-and-everyday-life-5191a9a28abb?source=rss-20f552c51232------2</link>
            <guid isPermaLink="false">https://medium.com/p/5191a9a28abb</guid>
            <category><![CDATA[chatgpt]]></category>
            <category><![CDATA[rags]]></category>
            <category><![CDATA[generative-ai-tools]]></category>
            <category><![CDATA[generative-ai-use-cases]]></category>
            <category><![CDATA[gen-ai-revolution]]></category>
            <dc:creator><![CDATA[Lakshmi Sruthi]]></dc:creator>
            <pubDate>Mon, 09 Jun 2025 22:02:39 GMT</pubDate>
            <atom:updated>2025-06-09T22:02:39.000Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/180/1*HstWYW3u9p5d79l1W-BHFA.jpeg" /></figure><h3><strong>How Gen AI Is Ruling the World</strong></h3><p>Gen AI is in the spotlight because it can create brand-new content, such as text, images, music, audio, videos, and code, and also speeds and scales humans simply cannot match. This creative power is revolutionizing industries, sparking new ideas, and even changing how we approach education, business, and healthcare. Its core strength comes from its ability to combine vast datasets and advanced algorithms to imitate, remix, and extend what already exists and to offer novel solutions, making it a tool of choice for innovation and productivity across the globe. It’s not just tech companies that are interested: governments, educators, healthcare leaders, and artists are also harnessing Gen AI’s transformative impact to solve practical problems, streamline operations, and boost creativity. In short, Gen AI is “ruling the world” because it democratizes creative and analytical abilities that were, until recently, limited to subject-matter experts.</p><h3><strong>Introduction of Generative AI</strong></h3><p>It generates new data based on the training sample(unstructured data), and the model can generate images, audio, text, video, and so on as data as output.</p><p>It is a subset of deep learning, and generative models are trained on a huge amount of data. Unlike traditional AI, which might classify images or predict trends, Gen AI uses large neural networks, like Large Language Models (LLMs) and diffusion models, to compose new works.</p><p><strong>For example:</strong></p><ul><li><strong>Large Language Models (LLMs)</strong>: These powerful tools, like <strong>ChatGPT </strong>and can write essays, answer questions, or create code.</li><li><strong>Diffusion models</strong>: These are used in image generation, like <strong>DALL·E</strong>, which produces images from verbal descriptions.</li></ul><p>Gen AI’s breakthrough is that it doesn’t just analyze the world — it creates new versions of it, offering endless possibilities for users in every field from science to the arts</p><p><strong>Types of inputs:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/437/1*Q4N_Jcd0hc-y_TeEQ3trCA.png" /></figure><p><strong>Types of Outputs and Applications:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/502/1*BxYIz-JYcT8jUlnBpX7-lw.png" /></figure><p><strong>How does Generative AI works/ learns?</strong></p><p>It learns about the patterns in language through training data. Based on the things learned from training data, it offers predictions on how to complete. Thus, generative language models are pattern-matching systems. <strong>For example</strong>, if you go to Google Chrome or Gmail, it will predict what will come after the sentence. Because it learns from massive data.</p><p><strong>Here is the step-by-step process…</strong></p><p><strong>Retrieval-Augmented Generation</strong> (RAG) works by combining two main parts: retrieving real, up-to-date information from trusted sources (like company files or databases), and then using a Generative AI model (such as ChatGPT, Claud)</p><ol><li><strong>You type a question into the system.</strong><br>For example, you might ask, “What is the latest HR vacation policy?”</li><li><strong>The system searches company data for the best answers.</strong><br>Instead of relying only on what the AI “remembers” from its training, it quickly looks through real documents, knowledge bases, or databases for trusted, up-to-date details.</li><li><strong>The most relevant documents or answers are gathered.</strong><br>The system finds and ranks the most useful information from those sources.</li><li><strong>That information (along with your question) is given to the Generative AI.</strong><br>Now, the AI model receives both your original question and the most relevant, real information found in the company’s trusted data.</li><li><strong>The AI writes a tailored answer using this specific information.</strong><br>The Generative AI model creates a clear response, grounded in company data and targeted to your question, and then sends it back to you.</li></ol><p>This process is valuable because it means the AI can give you timely, accurate answers that are based on real and current company knowledge, rather than just making educated guesses from outdated training data. As a result, responses are more trustworthy, practical, and customized for your needs. This technique is used across professional fields, including software development, healthcare, and education, to deliver fast, specific, and reliable information or assistance, saving time and improving quality for both users and organizations. RAG systems do have challenges, like making sure the information retrieved is actually relevant and high quality, or preventing the AI from combining facts incorrectly. Ongoing improvements are addressing these, for example, by adding mechanisms that filter and prioritize the best information before it reaches the AI model, making the system both efficient and robust.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DrD-ZK-nxTUOpV3Yp8Q98Q.jpeg" /></figure><p><strong>Let’s see the differences between how Deep Learning and Generative AI work in the backend.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4EkEXgZssSFnCptd57Gt5Q.png" /></figure><p><strong>Let’s see some famous algorithms used for different types of input data</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/768/1*sLo6Cq-K3c9GNQ35rfLGsQ.png" /></figure><p>These are only a few algorithms and the most frequently usable ones. You can research in detail about some more algorithms. “These are only a few algorithms”.</p><p>So let’s start building our future on Gen AI.</p><p>Happy reading….</p><p><strong>References link:</strong></p><ol><li><a href="https://www.mckinsey.com/featured-insights/mckinsey-explainers/what-is-generative-ai">https://www.mckinsey.com/featured-insights/mckinsey-explainers/what-is-generative-ai</a></li><li><a href="https://research.google/pubs/attention-is-all-you-need/">https://research.google/pubs/attention-is-all-you-need/</a></li><li><a href="https://towardsdatascience.com/">https://towardsdatascience.com/</a></li><li><a href="https://www.wired.com/story/9-resources-learn-generative-ai/">https://www.wired.com/story/9-resources-learn-generative-ai/</a></li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5191a9a28abb" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Supervised Learning: Logistic Regression from basics to expert]]></title>
            <link>https://medium.com/analytics-vidhya/supervised-learning-logistic-regression-from-basics-to-expert-9f710a755857?source=rss-20f552c51232------2</link>
            <guid isPermaLink="false">https://medium.com/p/9f710a755857</guid>
            <category><![CDATA[logistic-regression]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[supervised-learning]]></category>
            <category><![CDATA[machine-learning-python]]></category>
            <dc:creator><![CDATA[Lakshmi Sruthi]]></dc:creator>
            <pubDate>Mon, 10 May 2021 18:00:18 GMT</pubDate>
            <atom:updated>2021-05-17T13:21:12.455Z</atom:updated>
            <content:encoded><![CDATA[<h3>What is supervised learning?</h3><p>The Supervised learning machine learning algorithms are done when our data is labeled. We have two types of supervised machine learning algorithms</p><ol><li><strong>Regression.</strong></li><li><strong>Classification.</strong></li></ol><h3><strong>1. Regression</strong></h3><p>It is explained in this blog: <a href="https://sruthils22.medium.com/linear-regression-in-machine-learning-783bb5e58944"><strong>Click here</strong></a></p><p>Hyperparameter tuning for Linear Regression: <a href="https://sruthils22.medium.com/hyperparameter-tuning-in-linear-regression-e0e0f1f968a1"><strong>Click here</strong></a></p><h3><strong>2. Classification</strong></h3><p><strong>When will we use classification supervised learning?</strong></p><p>Classification is the method used to predict the <strong>Categorical variable</strong> in the target column or dependent variable based on independent features. The output for the classification problem will be in binary class or multi-class. It falls under the supervised technique. It is a statistical tool used to find out the relationship between the outcome variable, the dependent variable, and one or more variables often called independent variables.</p><h4>We have many algorithms under the classification</h4><ol><li><strong>Logistic Regression.</strong></li></ol><p><strong>2. Decision Tree.</strong></p><p><strong>3. Random Forest.</strong></p><p><strong>4. KNN</strong></p><p><strong>5. Navie Baies.</strong></p><p><strong>6. Ada Boosting</strong></p><p><strong>7. XG Boost</strong></p><p><strong>8. Gradient Boost</strong></p><p>These are the most frequent and popular algorithms for Machine learning under classification problem</p><p>Let’s discuss the simple and most popular algorithm under the classification problem.</p><h3><strong>1. LOGISTIC REGRESSION</strong></h3><p>This is because it is built on linear regression. Logistic regression is another popular AI algorithm able to provide binary results. This means that the model can both predict the outcome and specify one of the two classes of their value. The function is also based on changing the weights of the algorithms, but it differs since the non-linear logic function is used to transform the outcome. This function can be presented as an <strong>S-Shaped line (or) Sigmoid curve</strong> separating the true values from false ones.</p><p>The success requirements are the same as for linear regression- removing the same value input samples and reducing the quantity of noise (Low-value data). This is quite a sample function that can be mastered relatively fast and is great for performing binary classification. <strong>The objective of logistic regression is to minimize the errors utilizing Log Loss.</strong></p><p>The logistic regression equation is derived from the straight-line equation.</p><h4>Y=C+B1*X1+ B2*X2+…… + Bn*Xn</h4><p>This ranges from -inf to +inf. But in logistic regression, we need to predict the values between 0 to 1 so we to transform Y.</p><p><strong>If Y=0 then 0</strong></p><p><strong>If Y is 1-Y then Y=1 then infinity</strong></p><p>Let us transform further to get range between -inf to +inf</p><p><strong>Log(Y/1-Y) =&gt; Y=C+B1*X1+ B2*X2+…… + Bn*Xn</strong></p><p>To make in the probability range from 0 to 1. We will use the sigmoid curve function.</p><h4>Sigmoid curve</h4><p>The sigmoid curve has all the properties you would want, extremely low values at the start, extremely high values at the end, and intermediate values in the middle, it’s a good choice for modeling the value of the probability of the event. <strong>If the estimated probability is greater than 50%, then the model predicts that the instance belongs to that class (called the positive class, labeled “1”), or else it predicts that it does not (i.e., it belongs to the negative class, labeled “0”)</strong>. This makes it a binary classifier.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/325/1*DwhBgdHK_oayyoxQKGNx2A.png" /><figcaption>Sigmoid curve formula</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/402/1*T4_Q0YFw6pXkpP7TV-wIwg.png" /><figcaption>Sigmoid curve</figcaption></figure><p>The red line cutting in the center is the<strong> threshold line</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/570/1*WfB2jEgskeu4oE6irwEhsw.png" /></figure><h4><strong>Log Loss</strong></h4><p>In logistic regression, the output can be the probability can be yes (or equals to 1). This probability is a value between 0 and 1. Log loss (Logarithmic loss) measures the performance of a classifier where the predicted output is a probability value between 0 and 1. If our model predictions are correct then our log loss will be 0 else greater than 0. Remember that, lower the log loss value higher the accuracy of our model.</p><p><strong>Log loss= y log(p)+ (1-y) log(1-p)</strong></p><p>Where p is the probability value of y</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/403/1*yopZa7lWCD1lTKdGprlBjA.png" /></figure><h3>Assumptions of Logistic Regression</h3><p>1. Independence of error, whereby all sample group outcomes are separate from each other (i.e., there are no duplicate responses)</p><p>2. Linearity in the logit for any continuous independent variables</p><p>3. Absence of multicollinearity</p><p>4. Lack of strong influential outliers.</p><p><strong>Before you go into hyperparameter tunning we need to look into the Performance metrics for the all-classification problem.</strong></p><h4>A blog for Performance metrics for classification problems: <a href="https://sruthils22.medium.com/performance-measures-for-supverised-classification-problem-33bf9ccfdace">Click here</a></h4><p>We came to know the Accuracy, Recall, Precision, Specificity, Sensitivity, and etc. We can go with hyperparameter tunning for logistic regression.</p><h3><strong>Hyperparameter tuning</strong></h3><p>In logistic regression tunning is done for adjusting the threshold values of the curve. Whether the point belongs to this class or not. It reduces or increases the optimal cut-off value to identify the best cut-off value. The reason for doing parameter tunning is to reduce the log loss of the model. These two methods for adjusting the threshold values.</p><p><strong>1. Cost-Based Method.</strong></p><p><strong>2. Youden’s Index Method.</strong></p><h4><strong>1.</strong> <strong>Cost-Based Method</strong></h4><p>Cost analysis is one of the methods to determine the optimal cut-off value. The cost is calculated at different cut-off values to achieve a reasonable balance between false positives and false negatives when the cost of false positives and false negatives are known. <strong>In logistic regression modeling, the cut-off point is the point that the decision-maker decides whether to accept or reject.</strong></p><p>The full logistic regression model has different values for false positives (FP) and false negatives (FN). Thus, we can use the cost-based method to calculate the optimal value of the cut-off. In this method, we find the optimal value of the cut-off for which the total cost is minimum. The total cost is given by the formula:</p><p><strong>total_cost = FN x C_1 + FP x C_2</strong></p><p>Where,<br> C_1: It is the cost of false negatives<br> C_2: It is the cost of false positives</p><p>The cost values can be decided using business knowledge.</p><h4><strong>2.</strong> <strong>Youden’s Index</strong></h4><p>It is another method to calculate the threshold value for our model. Youden’s Index is the classification cut-off probability for which the <strong>(Sensitivity + Specificity — 1) is maximized.</strong></p><p><strong>Youden’s Index = max (Sensitivity + Specificity — 1)</strong></p><p><strong>(OR)</strong></p><p><strong>= max (TPR + TNR — 1)</strong></p><p><strong>(OR)</strong></p><p><strong>= max (TPR — FPR)</strong></p><p>After you do tuning the parameters for logistic regression and we need to do the<strong> feature selection to remove the insufficient features from our model</strong>. Hence it reduces the model complexity.</p><h3>Feature Selection</h3><ol><li>Backward elimination</li><li>Forward selection</li><li>Recursive feature elimination (RFE).</li></ol><h3>Advantages of Logistic regression</h3><ol><li>It’s very fast for unknown records</li><li>It performs well in the linear separable data.</li><li>No variance errors in our model</li><li>It is an easy and simple algorithm to work</li></ol><h3>Disadvantages of Logistic regression</h3><ol><li>Being simple it will not learn complexity problem model will fails performances in low.</li><li>It constructs the linear boundaries.</li></ol><h3>Footnotes</h3><p>Our objective for logistic regression is to minimize the log loss of the model and our model should not have more variances errors and bias error. We have to tune the model accordingly to balance bias and variance tradeoff.</p><p>Yes, It was a long one but the most frequently used in the industries, popular and simple algorithm under the classification problem.</p><p>Hope you loved this blog</p><p>Thanks for reading :)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9f710a755857" width="1" height="1" alt=""><hr><p><a href="https://medium.com/analytics-vidhya/supervised-learning-logistic-regression-from-basics-to-expert-9f710a755857">Supervised Learning: Logistic Regression from basics to expert</a> was originally published in <a href="https://medium.com/analytics-vidhya">Analytics Vidhya</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Performance measures for Supverised classification problem.]]></title>
            <link>https://medium.com/analytics-vidhya/performance-measures-for-supverised-classification-problem-33bf9ccfdace?source=rss-20f552c51232------2</link>
            <guid isPermaLink="false">https://medium.com/p/33bf9ccfdace</guid>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[performance-metrics]]></category>
            <category><![CDATA[precision]]></category>
            <category><![CDATA[accuracy-and-precision]]></category>
            <category><![CDATA[supervised-learning]]></category>
            <dc:creator><![CDATA[Lakshmi Sruthi]]></dc:creator>
            <pubDate>Sun, 09 May 2021 17:53:11 GMT</pubDate>
            <atom:updated>2021-05-12T17:03:51.482Z</atom:updated>
            <content:encoded><![CDATA[<h4>What is the purpose of seeing metrics?</h4><p>To find a solution for our problem based on actual data and the predicted data which helps you to choose the right metric based on ur problem of the data.</p><p>Before choosing the right metric for our problem we need to know few terminologies of the measures of the classification problem. <strong>The Confusion matrix helps us to solve the problem by choosing the right metric for the problem.</strong></p><h3>Confusion Matrix</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/956/1*5__Qfo9o2UPjpouAqSzCqA.png" /></figure><h4>Note:</h4><p>0 indicates the <strong>Absences (or) Negative</strong></p><p>1 indicates the <strong>Presences (or) Positive</strong></p><h4><strong>1. True Negative (TN):</strong></h4><p><strong>An outcome where the model correctly predicts the Negative class.</strong> For example, You don&#39;t have a covid and the ML models predict correctly as a not a covid negative.</p><h4>2. False Positive (FP):</h4><p><strong>An outcome where the model incorrectly predicts the positive class. </strong>For example, You don&#39;t have a covid and the ML predicts incorrectly as a covid positive. This type of error is called<strong> Type 1 error.</strong></p><h4>3. False Negative (FN):</h4><p><strong>An outcome where the model incorrectly predicts the negative class. </strong>For example, You have a covid but the ML predicts as you don’t have a covid negative. This type of error is called a<strong> Type 2 error.</strong></p><h4>4. True Positive (TP):</h4><p><strong>An outcome where the model correctly predicts the positive class. </strong>For example, You have a covid and the ML predicts you have a covid positive then it is True Positive.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/581/1*cXNfURz-aGrIyXOw9XKcsw.png" /><figcaption><strong>A famous example for the Classification report.</strong></figcaption></figure><h3>Let’s go to performances for classification problems.</h3><p>We can get the performances for classification by calling the classification report or we can manually calculate it…</p><h4>1. Accuracy</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/717/1*jlL-b1mpLUL8z5H3fazqWw.png" /></figure><p>It is the fraction of predictions that the model got correct. <strong>We will be choosing the accuracy measure when our target data distribution is balanced</strong>. The higher the accuracy value better the model is.</p><p><strong>Accuracy = (TP+ TN)/ (TP+ TN+FP+FN)</strong></p><h4>2. Precision</h4><p>It is the proportion of <strong>predicted positive cases</strong>. The higher the precision value better the model is.</p><p><strong>Precision= TP/(TP+FP)</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/673/1*5dmiOMjDlAYzSctE8vsO_w.png" /></figure><h4><strong>3. Recall</strong></h4><p>It is the proportion of <strong>actual positive cases</strong>. It even called <strong>Sensitivity or True Positive Rate. </strong>The higher the recall value better the model is.</p><p><strong>Recall= TP/(TP+FN)</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/685/1*sNcRNYDRMZeJYex09Jycnw.png" /></figure><h4>4. False Positive Rate (FPR)</h4><p>It is the proportion of <strong>actual negative cases predicted wrongly.</strong> The lower the FPR better the model is because where we predict positive cases incorrectly.</p><p><strong>False Positive Rate= FP/(FP+TN)</strong></p><p><strong>(OR)</strong></p><p><strong>False Positive Rate= 1- Sensitivity</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/628/1*igfz1WHQxF4i2D7267j0Qw.png" /></figure><h4><strong>5. Specificity</strong></h4><p>It is the proportion of <strong>actual negative cases that were predicted correctly.</strong></p><p><strong>Specificity= TN/(TN+FP)</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/635/1*AV22I61WBZIPyKvKt8s75Q.png" /></figure><h4>6. F1 Score</h4><p>It is the<strong> harmonic mean of precision and recall</strong>. It can have a maximum score of 1 and a minimum score of 0.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/811/1*VxSd0pfsfz2v31vgn3h5gQ.png" /></figure><h4>7. Kappa Score</h4><p>It is used for the overall performances of the model which is actual data Vs predicted data.</p><p><strong>Cohen Kappa Score measures the degree of agreement ben true values and the predicted values</strong></p><p><strong>Below 0 indicate no agreement</strong></p><p><strong>0.01 to 0.20 indicates slight agreement</strong></p><p><strong>0.21 to 0.40 indicates fair agreement</strong></p><p><strong>0.41 to 0.60 indicates moderate agreement</strong></p><p><strong>0.61 to 0.80 indicates substantial agreement</strong></p><p><strong>0.81 to 1 indicates almost perfect agreement</strong></p><h4>8. Receiver Operating Characteristics(ROC)</h4><p><strong>The TPR and FPR values change with different threshold values</strong>. ROC curve is the plot of TPR against the FPR values obtained at all possible threshold values.</p><h4>9. Area Under the ROC curve(AUC)</h4><p>It is separability between the classes of target variables. AUC increases as the separation between the classes increases. Higher the AUC better the model</p><p>These are the performance measures for the classification problem. We will be choosing the performance metrics based on the domain knowledge.</p><p>Hope you learned about the concepts clearly.</p><p>Thanks for reading :)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=33bf9ccfdace" width="1" height="1" alt=""><hr><p><a href="https://medium.com/analytics-vidhya/performance-measures-for-supverised-classification-problem-33bf9ccfdace">Performance measures for Supverised classification problem.</a> was originally published in <a href="https://medium.com/analytics-vidhya">Analytics Vidhya</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Hyperparameter Tuning in Linear Regression.]]></title>
            <link>https://medium.com/analytics-vidhya/hyperparameter-tuning-in-linear-regression-e0e0f1f968a1?source=rss-20f552c51232------2</link>
            <guid isPermaLink="false">https://medium.com/p/e0e0f1f968a1</guid>
            <category><![CDATA[hyperparameter-tuning]]></category>
            <category><![CDATA[data-regularization]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[hyperparameter]]></category>
            <category><![CDATA[regularization]]></category>
            <dc:creator><![CDATA[Lakshmi Sruthi]]></dc:creator>
            <pubDate>Thu, 22 Apr 2021 17:27:39 GMT</pubDate>
            <atom:updated>2021-04-29T07:15:05.453Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Before that let us understand why do we tune the model.</strong></p><h3>What is the purpose of tuning?</h3><p>We tune the model to<strong> maximize model performances without overfitting and reduce the variance error </strong>in our model. We have to apply the appropriate Hyperparameter technique for our model.</p><h3>Types of errors</h3><h3>1. What is a Variance error?</h3><p>It refers to the amount that the predicted value would change if different training data were used.</p><h3>2. What is a Bias error?</h3><p>It is the error due to the model assumptions that are made to simplify the model.</p><h3>Regularization</h3><p>It reduces the overfitting nature of the model. Even if the model works well, this is done in order to prevent the problem from occurring in the future. This is done by introducing more errors and making the model learn more. This will help the model to learn more. And as a result, even if more data is added in the later stage, the model will be able to process those without any issues. Now the model performance will increase and will be better than the unregularized model.</p><p><strong>Coefficient shrinks whenever we do regularization</strong>. We need to make sure that our model doesn’t get under-fitted by tuning too much in alpha as well. Alpha is a penalty factor. Error is introduced in the system by drawing a line that’s doesn’t touch the majority of the points. These regularization models will shrink the coefficient as they build models that reduce the slope which will not change much for new data. Shrinkage in coeff totally depends on the variables. <strong>If the feature is significant then the shrinkage will be less but if the feature is not significant then shrinkage will more.</strong> if the feature is highly insignificant then the coeff will become 0. The advantage of this regularizes models is that even if the assumptions are not checked, the model will do all the work.</p><h3>What is overfitting?</h3><p>When your model learns all complex and noise from training data and performs well in training data but while coming to validation data it does not work well then our data is overfitting.</p><h3>What is underfitting?</h3><p>When our data is underfitting then our model does learn the underlying trend data. It occurs when we have fewer data to build the model or when we try to build the linear model with non-linear data.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/38/0*WCdqrVy1O4p4QBFR" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/831/0*uHCWulkya0krP8C-.png" /></figure><h3>What is Cross-Validation?</h3><p>Cross-Validation is essentially a technique used to <strong>assess how well a model performs on a new independent dataset</strong>.</p><p>The simplest example of cross-validation is when you split your data into three groups: training data, validation data, and testing data, where you see the training data to build the model, the validation data to tune the hyperparameters, and the testing data to evaluate your final model.</p><h3><strong>Types of regularization</strong></h3><h4><strong>1.</strong> <strong>Ridge regularization</strong></h4><p>It adds the “<strong>Squared magnitude</strong>” of coefficient as a penalty term to the loss function. It is called an L2 penalty</p><p><strong>sse = np.sum ((y-b1x1-b2x2-…-bo) **2) + (alpha * (b1**2+b2**2+b3**2+…+bo**2))</strong></p><h4>2. <strong>Lasso regularization</strong></h4><p>The (least absolute shrinkage and selection operator) adds the “<strong>Absolute value of magnitude</strong>” of coefficient as a penalty term to the loss function. It is called an L1 penalty.</p><p><strong>sse = np.sum ((y-b1x1-b2x2-…-bo) **2) + (alpha * (|b1|+|b2|+|b3|+…+|bo|))</strong></p><h4>3. <strong>ElascticNet Regression</strong></h4><p>It is the<strong> combination of both Ridge and Lasso</strong> regularization.</p><p><strong>sse = np.sum ((y-b1x1-b2x2-…-bo) **2) + (alpha_ridge * (b1**2+b2**2+b3**2+…+bo**2)) +(alpha_lasso * (|b1|+|b2|+|b3|+…+|bo|))</strong></p><h3>Gradient Descent</h3><p>We can find the best alpha value and best regularization using this method. <strong>Gradient descent</strong> is an iterative optimization algorithm used in <strong>machine learning</strong> to minimize a loss function. The loss function describes how well the model will perform given the current set of parameters (weights and biases), and <strong>gradient descent</strong> is used to find the best set of parameters.</p><p>Thanks for reading :)</p><h3>References</h3><p><a href="https://www.analyticsvidhya.com/blog/2017/06/a-comprehensive-guide-for-linear-ridge-and-lasso-regression/">https://www.analyticsvidhya.com/blog/2017/06/a-comprehensive-guide-for-linear-ridge-and-lasso-regression/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e0e0f1f968a1" width="1" height="1" alt=""><hr><p><a href="https://medium.com/analytics-vidhya/hyperparameter-tuning-in-linear-regression-e0e0f1f968a1">Hyperparameter Tuning in Linear Regression.</a> was originally published in <a href="https://medium.com/analytics-vidhya">Analytics Vidhya</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Linear Regression in Machine Learning]]></title>
            <link>https://medium.com/analytics-vidhya/linear-regression-in-machine-learning-783bb5e58944?source=rss-20f552c51232------2</link>
            <guid isPermaLink="false">https://medium.com/p/783bb5e58944</guid>
            <category><![CDATA[supervised-learning]]></category>
            <category><![CDATA[linear-regression-example]]></category>
            <category><![CDATA[linear-regression-python]]></category>
            <category><![CDATA[linear-regression-model]]></category>
            <category><![CDATA[linear-regression]]></category>
            <dc:creator><![CDATA[Lakshmi Sruthi]]></dc:creator>
            <pubDate>Thu, 22 Apr 2021 16:21:43 GMT</pubDate>
            <atom:updated>2021-04-28T17:20:44.811Z</atom:updated>
            <content:encoded><![CDATA[<h3>What is Regression?</h3><p>Regression is the method used to predict the continuous variable in the target column or dependent variable based on independent features. It falls under the supervised technique. It is a statistical tool used to find out the relationship between the outcome variable, the dependent variable, and one or more variables often called independent variables.</p><h3>What is Linear Regression?</h3><p>Linear regression is used for finding the linear relationship between the target and one or more predictors.</p><p>Simple linear regression finds the relationship between the dependent (Y) and independent (X) and it tries to find the best fit line by minimizing the errors this fitness function says how good your model is, or you can define a cost function that measures how bad it is. Cost function measures the distances between model predictions and training data. But <strong>our objective of linear regression is to minimize the distances (or) Errors(or) Residuals</strong>. It ranges from -inf to +inf. This algorithm uses <strong>ORDINARY LEAST SQUARE (OLS)</strong>.</p><p><strong>Best fit line formula (or) Predicted formula</strong></p><p><strong>1) Simple Linear Regression</strong> :- Y= β0+ β1X</p><p><strong>2) Multiple Linear Regression</strong> :- Y= β0+ β1X1+ β2X2+ β3X3+….+ βnXn</p><p>βo and β1 are two unknown constants. β1 is the slope and β0 is an intercept of Y.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/409/1*a8t0Kosar_Nkfvr5Fp8nyA.png" /></figure><p>P1= Original Y data point for given X</p><p>P2= Estimated y value for given X</p><p>Y Bar= Y mean</p><p>X Bar = X mean</p><h3>Now let us understand the Performances of the Linear Regression Model.</h3><p><strong>Errors= Y Actual value — Predicted line</strong></p><p><strong>1.SSE (Residual error (or) Unexplained error): — </strong>The error is the difference between the observed value of Y and the predicted value of Y</p><p><strong>2.SSR (Regression error (or) Explained error): —</strong> The error is the difference between the mean value of Y and the predicted value of Y</p><p><strong>3.SST (Sum of squared error Total): —</strong> SST quantifies the variation of the observed values of Y around the mean value of Y.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/303/1*CC-LbVTKSdhuigrOh0EKjg.png" /></figure><p><strong>4.MAE (Mean Absolute Error): —</strong> It’s the average absolute difference between the actual values and the predicted values.</p><p><strong>5.MAPE (Mean Absolute Percentage Error): — </strong>It is the average of the ratio of the absolute difference between actual &amp; predicted values and actual value.</p><p><strong>6.RMSE (Root Mean Square Error): — </strong>It calculates the square root average of the sum of the squared difference between the actual and the predicted values.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/306/1*nSxLSFmhopNkXebhxBOn2Q.png" /></figure><p><strong>7.R Square(R2): — </strong>R-square value depicts the percentage of the variation in the dependent variable explained by the independent variable in the model it may also know as the coefficient of determination. R square ranges between 0 to 1. If r square is close to 1 then model predictability is high. The value of R2 increases if we add more variables to the model irrespective of the variable contributing to the model or not. This is the disadvantage of using R2.</p><p><strong>8.Adjusted R Square: — </strong>The disadvantage of R Square is fixed by the Adjusted R Square value. Adjusted R2 value will improve only if the added variable is making a significant contribution to the model. Adjusted R square value adds penalty in the model. Adjusted R square is always less than R square.</p><p>where R2 is R-square value, n = total number of observations, and k = total number of variables used in the model. If we increase the number of variables, the denominator becomes smaller and the overall ratio will be high. Subtracting from 1 will reduce the overall Adjusted R2. So, to increase the Adjusted R2, the contribution of additive features to the model should be significantly high.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/303/1*JhhUkh5tRPhuaVJ6k3OLDA.png" /></figure><h3>Assumptions of Linear Regression</h3><h4>1. Multicollinearity</h4><p>There should not be a high correlation between two or more independent variables.<strong> If there is multicollinearity present in our model, we need to drop those features step by step</strong>. Multicollinearity can be checked using correlation matrix, Tolerance and Variance Influencing Factor (VIF).</p><p><strong>VIF = 1/1- R Square</strong></p><h4>2. Normality</h4><p>When our data flows in normal distribution then we can say normality exists. If our data is not normal, we need to apply the transformation technique to the Target variable. Normality can be checked using the Shapiro test (or) Prob plot (or) Skew. Skewness should be checked with residuals. <strong>The Range should be -0.5 to +0.5 for both the Shapiro test and Skew</strong>.</p><h4>3. Linearity</h4><p>There should be a linear relationship between dependent and independent variables. If our data is not linear, <strong>we need to do the transformation of the dependent variable to bring it in form of linearity</strong>. Linearity can be checked using Linear rainbow from the stats library <strong>the probability value should greater than 0.5</strong>.</p><h4>4. Autocorrelation</h4><p>Association between two variables is called Serial Correlation. When there is repeated data then we can say that there is autocorrelation between the variables. There should not be autocorrelation. Check autocorrelation for residue.</p><p>This can be checked by doing the Durbin Watson Test from the<strong> OLS summary Report</strong>. <strong>If Durbin Watson is 2 then there is no autocorrelation if it’s approximately between 1.5 to 2.5 then it’s preferable if it’s greater than 2.5 then the presence of autocorrelation in the model</strong>.</p><h4>5. Homoscedasticity</h4><p>My Model should be Homoscedasticity. It can be defined as the uniform variance. This can be checked with het_goldfeldquandt from the stats library the <strong>probability value should be greater than 0.5</strong>.</p><blockquote><strong>Keys</strong></blockquote><p>· If we have categorical data, we need to convert it to dummy variables before building the model.</p><p>· No Multicollinearity</p><p>· Residuals should be normal</p><p>· Residuals should be linear</p><p>· No autocorrelation</p><p>· Presences of Homoscedasticity.</p><h3>Here is the next blog for tunning the model.</h3><h4>Hyperparameter tuning in linear regression link <a href="https://sruthils22.medium.com/hyperparameter-tuning-in-linear-regression-e0e0f1f968a1">Click here</a></h4><h3>References</h3><p><a href="https://www.ajo.com/article/S0002-9394(10)00167-4/fulltext">https://www.ajo.com/article/S0002-9394(10)00167-4/fulltext</a></p><p><a href="https://sphweb.bumc.bu.edu/otlt/MPH-Modules/BS/R/R5_Correlation-Regression/R5_Correlation-Regression4.html">https://sphweb.bumc.bu.edu/otlt/MPH-Modules/BS/R/R5_Correlation-Regression/R5_Correlation-Regression4.html</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=783bb5e58944" width="1" height="1" alt=""><hr><p><a href="https://medium.com/analytics-vidhya/linear-regression-in-machine-learning-783bb5e58944">Linear Regression in Machine Learning</a> was originally published in <a href="https://medium.com/analytics-vidhya">Analytics Vidhya</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Selecting the right statistical test for our requirement.]]></title>
            <link>https://medium.com/analytics-vidhya/selecting-the-right-statistical-test-for-our-requirement-d3c607b01600?source=rss-20f552c51232------2</link>
            <guid isPermaLink="false">https://medium.com/p/d3c607b01600</guid>
            <category><![CDATA[statistical-analysis]]></category>
            <category><![CDATA[statistical-learning]]></category>
            <category><![CDATA[statistical-significance]]></category>
            <category><![CDATA[statistics-for-machine]]></category>
            <category><![CDATA[statistical-modeling]]></category>
            <dc:creator><![CDATA[Lakshmi Sruthi]]></dc:creator>
            <pubDate>Thu, 15 Apr 2021 04:15:14 GMT</pubDate>
            <atom:updated>2021-05-17T12:19:02.835Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>What is the purpose of doing the statistical test?</strong></p><p>A statistical test provides a mechanism for making a quantitative decision about the process and it allows us to make sense and interpret a great deal of information and it gives numerical evidence to draw valid conclusions from the test results. Using statistical analysis, <strong>we can determine the likelihood that a hypothesis should be either accepted or rejected</strong>. Most statistical tests are conducted under the assumption that measurements in the underlying population follow some known distribution. The reason for doing a statistical test is to <strong>find solutions for predictive function-based data</strong>.</p><p><strong>Steps involved in performing a statistical test:</strong></p><p>1. Framing hypothesis.</p><p>2. Identification of statistical test.</p><p>3. Finding the test statistic (stats value) and probability value (p-value).</p><p>4. Interpreting the test results.</p><p><strong>Framing hypothesis:</strong> — Assumptions are made without seeing the data. Types of hypothesis a) Null hypothesis(ho) b) Alternate hypothesis(ha/h1). <strong>Hypothesis testing provides a method to reject a null hypothesis within a certain confidence level</strong>. But the reason why we reject the null hypothesis is that, if we accept the null hypothesis the independent features do not have any influence on the prediction of the target variable. The alternative hypothesis proposes that there is a difference.</p><p><strong>Identification of statistical test</strong></p><p>This is the most important step to choose the right statistical test for our variables.</p><p>What is the significance level?</p><p>The default significance level (<strong>α</strong>) is 0.05 indicates a 5% risk of concluding that aims to quantify evidence against a particular hypothesis being true.</p><p><strong>· </strong>If p value&gt; α (accept Ho)</p><p><strong>· </strong>If p value&lt; α (reject Ho)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/802/1*nu3Nn_u3ekMq8zf6gjq3zA.png" /><figcaption>Statistical test</figcaption></figure><p>How do you find the normality of your data?</p><p>We can check with the help of Shapiro–Wilk test or Jarque-Bera Test. If the p-value is less than the significance level, then ho is rejected else ha/h1 is selected.</p><p>Certain assumptions are made while doing a non-parametric test. The non-parametric test is done when data is not normally distributed.</p><p>Ho: skew=0 (or) p value&gt; significance level(Data is normal)</p><p>Ha(or) h1: skew!=0 (or) p value≤ significance level (Data is not normal)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6rMeIcuaEouTWcM7CFM55Q.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/696/1*IMBtJHQdMWR-52myKqzLiA.jpeg" /></figure><p><strong>Interpreting the test results</strong></p><p>If <strong>Alternate Hypotheses</strong> are selected then it will be useful in predicting the output.</p><p>Ha H1: variable_1(mu1) != variable_2(mu2)</p><p>(or)</p><p>p-value ≤ significance level</p><p>If a <strong>Null Hypothesis </strong>is selected then it will not be useful in predicting the output</p><p>Ho: variable_1(mu1) = variable_2(mu2)</p><p>(or)</p><p>p-value &gt; significance level</p><p><strong>Footnotes</strong></p><p>Yes, it’s important to do statistical analysis before jumping into the Machine learning algorithms.</p><p>Hope you gained some useful insights.</p><p>Thanks for reading. :)</p><p>And,💙 if this was a good read. Enjoy!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d3c607b01600" width="1" height="1" alt=""><hr><p><a href="https://medium.com/analytics-vidhya/selecting-the-right-statistical-test-for-our-requirement-d3c607b01600">Selecting the right statistical test for our requirement.</a> was originally published in <a href="https://medium.com/analytics-vidhya">Analytics Vidhya</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>