<?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 Anirudhsrinivas on Medium]]></title>
        <description><![CDATA[Stories by Anirudhsrinivas on Medium]]></description>
        <link>https://medium.com/@anirudhsrinivas2001?source=rss-692a2f20e1c5------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*RL151BU3VKBMwIdD</url>
            <title>Stories by Anirudhsrinivas on Medium</title>
            <link>https://medium.com/@anirudhsrinivas2001?source=rss-692a2f20e1c5------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 27 Nov 2026 22:48:19 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@anirudhsrinivas2001/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[Understanding Decision Trees: A Beginner-Friendly Guide]]></title>
            <link>https://medium.com/@anirudhsrinivas2001/understanding-decision-trees-a-beginner-friendly-guide-d0ac4e7c4e61?source=rss-692a2f20e1c5------2</link>
            <guid isPermaLink="false">https://medium.com/p/d0ac4e7c4e61</guid>
            <dc:creator><![CDATA[Anirudhsrinivas]]></dc:creator>
            <pubDate>Fri, 12 Dec 2025 15:55:58 GMT</pubDate>
            <atom:updated>2025-12-12T15:55:58.828Z</atom:updated>
            <content:encoded><![CDATA[<p>Decision trees are one of the most intuitive and widely used algorithms in machine learning. They mimic human decision-making by splitting data into branches based on certain conditions, ultimately leading to a prediction or classification. In this article, we’ll explore the fundamentals of decision trees, including key concepts like <strong>Gini Impurity</strong>, <strong>Entropy</strong>, their applications, and the steps involved in building one.</p><h3>What is a Decision Tree?</h3><p>A decision tree is a flowchart-like structure where:</p><ul><li><strong>Nodes</strong> represent a feature or attribute.</li><li><strong>Branches</strong> represent a decision rule.</li><li><strong>Leaves</strong> represent the outcome (class label or value).</li></ul><p>The goal is to split the dataset into subsets that are as pure as possible, meaning each subset contains data points that belong to the same class.</p><h3>Key Concepts</h3><h3>1. Gini Impurity</h3><p>Gini Impurity measures how often a randomly chosen element would be incorrectly classified if it was randomly labeled according to the distribution of labels in the subset.</p><p>The formula is:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*UwYk3mYMc2IbqTom.png" /></figure><p>Where:</p><ul><li>pip_ipi​ = probability of class iii in the node.</li></ul><p>A Gini score of <strong>0</strong> means perfect purity (all elements belong to one class), while higher values indicate more impurity.</p><h3>2. Entropy</h3><p>Entropy is a measure of uncertainty or disorder in the dataset. It is used in <strong>Information Gain</strong>, which determines how much a feature reduces uncertainty.</p><p>The formula for entropy:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/446/0*1nU4sfsNXTTIY950" /></figure><p>Where:</p><ul><li>pi= probability of class iii.</li></ul><p>Lower entropy means the data is more pure.</p><h3>Information Gain</h3><p>Information Gain is the reduction in entropy after splitting on a feature:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/299/0*_jbbKo0ImR97ZZSp" /></figure><p>The feature with the highest information gain is chosen for the split.</p><h3>Steps in Building a Decision Tree</h3><p><strong>1.Select the Best Feature to Split</strong><br> Use metrics like Gini Impurity or Information Gain to choose the feature that best separates the data.</p><p><strong>2.Split the Dataset</strong><br> Divide the dataset into subsets based on the chosen feature.</p><p><strong>3.Repeat Recursively</strong><br> Apply the same process to each subset until:</p><ul><li>All nodes are pure, or</li><li>A stopping criterion (like max depth) is reached.</li></ul><p><strong>4.Assign Labels</strong><br> At leaf nodes, assign the most frequent class or the average value (for regression).</p><h3>Applications of Decision Trees</h3><ul><li><strong>Classification</strong>: Predicting categories (e.g., spam detection, disease diagnosis).</li><li><strong>Regression</strong>: Predicting continuous values (e.g., house prices).</li><li><strong>Feature Selection</strong>: Identifying important features in datasets.</li><li><strong>Business Decisions</strong>: Customer segmentation, credit risk analysis.</li></ul><h3>Advantages</h3><ul><li>Easy to interpret and visualize.</li><li>Handles both numerical and categorical data.</li><li>Requires little data preprocessing.</li></ul><h3>Limitations</h3><ul><li>Prone to overfitting.</li><li>Sensitive to small changes in data.</li><li>Can become complex with large datasets.</li></ul><h3>Final Thoughts</h3><p>Decision trees are a powerful tool for both beginners and experts. Understanding concepts like Gini Impurity and Entropy helps you appreciate how these models work under the hood. While they have limitations, techniques like pruning and ensemble methods (Random Forests, Gradient Boosted Trees) can overcome these challenges.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d0ac4e7c4e61" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ Understanding Classification Metrics: A Beginner-Friendly Guide]]></title>
            <link>https://medium.com/@anirudhsrinivas2001/understanding-classification-metrics-a-beginner-friendly-guide-cc9247c71494?source=rss-692a2f20e1c5------2</link>
            <guid isPermaLink="false">https://medium.com/p/cc9247c71494</guid>
            <dc:creator><![CDATA[Anirudhsrinivas]]></dc:creator>
            <pubDate>Mon, 24 Nov 2025 17:51:30 GMT</pubDate>
            <atom:updated>2025-11-24T17:51:30.660Z</atom:updated>
            <content:encoded><![CDATA[<p>When you’re building a <strong>classification model</strong>, it’s not enough to check just whether it’s <em>right or wrong</em>. Some mistakes are more costly than others. That’s where metrics like <strong>precision</strong>, <strong>recall</strong>, <strong>specificity</strong>, <strong>F1-score</strong>, and <strong>ROC / AUC</strong> come in. Here’s how they work — and when to use each.</p><h3>1. Confusion Matrix: The Foundation</h3><p>A <strong>confusion matrix</strong> is the starting point. It’s a 2×2 table that compares predicted vs. actual classes for <em>binary classification</em>. The four cells are:</p><ul><li><strong>True Positives (TP)</strong>: Correctly predicted positive</li><li><strong>False Positives (FP)</strong>: Predicted positive but actually negative</li><li><strong>True Negatives (TN)</strong>: Correctly predicted negative</li><li><strong>False Negatives (FN)</strong>: Predicted negative but actually positive</li></ul><p>Every metric we talk about comes from these four numbers.</p><h3>2. Accuracy: The Simple Snapshot</h3><p><strong>Accuracy</strong> = (TP + TN) / (Total)</p><ul><li>Measures how many predictions are simply <em>correct</em>.</li><li>Easy to understand, but <strong>can be misleading</strong> when classes are imbalanced.</li></ul><p><strong>Example</strong>: In a spam-detection model, if 95 % of emails are <em>not spam</em>, a model that always predicts “not spam” will be 95% accurate — but it’s useless for catching actual spam.</p><h3>3. Recall (Sensitivity): Catching the Positives</h3><p><strong>Recall</strong> (also called <strong>sensitivity</strong>) = TP / (TP + FN)</p><ul><li>Answers: <em>Of all the real positive cases, how many did my model catch?</em></li><li>High recall means few <em>false negatives</em>.</li></ul><p><strong>Use case</strong>: In a <strong>medical test</strong> for a serious disease, you want to catch as many sick patients as possible. Even if you flag a few healthy ones by mistake, missing a sick person could be very dangerous.</p><h3>4. Specificity: Not Flagging the Negatives</h3><p><strong>Specificity</strong> = TN / (TN + FP)</p><ul><li>Answers: <em>Of all the real negative cases, how many did my model correctly identify as negative?</em></li><li>High specificity means few <em>false positives</em>.</li></ul><p><strong>Use case</strong>: In a scenario where false alarms are costly — say, a fraud detection model wrongly flagging legitimate transactions — you care about specificity.</p><h3>5. Precision: Being Right When You Predict Positive</h3><p><strong>Precision</strong> = TP / (TP + FP)</p><ul><li>Answers: <em>Of all the cases the model predicted as positive, how many really are positive?</em></li><li>High precision means few <em>false positives</em>.</li></ul><p><strong>Use case</strong>: For a <strong>spam filter</strong>, if the model marks an email as spam (positive), we want to be quite sure it’s actually spam — because mislabeling important emails is bad.</p><h3>6. F1-Score: The Balanced Metric</h3><p><strong>F1-Score</strong> = 2 * (Precision * Recall) / (Precision + Recall)</p><ul><li>It’s the <strong>harmonic mean</strong> of precision and recall. <a href="https://en.wikipedia.org/wiki/F-score?utm_source=chatgpt.com">Wikipedia+1</a></li><li>Useful when you need a good balance between catching positives (recall) and being correct when you predict positives (precision). <a href="https://medium.com/%40duygujones/classification-metrics-choosing-the-right-metrics-for-your-ml-models-87bf996d7c93?utm_source=chatgpt.com">Medium</a></li><li>Especially helpful in <strong>imbalanced datasets</strong>, where simply maximizing one metric (precision or recall) can be misleading. <a href="https://therised.medium.com/evaluation-metrics-for-classification-models-f27dfc276b87?utm_source=chatgpt.com">Medium</a></li></ul><h3>7. ROC Curve: Visualizing the Trade-Off</h3><ul><li><strong>ROC (Receiver Operating Characteristic) curve</strong> plots:</li><li><strong>True Positive Rate (TPR)</strong> = Recall</li><li><strong>False Positive Rate (FPR)</strong> = 1 − Specificity</li></ul><p>You plot TPR vs FPR for different threshold values.</p><ul><li>The <strong>AUC (Area Under the ROC curve)</strong> tells you how well your model <em>separates positives from negatives</em>. <a href="https://therised.medium.com/evaluation-metrics-for-classification-models-f27dfc276b87?utm_source=chatgpt.com">Medium</a></li><li>AUC = 1 → perfect separation</li><li>AUC = 0.5 → no better than random guessing</li></ul><h3>8. Which Metric Should You Use — Depends on the Problem</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FGXX8rQVH4DUy_E9GxpK3Q.png" /></figure><h3>9. Real-World Example</h3><p>Imagine you build a model to detect <strong>credit card fraud</strong>:</p><ul><li>There are very few fraud cases (positives).</li><li>If you maximize <strong>recall</strong>, you catch <strong>almost all fraud</strong>, but you might flag a lot of legitimate transactions (low precision).</li><li>If you maximize <strong>precision</strong>, you only flag a few transactions (but mostly correct), but you might miss many frauds (low recall).</li><li><strong>F1-score</strong> helps you pick a middle ground.</li><li><strong>ROC-AUC</strong> helps you compare different models or choose a decision threshold (how sensitive vs specific you want to be).</li></ul><h3>🔚 Conclusion</h3><ul><li>These metrics help you look <em>beyond accuracy</em>.</li><li>Depending on the use case, <strong>precision</strong>, <strong>recall</strong>, <strong>specificity</strong>, <strong>F1</strong>, and <strong>ROC-AUC</strong> each provide different lenses to view model performance.</li><li>Choosing the right metric depends on what types of mistakes are more costly in your domain: missing a positive case, or wrongly flagging a negative one.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cc9247c71494" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Machine Learning Hackathon]]></title>
            <link>https://medium.com/@anirudhsrinivas2001/machine-learning-hackathon-032d7f12fe78?source=rss-692a2f20e1c5------2</link>
            <guid isPermaLink="false">https://medium.com/p/032d7f12fe78</guid>
            <dc:creator><![CDATA[Anirudhsrinivas]]></dc:creator>
            <pubDate>Fri, 21 Nov 2025 16:34:07 GMT</pubDate>
            <atom:updated>2025-11-21T16:34:07.305Z</atom:updated>
            <content:encoded><![CDATA[<h3>🚖 Building a Taxi Fare / Trip-Distance Prediction Model: From Raw Data to Regression</h3><p><strong>Introduction</strong><br> In this project, I built a machine learning pipeline to predict taxi trip distance (in miles) using real-world NYC taxi data. The process involves <strong>data preprocessing</strong>, feature engineering, and comparing different regression models — Linear, Polynomial, Ridge, Lasso, and SGD. This article walks you through the steps I followed, why they matter, and how I evaluated each model.</p><h3>1. Data Preprocessing &amp; Feature Engineering</h3><h3>Loading and Cleaning</h3><ul><li>I started with a CSV dataset of taxi trips containing pickup/dropoff timestamps, latitudes/longitudes, passenger count, fare details, and more.</li><li>Converted the <strong>pickup</strong> and <strong>dropoff datetime</strong> columns to proper datetime types so I could derive meaningful time-based features.</li></ul><h3>Generating New Features</h3><p>From the raw data, I derived features that help the model understand the trip better:</p><ul><li><strong>Trip duration</strong>: computed as dropoff_datetime - pickup_datetime in seconds and minutes.</li><li><strong>Time features</strong>: pickup hour, day of week, and a binary flag for “weekend.”</li><li><strong>Distance metric</strong>: used the Haversine formula to compute the straight-line distance between pickup and dropoff points.</li><li><strong>Speed</strong>: average speed (miles per hour) = distance / duration.</li><li><strong>Fare-related ratios</strong>: tip fraction (tip_amount / fare_estimate), fare per mile, and a toll-flag (if tolls were paid).</li></ul><h3>2. Handling Multicollinearity</h3><ul><li>I computed the <strong>Variance Inflation Factor (VIF)</strong> for all numeric features to check multicollinearity.</li><li>Features like raw latitudes/longitudes, fare estimate, tip amount, total pay, and trip duration had very high or infinite VIF — meaning they were redundant or linearly dependent.</li><li>Based on this, I dropped some of them (e.g., tolls_amount, tip_amount, one of the duration columns) and kept derived but more interpretable features like Haversine distance and fare per mile.</li></ul><h3>3. Scaling and Polynomial Features</h3><ul><li><strong>Standard Scaling</strong>: I used StandardScaler to standardize features (mean = 0, std = 1), which is essential for models like Ridge, Lasso, and SGD.</li><li><strong>Polynomial Features</strong>: To capture non-linear relationships, I created polynomial features (degree 2), including interaction terms between features.</li></ul><h3>4. Training and Comparing Regression Models</h3><p>I trained and compared the following models:</p><ul><li><strong>Linear Regression</strong> — baseline model.</li><li><strong>Polynomial Regression (degree 2)</strong> — same linear model but on polynomial-transformed features.</li><li><strong>Ridge Regression</strong> — L2-regularized linear regression.</li><li><strong>Lasso Regression</strong> — L1-regularized linear regression.</li><li><strong>SGD Regressor</strong> — (linear) trained with stochastic gradient descent.</li></ul><p>For each model, I evaluated both <strong>train and test</strong> performance using <strong>RMSE</strong> and <strong>R²</strong>. This helps me understand overfitting, underfitting, and how well each model generalizes.</p><h3>5. Making Predictions on a Separate Test Dataset</h3><ul><li>I loaded a <em>separate test CSV</em> (without the target) and preprocessed it using the <em>same scaler and polynomial transformer</em> used during training (to avoid data leakage).</li><li>Then, I used each trained model to predict trip distance on this test data.</li><li>Predictions were clipped to non-negative values (since distance can’t be negative).</li><li>Finally, I created separate CSV output files for each model’s predictions — ready for submission / further analysis.</li></ul><h3>7. Next Steps / Opportunities for Improvement</h3><ul><li><strong>Hyperparameter tuning</strong>: Use cross-validation to find the best alpha for Ridge and Lasso, or the best learning rate for SGD.</li><li><strong>Feature selection / dimensionality reduction</strong>: Consider PCA on geographic variables instead of raw lat/lon or distance.</li><li><strong>More complex models</strong>: Try non-linear models like Random Forest, Gradient Boosting, or even neural networks.</li><li><strong>Time-based validation</strong>: For taxi data, time-series cross-validation might make sense (especially if trip patterns change over time).</li></ul><h3>Conclusion</h3><p>Building a solid regression model is not just about plugging data into an algorithm — <strong>preprocessing and feature engineering</strong> are equally, if not more, important. By cleaning data, carefully constructing features, controlling multicollinearity, and comparing different regression methods, you can build effective and robust predictive models.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=032d7f12fe78" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Demystifying Regression Metrics: How to Judge Your Model’s Accuracy-R Anirudh Srinivas]]></title>
            <link>https://medium.com/@anirudhsrinivas2001/demystifying-regression-metrics-how-to-judge-your-models-accuracy-r-anirudh-srinivas-bbe941be6101?source=rss-692a2f20e1c5------2</link>
            <guid isPermaLink="false">https://medium.com/p/bbe941be6101</guid>
            <dc:creator><![CDATA[Anirudhsrinivas]]></dc:creator>
            <pubDate>Sat, 01 Nov 2025 16:39:40 GMT</pubDate>
            <atom:updated>2025-11-01T16:39:40.368Z</atom:updated>
            <content:encoded><![CDATA[<p>When you build a regression model — one that predicts a continuous numerical outcome — you’re operating in the realm of <strong>supervised learning</strong>: you have input features and you have known target values, and your model learns to map from one to the other. In contrast, <strong>unsupervised learning</strong> deals with data that has no labelled outcomes and focuses on identifying patterns or structure rather than predicting a known target.<br> In supervised regression, evaluation is critical: you need to ask — how well are the predictions matching the actual values? Metrics serve as your objective yardsticks. In this article we will walk through the most widely used metrics — what they measure, how to interpret them, and the trade-offs involved.</p><h3>Why metrics matter</h3><p>Imagine you’ve trained a model that predicts the monthly sales of a product, or the temperature tomorrow, or the price of a house. You need to know: Are the predictions good enough? Which kinds of errors are happening (small ones, large ones)? And are you improving the model when you tweak it? That is where regression metrics come in — they quantify the gap between predictions and reality, offering a way to compare models, tune them, or spot weaknesses.</p><h3>The core metrics</h3><p>Here are four metrics that are used again and again in regression settings.</p><h4>Mean Absolute Error (MAE)</h4><p><strong>What it measures:</strong> The average of the absolute differences between predicted and actual values.<br> <strong>Formula:</strong></p><p>MAE=</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/713/0*kIbZAZ_i1hxmbCF6.png" /><figcaption>Formula for MAE</figcaption></figure><p><strong>Interpretation:</strong> On average, how far off (in the same units as the target) are the predictions?<br> <strong>When it’s useful:</strong> Because it treats all errors equally (just taking absolute value), it gives a straightforward measure of average prediction error and is relatively robust to outliers.<br> <strong>Trade-offs:</strong> It doesn’t distinguish between one error of, say, 100 units and two errors of 50 units each — they contribute the same total absolute error. So if large errors are especially costly in your application, MAE might under-reflect that.</p><h4>Mean Squared Error (MSE)</h4><p><strong>What it measures:</strong> The average of the <em>squared</em> differences between actual and predicted values.<br> <strong>Formula:</strong></p><p>MSE=</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/638/0*MMbM8ozBaYN3oLqy" /><figcaption>Formula for MSE</figcaption></figure><p><strong>Interpretation:</strong> Large errors get penalised more (because you square the difference) so MSE emphasises “big mistakes”.<br> <strong>When it’s useful:</strong> If you care a lot about reducing large deviations (for example, in safety-critical predictions) then MSE is a strong metric.<br> <strong>Trade-offs:</strong> The units are “(target units)²”, which makes interpretation harder. Also, it’s more sensitive to outliers, which can make the metric dominated by a few extreme errors. <a href="https://www.geeksforgeeks.org/machine-learning/regression-metrics/?utm_source=chatgpt.com">geeksforgeeks.org+1</a></p><h4>Root Mean Squared Error (RMSE)</h4><p><strong>What it measures:</strong> The square root of MSE.<br> <strong>Formula:</strong></p><p>RMSE=</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/656/0*x6e4r_3Hdy37g9WC.jpg" /><figcaption>Formula for RMSE</figcaption></figure><p><strong>Interpretation:</strong> Because you take the square root, it brings the error back into the same units as the target, making it more interpretable — but it still retains the penalty for large errors.<br> <strong>When it’s useful:</strong> Many practitioners prefer RMSE because its units are “the same as the target”. It gives a sense of “on average, I’m off by X units”.<br> <strong>Trade-offs:</strong> Still sensitive to large errors/outliers. RMSE &gt; MAE typically, when there are some large deviations. <a href="https://www.geeksforgeeks.org/regression-metrics/?utm_source=chatgpt.com">geeksforgeeks.org+1</a></p><h4>R-squared (Coefficient of Determination)</h4><p><strong>What it measures:</strong> The proportion of variance in the actual values that the model is able to explain/predict.<br> <strong>Formula (one common version):</strong></p><p>R2=</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/638/0*pThExlD9CybDU5oB.jpeg" /><figcaption>Formula for R² Coefficient</figcaption></figure><p><strong>Interpretation:</strong> If R² = 0.80, then 80% of the variance in the target values is “explained” by your model (and 20% remains unexplained). Higher is better (up to 1).<br> <strong>When it’s useful:</strong> It gives you a normalized measure (0–1) which can help compare across models/datasets.<br> <strong>Trade-offs:</strong> R² doesn’t tell you how big the errors are in absolute units — it’s about variance explained. Also it can be misleading if underlying assumptions are violated or when applied in non-linear or complex settings.</p><h3>Which metric should you choose?</h3><p>There’s no one-size-fits-all — your choice depends on your business/application priorities. A few guiding points:</p><ul><li>If you want a <em>simple average error</em> in the same units, MAE is a good choice.</li><li>If you want to penalise large mistakes (outliers) more heavily, go with MSE or RMSE.</li><li>If you need interpretability in the same units and still penalise large errors, RMSE is often a good compromise.</li><li>If you want a <em>relative measure</em> of goodness-of-fit (how much of the variation you are capturing), use R².</li><li>Consider scale: Metrics like MAE/MSE/RMSE are <strong>scale-dependent</strong> (you cannot easily compare across datasets with very different units or ranges).</li><li>Consider outliers and error distribution: If errors are heavily skewed (lots of big mistakes), MSE/RMSE will emphasise them more than MAE. <a href="https://www.datasciencebase.com/supervised-ml/advanced-metrics-classification-regression?utm_source=chatgpt.com">datasciencebase.com</a></li></ul><h3>Practical illustration</h3><p>Let’s say you predicted the number of units sold each day. Suppose for 3 days: you predicted [12, 17, 22] when actual values were [10, 18, 20].</p><ul><li>Absolute errors: |12 − 10| = 2, |17 − 18| = 1, |22 − 20| = 2 → sum = 5 → MAE≈ 5/3 ≈ 1.67</li><li>Squared errors: 4, 1, 4 → sum = 9 → MSE = 9/3 = 3 → RMSE = √3 ≈ 1.732</li><li>Here MAE (1.67) is slightly lower than RMSE (1.732) because RMSE penalises the 2‐unit errors a little more.</li><li>If the variance of actual sales is, say, 50 (just an example), then R² ≈ 1 − (9/50) = 0.82 → the model explains ~82% of variance.</li></ul><p>Such simple examples help anchor what the numbers mean in practice.</p><h3>Additional considerations &amp; pitfalls</h3><ul><li><strong>Scale matters:</strong> If your target variable ranges from 0 to 1000 in one dataset and 0 to 10 in another, a MAE of 10 means very different things. That’s why comparing raw error metrics across dissimilar tasks can be misleading.</li><li><strong>Outliers:</strong> If there are a few extreme errors, MSE/RMSE will blow up; MAE will be less sensitive.</li><li><strong>What is “good”?:</strong> The absolute value of error matters in context. RMSE = 100 might be fine if the target values are in thousands; terrible if they are in tens.</li><li><strong>Training vs testing:</strong> Always evaluate metrics on held-out/test data (not the data used to train) to get realistic performance.</li><li><strong>Optimisation vs evaluation:</strong> The metric you optimise during training (loss function) can differ from the metric you report for evaluation. Example: you may train by minimising MSE, but report MAE if business cares more about “average absolute error”.</li><li><strong>Don’t rely on one metric alone:</strong> It often makes sense to look at multiple metrics. For instance, if MAE is low but RMSE is much higher, that signals some large outliers are being missed.</li><li><strong>R² limitations:</strong> It assumes a linear model (in its classic form) and can give misleading results when assumptions are broken. Also a high R² doesn’t guarantee low prediction error in absolute terms — so always check absolute errors too.</li></ul><h3>Summary</h3><p>Regression metrics are your window into how well your model is performing.</p><ul><li>MAE gives you a robust sense of average error in the target’s units.</li><li>MSE and RMSE emphasise large errors and allow benchmarking penalised by severity.</li><li>R² gives you a normalized sense of “variance explained”.<br> Use them wisely: choose the metric(s) that align with what matters for your domain (business cost of error, outlier risk, interpretability). Always interpret the numbers <strong>in context</strong>, and remember: a “good” number is relative to the scale and business problem. With clear understanding and the right metric choices, you’ll be equipped to evaluate, compare and improve regression models effectively.</li></ul><h3>Thank You!!!</h3><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bbe941be6101" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>