<?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 Sumathy T on Medium]]></title>
        <description><![CDATA[Stories by Sumathy T on Medium]]></description>
        <link>https://medium.com/@jeffashu.mca?source=rss-641dc8cabe96------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*nj6w9H4sBF6_qmZx</url>
            <title>Stories by Sumathy T on Medium</title>
            <link>https://medium.com/@jeffashu.mca?source=rss-641dc8cabe96------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 21 Nov 2026 18:14:00 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@jeffashu.mca/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[From Linear Regression to Regularization: Understanding Model Behavior Beyond Metrics]]></title>
            <link>https://medium.com/@jeffashu.mca/from-linear-regression-to-regularization-understanding-model-behavior-beyond-metrics-0ab9d0c1c611?source=rss-641dc8cabe96------2</link>
            <guid isPermaLink="false">https://medium.com/p/0ab9d0c1c611</guid>
            <category><![CDATA[ridge-regression]]></category>
            <category><![CDATA[crossvalidation]]></category>
            <category><![CDATA[linear-regression]]></category>
            <category><![CDATA[alpha]]></category>
            <category><![CDATA[lasso]]></category>
            <dc:creator><![CDATA[Sumathy T]]></dc:creator>
            <pubDate>Sat, 14 Feb 2026 06:16:58 GMT</pubDate>
            <atom:updated>2026-02-14T06:16:58.354Z</atom:updated>
            <content:encoded><![CDATA[<p>Machine learning is often reduced to a competition of metrics — higher accuracy, better R², lower error. But real understanding begins when we ask a deeper question:</p><p><em>Why does a model behave the way it does?</em></p><p>In this article, I explore Linear Regression and its regularized variants — Ridge and Lasso — not from a performance perspective, but from a conceptual and practical understanding of model behavior.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*NtPeq40twCOUwjOP" /><figcaption>Photo by <a href="https://unsplash.com/@razipourjafari?utm_source=medium&amp;utm_medium=referral">razi pouri</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><h4>The Strength of Linear Regression</h4><p>Linear Regression is one of the most fundamental models in machine learning. It assumes a linear relationship between input variables and the target variable and estimates coefficients that minimize squared error.</p><p>Despite its simplicity, Linear Regression often performs remarkably well when:</p><ul><li>Relationships are approximately linear</li><li>The number of features is moderate</li><li>The data is reasonably clean</li></ul><p>However, one subtle issue frequently arises: <strong>multicollinearity</strong>.</p><h4>The Hidden Problem: Multicollinearity</h4><p>Multicollinearity occurs when predictor variables are highly correlated with each other.</p><p>While this does not always harm predictive performance, it affects:</p><ul><li>Coefficient stability</li><li>Interpretability</li><li>Sensitivity to small data changes</li></ul><p>When predictors are correlated, the model struggles to determine which variable deserves credit for explaining the target. As a result, coefficients may fluctuate or even change sign.</p><p>This is where regularization becomes useful.</p><h4>Ridge Regression: Reducing Variance Through Shrinkage</h4><p>Ridge Regression adds an L2 penalty term to the loss function, which discourages large coefficient values.</p><p>By shrinking coefficients toward zero, Ridge:</p><ul><li>Reduces model variance</li><li>Improves numerical stability</li><li>Handles multicollinearity gracefully</li></ul><p>Ridge does not eliminate features; it simply reduces their influence. This makes it ideal when most predictors are meaningful but correlated.</p><p>An important insight: Ridge does not necessarily improve predictive performance dramatically. Often, it improves <em>stability</em> more than accuracy.</p><h4>Lasso Regression: Simplicity Through Sparsity</h4><p>Lasso Regression introduces an L1 penalty, which can shrink some coefficients exactly to zero.</p><p>This creates a sparse model — one that automatically performs feature selection.</p><p>Lasso is especially powerful when:</p><ul><li>The number of predictors is large</li><li>Many features are irrelevant</li><li>Model simplicity is desired</li></ul><p>However, if regularization is too strong, Lasso may remove genuinely useful predictors, increasing bias and leading to underfitting.</p><h4>The Role of Hyperparameter Tuning</h4><p>Both Ridge and Lasso rely on a regularization parameter (α) that controls the strength of the penalty.</p><p>Choosing this parameter arbitrarily can lead to:</p><ul><li>Over-regularization</li><li>Under-regularization</li><li>Poor generalization</li></ul><p>Cross-validation provides a systematic way to select this parameter by evaluating performance across multiple data splits. It ensures that the chosen model balances bias and variance effectively.</p><h4>Bias–Variance Tradeoff in Practice</h4><p>Regularization directly influences the bias–variance tradeoff:</p><ul><li>Strong regularization increases bias but reduces variance</li><li>Weak regularization decreases bias but may increase variance</li></ul><p>The goal is not to eliminate bias or variance, but to find a balance that generalizes well to unseen data.</p><p>Understanding this tradeoff is more important than memorizing algorithms.</p><h4>Key Takeaways</h4><ol><li>Linear models remain powerful and relevant.</li><li>Multicollinearity affects interpretation more than raw prediction accuracy.</li><li>Ridge improves stability without forcing feature elimination.</li><li>Lasso promotes sparsity but must be tuned carefully.</li><li>Cross-validation is essential for reliable hyperparameter selection.</li><li>Model choice should be guided by structure and behavior — not trends.</li></ol><p>Regularization is a tool for controlling complexity and improving robustness.</p><p>The true learning happens when we observe how models react — when coefficients shrink, when features disappear, when bias increases, when variance decreases.</p><p>Machine learning is about understanding the mechanics behind them. And that understanding is what turns code into insight.</p><p><a href="https://www.kaggle.com/code/tsumathy/linear-reg-car-mpg">https://www.kaggle.com/code/tsumathy/linear-reg-car-mpg</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0ab9d0c1c611" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[From Neural Networks to Transformers: Simple and intuitive way]]></title>
            <link>https://medium.com/@jeffashu.mca/from-neural-networks-to-transformers-simple-and-intuitive-way-00d1489473aa?source=rss-641dc8cabe96------2</link>
            <guid isPermaLink="false">https://medium.com/p/00d1489473aa</guid>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[transformers]]></category>
            <category><![CDATA[neural-networks]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[machine-learning]]></category>
            <dc:creator><![CDATA[Sumathy T]]></dc:creator>
            <pubDate>Tue, 27 Jan 2026 06:12:59 GMT</pubDate>
            <atom:updated>2026-01-27T06:12:59.791Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*OfpzndpitqlagKur" /><figcaption>Photo by <a href="https://unsplash.com/@mirzaie?utm_source=medium&amp;utm_medium=referral">Mehdi Mirzaie</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><h4>The Beginning: Neural Networks (ANN)</h4><p>A <strong>Neural Network</strong> (often called an <strong>Artificial Neural Network or ANN</strong>) is inspired by how the human brain works.</p><p>At a basic level:</p><ul><li>You give some input</li><li>The network processes it through layers</li><li>You get an output</li></ul><p>Think of it like this:</p><p><em>“Given some numbers, can I learn a pattern and predict something?”</em></p><p>Neural networks were powerful because:</p><ul><li>They could learn <strong>non-linear relationships</strong></li><li>They reduced the need for manual rule-based systems</li></ul><h4>But there was a problem…</h4><p>Neural networks treat <strong>everything as just numbers</strong>.<br> They don’t understand:</p><ul><li>Images have shapes</li><li>Words have order</li><li>Time series have memory</li></ul><p>This limitation forced researchers to move forward.</p><h4>Seeing Images Properly: CNN</h4><p>When people tried to use normal neural networks for images, things broke down.</p><p>Why?</p><p>An image is not just a list of numbers.<br> It has:</p><ul><li>Edges</li><li>Shapes</li><li>Spatial structure</li></ul><p><strong>Convolutional Neural Networks (CNNs)</strong> were created to solve this.</p><p>CNNs learn:</p><ul><li>Small patterns first (edges)</li><li>Then bigger patterns (shapes)</li><li>Then complete objects</li></ul><p>That’s why CNNs work so well for:</p><ul><li>Image classification</li><li>Object detection</li><li>Medical imaging</li></ul><h4>Still, something was missing…</h4><p>CNNs are great at understanding <strong>space</strong>, but they don’t understand <strong>time or order</strong>.</p><p>They don’t know what came <em>before</em> or <em>after</em>.</p><h4>Understanding Sequences: RNN</h4><p>Now imagine:</p><ul><li>A sentence</li><li>A speech signal</li><li>A time-series like temperature</li></ul><p>Order matters here.</p><p><strong>Recurrent Neural Networks (RNNs)</strong> were introduced to handle this.</p><p>RNNs have a simple but powerful idea:</p><blockquote><em>“What I see now should depend on what I saw before.”</em></blockquote><p>So they maintain a kind of <strong>memory</strong>.</p><p>This made RNNs useful for:</p><ul><li>Time series forecasting</li><li>Language modeling</li><li>Speech recognition</li></ul><h4>But again… a problem</h4><p>As sequences became longer, RNNs:</p><ul><li>Forgot old information</li><li>Became difficult to train</li><li>Learned slowly</li></ul><h4>Better Memory: LSTM and GRU</h4><p>To fix RNN’s memory problem, <strong>LSTM</strong> and <strong>GRU</strong> were created.</p><p>They introduced <strong>gates</strong>:</p><ul><li>What to remember</li><li>What to forget</li><li>What to pass forward</li></ul><p>This allowed models to:</p><ul><li>Remember long-term patterns</li><li>Train more reliably</li></ul><p>LSTMs became extremely popular for:</p><ul><li>Long time-series data</li><li>Forecasting tasks</li><li>Many research applications</li></ul><p>But one issue remained…</p><p>These models still process data <strong>step by step</strong>. That makes them slow and hard to scale.</p><h4>A Major Shift: Transformers</h4><p>Instead of asking:</p><blockquote><em>“What did I see before?”</em></blockquote><p>Transformers ask:</p><blockquote><strong><em>“What parts of the data are important right now?”</em></strong></blockquote><p>This idea is called <strong>attention</strong>.</p><p>Transformers:</p><ul><li>Look at the whole sequence at once</li><li>Focus only on the important parts</li><li>Can be trained in parallel (much faster)</li></ul><p>This is why transformers now dominate:</p><ul><li>Natural language processing</li><li>Vision models</li><li>Time-series forecasting</li></ul><h3>The Most Important Lesson</h3><p>Instead of asking:</p><blockquote><em>“Which neural network is best?”</em></blockquote><p>A better question is:</p><blockquote><strong><em>“What kind of data do I have?”</em></strong></blockquote><ul><li>Numbers → ANN</li><li>Images → CNN</li><li>Time-series → LSTM / Transformer</li><li>Text → Transformer</li><li>Small data → classical ML</li><li>Large data → deep learning</li></ul><p>Deep learning did not evolve randomly.</p><p>It evolved because:</p><ul><li>Data changed</li><li>Problems became harder</li><li>Old models hit their limits</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=00d1489473aa" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[A Quick Guide to LSTM Variants: From Vanilla LSTM to Attention Models]]></title>
            <link>https://medium.com/@jeffashu.mca/a-quick-guide-to-lstm-variants-from-vanilla-lstm-to-attention-models-10d88a3aa096?source=rss-641dc8cabe96------2</link>
            <guid isPermaLink="false">https://medium.com/p/10d88a3aa096</guid>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[lstm]]></category>
            <category><![CDATA[variant]]></category>
            <category><![CDATA[deep-learning]]></category>
            <category><![CDATA[ai]]></category>
            <dc:creator><![CDATA[Sumathy T]]></dc:creator>
            <pubDate>Fri, 12 Dec 2025 04:33:09 GMT</pubDate>
            <atom:updated>2025-12-12T04:33:09.678Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hzL3FPpO3Fps5F2rFgIgeA.png" /><figcaption>Illustration created by the author</figcaption></figure><p>Recurrent neural networks (RNNs) are powerful tools for modeling sequences such as text, speech, stock prices, energy demand, and more. However, classic RNNs suffer from the <strong>vanishing gradient problem</strong>, making it difficult to learn long-term patterns.</p><p>To solve this, researchers introduced <strong>Long Short-Term Memory networks (LSTMs)</strong> — a breakthrough architecture that uses gates to control how information flows over time.</p><p>Over the years, LSTMs evolved into several <strong>variants</strong>, each designed to overcome a limitation or enhance performance for a specific task. This article provides an intuitive overview of the most widely used LSTM variations and when to use them.</p><h4>1. Vanilla LSTM (Standard LSTM)</h4><p>The original LSTM architecture introduced in 1997.<br> It uses three gates — <strong>input</strong>, <strong>forget</strong>, and <strong>output</strong> — to regulate long-term memory.</p><p><strong>Best for:</strong> General sequence tasks like text modeling, forecasting, and speech processing.</p><h4>2. Stacked (Deep) LSTM</h4><p>Instead of a single LSTM layer, multiple layers are stacked on top of each other.</p><p><strong>Why it works:</strong><br> Lower layers learn simple temporal patterns; higher layers learn deeper, abstract patterns.</p><p><strong>Best for:</strong><br> Any sequence task where a single layer isn’t expressive enough.</p><h4>3. Bidirectional LSTM (BiLSTM)</h4><p>Processes the sequence in both directions:</p><ul><li>forward (left → right)</li><li>backward (right → left)</li></ul><p>This gives the model access to <strong>past and future context</strong> simultaneously.</p><p><strong>Best for:</strong><br> Text tasks like sentiment analysis, named entity recognition, and speech recognition.</p><p><strong>Not suitable for:</strong><br> Online forecasting where future data is unavailable.</p><h4>4. Peephole LSTM</h4><p>Adds connections allowing gates to “peek” directly at the cell state.</p><p><strong>Why:</strong><br> Improves the LSTM’s ability to model precise timing signals.</p><p><strong>Best for:</strong><br> Speech synthesis, handwriting generation.</p><h4>5. Gated Recurrent Unit (GRU)</h4><p>Not technically an LSTM, but closely related.<br> GRUs simplify the LSTM by combining gates and reducing parameters.</p><p><strong>Why use GRU:</strong></p><ul><li>Faster training</li><li>Comparable accuracy</li><li>Works well on small datasets</li></ul><h4>6. ConvLSTM (Convolutional LSTM)</h4><p>Replaces dense matrix multiplications inside the LSTM with <strong>convolutions</strong>.</p><p><strong>Why:</strong><br> Captures both <strong>spatial</strong> and <strong>temporal</strong> patterns.</p><p><strong>Best for:</strong></p><ul><li>Weather prediction</li><li>Traffic flow</li><li>Video forecasting</li><li>Spatiotemporal modeling</li></ul><h4>7. Attention LSTM</h4><p>Adds an attention mechanism on top of the LSTM so the model can “focus” on important time steps instead of treating all points equally.</p><p><strong>Why:</strong><br> Improves performance for long sequences and highlights influential inputs.</p><p><strong>Best for:</strong></p><ul><li>Long-term forecasting</li><li>NLP tasks</li><li>Hybrid models</li></ul><h4>8. Seq2Seq (Encoder–Decoder LSTM)</h4><p>Widely used in machine translation and multi-step forecasting.<br> The model consists of two parts:</p><ul><li><strong>Encoder:</strong> Reads the input sequence</li><li><strong>Decoder:</strong> Generates the output sequence</li></ul><p><strong>Why:</strong><br> Allows input and output lengths to differ.<br> Excellent for multi-step prediction horizons.</p><h4>9. Residual / Skip-Connected LSTM</h4><p>Adds skip connections around LSTM layers, similar to ResNet.</p><p><strong>Why:</strong><br> Improves gradient flow in deep recurrent networks.</p><p><strong>Best for:</strong><br> Very deep LSTM architectures.</p><h4>10. Hybrid LSTM Models</h4><p>LSTMs combined with other architectures:</p><ul><li><strong>CNN–LSTM:</strong> Extracts spatial patterns, then models time</li><li><strong>Transformer–LSTM:</strong> Adds attention with temporal bias</li></ul><p><strong>Best for:</strong><br> Real-world forecasting applications requiring flexible modeling.</p><h4>Conclusion</h4><p>LSTMs have grown from a single architecture into a large family of models. Whether you’re modeling simple sequences, capturing long-range dependencies, or building a hybrid deep learning system, there is an LSTM variant designed for the job.</p><p>The best choice depends on the task:</p><ul><li><strong>Vanilla / Stacked LSTM</strong> → General and forecasting</li><li><strong>BiLSTM</strong> → NLP and speech</li><li><strong>ConvLSTM</strong> → Spatiotemporal patterns</li><li><strong>Attention LSTM</strong> → Long dependencies</li><li><strong>Seq2Seq</strong> → Multi-step prediction</li><li><strong>GRU</strong> → Faster and simpler alternative</li></ul><p>Understanding these variations helps you design better sequence models for any application.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=10d88a3aa096" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Evaluation Metrics for Categorical Data — Made Simple]]></title>
            <link>https://medium.com/@jeffashu.mca/evaluation-metrics-for-categorical-data-made-simple-cc4967dd9d37?source=rss-641dc8cabe96------2</link>
            <guid isPermaLink="false">https://medium.com/p/cc4967dd9d37</guid>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[accuracy-and-precision]]></category>
            <category><![CDATA[evaluation-metric]]></category>
            <category><![CDATA[beginner]]></category>
            <category><![CDATA[model-performance]]></category>
            <dc:creator><![CDATA[Sumathy T]]></dc:creator>
            <pubDate>Sun, 11 May 2025 20:12:56 GMT</pubDate>
            <atom:updated>2025-05-11T20:12:56.087Z</atom:updated>
            <content:encoded><![CDATA[<h3>Evaluation Metrics for Categorical Data — Made Simple</h3><p>Evaluation metrics help assess how well a model performs on data. Some metrics, especially Precision and Recall — can be confusing at first, so I would like to share beginner friendly quick notes in a simple and clear way. The most common metrics you will see in a classification report are Accuracy, Precision, Recall and F1 score. Let’s go through them one by one with an example.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dg5oFtxLqUZutm7-rymABw.png" /></figure><p>Example:</p><p>Q: Is a patient affected by Pneumonia?</p><p>Yes (1) = Test is positive</p><p>No (0) = Test is negative</p><p>Suppose, we have 100 samples.</p><p>50 samples are positive (1 = Pneumonia)</p><p>50 samples are negative (0 = No Pneumonia)</p><p>We feed these 100 samples to our model for prediction. The model gives the following result,</p><p><strong>True Positive (TP)</strong>: 42 cases correctly predicted as positive</p><p><strong>True Negative (TN)</strong>: 42 cases correctly predicted as negative</p><p><strong>False Positive (FP)</strong>: 8 cases incorrectly predicted as positive</p><p><strong>False Negative (FN)</strong>: 8 cases incorrectly predicted as negative</p><p><strong>Metrics Breakdown:</strong></p><p>1) <strong>Accuracy:</strong></p><p>Among all predictions how many were correct? This works well, when the classes are balanced. In our case — 50 (positive), 50(negative).</p><p>Accuracy = Correct Predictions / Total Predictions</p><p>Accuracy = TP + TN / (TP+TN+FP + FN) = ( 42 + 42 ) / 100 = 84 %</p><p>So, the model is correct 82 % of the time overall.</p><p>2) <strong>Precision</strong>:</p><p>Out of all the predicted Pneumonia cases, how many are actually Pneumonia?</p><p>Precision = TP / ( TP + FP) = 42 / ( 42 + 8 ) = 84 %</p><p>This means the model is 84% confident when it predicts someone has pneumonia.</p><p><strong>3) Recall:</strong></p><p>Out of all actual pneumonia cases , how many did the model correctly identify? (Actual cases the model catches)</p><p>Recall = TP / (TP + FN ) = 42 / (42 + 8) = 84%</p><p>The model caught 84% of the actual cases, but missed 16% of them.</p><p><strong>4) F1 score:</strong></p><p>A balance between Precision and Recall. It’s especially useful when you need to balance false positives and false negatives.</p><p>F1 = 2 x (Precision x Recall ) / (Precision + Recall) = 2 x ( 0.84 x 0.80 ) / (0.84 + 0.80 ) ≈ 0.84</p><p>These are the basic metrics used to evaluate categorical data. Don’t get overwhelmed — start simple, understand the core ideas, and build from there. Try it with different values. Hope this helps you!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cc4967dd9d37" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>