<?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 Vijay M on Medium]]></title>
        <description><![CDATA[Stories by Vijay M on Medium]]></description>
        <link>https://medium.com/@penpencil.blr?source=rss-94da17a8562------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*e9D2bM0yvBf_FC-rHYLvTQ.jpeg</url>
            <title>Stories by Vijay M on Medium</title>
            <link>https://medium.com/@penpencil.blr?source=rss-94da17a8562------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 05 Dec 2026 06:31:25 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@penpencil.blr/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[Strategies for New Classes in Target Variable for multiclass problem]]></title>
            <link>https://medium.com/@penpencil.blr/strategies-for-new-classes-in-target-variable-for-multiclass-problem-c68b8e8a7c9d?source=rss-94da17a8562------2</link>
            <guid isPermaLink="false">https://medium.com/p/c68b8e8a7c9d</guid>
            <category><![CDATA[multiclass-classification]]></category>
            <category><![CDATA[new-classes]]></category>
            <dc:creator><![CDATA[Vijay M]]></dc:creator>
            <pubDate>Wed, 27 Sep 2023 09:29:38 GMT</pubDate>
            <atom:updated>2023-09-27T09:29:38.728Z</atom:updated>
            <content:encoded><![CDATA[<p>Handling new classes in the target label for a multiclass problem is a challenging task that requires careful consideration and appropriate strategies. New classes can emerge over time in various real-world applications, and your machine learning model should be capable of adapting to these changes. Here are some strategies to handle new classes in a multiclass problem:</p><h4>Retraining the Model:</h4><ul><li>When new classes are discovered, you can retrain your entire model using the updated dataset, including the new classes.</li><li>This approach allows the model to learn to classify the new classes from scratch.</li></ul><h4>Fine-Tuning:</h4><ul><li>If you have a pre-trained model, you can fine-tune it on the new data that includes the new classes.</li><li>Fine-tuning allows your model to adapt to the new classes while retaining knowledge from the original pre-training.</li></ul><h4>Transfer Learning:</h4><ul><li>If your model was initially trained on a related task or dataset, you can use transfer learning techniques.</li><li>Transfer learning involves adapting a pre-trained model to a new task or domain, leveraging the knowledge learned by the model on the original task.</li></ul><h4>One-vs-Rest (OvR) Classification:</h4><ul><li>OvR classification treats each class as a binary classification problem (class vs. not class).</li><li>When new classes emerge, you can add new binary classifiers for those classes without affecting the existing classifiers.</li></ul><h4>Incremental Learning:</h4><ul><li>Incremental learning techniques allow you to update your model with new classes without retraining on the entire dataset.</li><li>Methods like online learning or Elastic Weight Consolidation (EWC) can be useful for this purpose.</li></ul><h4>Ensemble Methods:</h4><ul><li>Combine predictions from multiple models, including the original model and new models trained specifically for the new classes.</li><li>Ensemble methods like stacking or bagging can be effective in this context.</li></ul><h4>Dynamic Vocabulary:</h4><ul><li>In text classification, if new classes represent new words or phrases, consider updating your vocabulary or word embeddings to include these new elements.</li></ul><h4>Thresholding:</h4><ul><li>Adjust decision thresholds for class predictions.</li><li>By setting lower thresholds for confidence scores, you can capture instances that might belong to new classes without making hard predictions.</li></ul><h4>Active Learning:</h4><ul><li>If you anticipate new classes emerging over time, employ active learning strategies to select and prioritize the most informative samples for annotation and model update.</li></ul><h4>Anomaly Detection:</h4><ul><li>Treat new classes as anomalies or outliers.</li><li>Build an anomaly detection model to identify these cases separately from the regular classes.</li></ul><p><em>It’s important to choose the most appropriate strategy based on your specific problem, data availability, and the frequency at which new classes are encountered. In some cases, a combination of these approaches may be the most effective way to handle the dynamic nature of multiclass classification problems. Additionally, monitoring and updating your model periodically can help ensure its performance remains robust in the face of evolving class distributions.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c68b8e8a7c9d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Data Imbalance: How is ADASYN different from SMOTE?]]></title>
            <link>https://medium.com/@penpencil.blr/data-imbalance-how-is-adasyn-different-from-smote-f4eba54867ab?source=rss-94da17a8562------2</link>
            <guid isPermaLink="false">https://medium.com/p/f4eba54867ab</guid>
            <category><![CDATA[data-imbalance]]></category>
            <dc:creator><![CDATA[Vijay M]]></dc:creator>
            <pubDate>Tue, 26 Sep 2023 06:42:14 GMT</pubDate>
            <atom:updated>2023-09-26T06:42:14.831Z</atom:updated>
            <content:encoded><![CDATA[<p>ADASYN (Adaptive Synthetic Sampling) and SMOTE (Synthetic Minority Over-sampling Technique) are both techniques used in the field of imbalanced class classification to address the problem of imbalanced datasets, where one class significantly outnumbers the other(s). While both ADASYN and SMOTE aim to balance the class distribution, they have some differences in their approaches:</p><h3>SMOTE (Synthetic Minority Over-sampling Technique):</h3><ol><li>Sampling Technique: SMOTE works by creating synthetic samples for the minority class. It does this by selecting a minority class instance and its k nearest neighbors. It then generates synthetic examples by interpolating between the selected instance and its neighbors.</li><li>Uniform Sampling: In SMOTE, the synthetic samples are generated uniformly across the feature space, meaning they are evenly spread out between the original minority class instances. This can sometimes lead to over-sampling in dense areas of the feature space.</li><li>Fixed Oversampling Ratio: SMOTE allows you to specify the desired oversampling ratio, which determines how many synthetic samples are generated for each original minority instance.</li></ol><h3>ADASYN (Adaptive Synthetic Sampling):</h3><ol><li>Adaptive Sampling: ADASYN takes a more adaptive approach. It focuses on the minority instances that are difficult to classify correctly, rather than oversampling all minority instances uniformly. It assigns a different weight to each minority instance based on its level of difficulty in classification.</li><li>More Emphasis on Hard-to-Classify Instances: ADASYN generates more synthetic samples for minority instances that are closer to the decision boundary, making it more likely to create synthetic samples in challenging areas of the feature space.</li><li>No Fixed Oversampling Ratio: Unlike SMOTE, ADASYN does not require you to specify a fixed oversampling ratio. It adapts the oversampling ratio based on the difficulty of classification for each instance.</li></ol><h3>SMOTE and ADASYN in four simple steps:</h3><p>Four steps in Algorithm:</p><h4>SMOTE</h4><ol><li>Selecting Data Points: SMOTE starts by selecting a minority class instance (let’s call it point A) from the dataset.</li><li>Selecting Nearest Neighbors: SMOTE then selects k nearest neighbors (data points from the minority class) of point A. The value of k is a user-defined parameter.</li><li>Generating Synthetic Samples: For each of the k nearest neighbors, SMOTE generates synthetic samples by linearly interpolating between point A and the selected neighbor. This is done using the following formula:</li></ol><p><em>For a specific neighbor B, SMOTE generates a synthetic sample C as follows:</em></p><p><em>C = A + lambda * (B — A)</em></p><p><em>where lambda is a random number between 0 and 1.</em></p><p>4. Repeat: Steps 1–3 are repeated for multiple minority class instances, creating a set of synthetic samples.</p><p>SMOTE helps balance the class distribution by creating synthetic instances near existing minority class instances, thus increasing the representation of the minority class in the dataset.</p><h4>ADASYN:</h4><p>ADASYN builds upon the concept of SMOTE but takes an adaptive approach to address the imbalance problem more effectively.</p><ol><li>Selecting Data Points: ADASYN starts by selecting a minority class instance (point A) from the dataset.</li><li>Calculating the Difficulty Ratio: ADASYN calculates a difficulty ratio for point A, which represents the imbalance level in the local neighborhood of the point. This is done by comparing the number of majority class instances (non-minority) to the number of minority class instances within a specified radius around point A.</li><li>Difficulty Ratio (DR) = (Number of Majority Class Neighbors) / (Number of Minority Class Neighbors)</li><li>Generating Synthetic Samples: ADASYN generates more synthetic samples for points with higher difficulty ratios. Points with higher DR values indicate that they are in regions where the imbalance is more severe. The number of synthetic samples generated for a point is proportional to its DR.</li><li>Repeat: Steps 1–3 are repeated for multiple minority class instances, creating synthetic samples.</li></ol><p><em>In summary, the main difference between ADASYN and SMOTE is in their approach to oversampling. SMOTE generates synthetic samples uniformly across the feature space, while ADASYN places more emphasis on generating synthetic samples in areas where the classification is difficult, thereby adapting the oversampling based on the dataset’s specific challenges. Depending on the nature of your dataset and the classification problem you’re addressing, one technique may work better than the other, or a combination of both may be beneficial.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f4eba54867ab" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What is the difference between Training Loss Validation Loss and Evaluation Loss]]></title>
            <link>https://medium.com/@penpencil.blr/what-is-the-difference-between-training-loss-validation-loss-and-evaluation-loss-c169ddeccd59?source=rss-94da17a8562------2</link>
            <guid isPermaLink="false">https://medium.com/p/c169ddeccd59</guid>
            <dc:creator><![CDATA[Vijay M]]></dc:creator>
            <pubDate>Tue, 26 Sep 2023 06:01:15 GMT</pubDate>
            <atom:updated>2023-09-26T06:17:04.318Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/706/1*zW3bSEd4-nZVbIbpA74GcQ.png" /></figure><p>In the context of machine learning, particularly in supervised learning, “training loss,” “validation loss,” and “evaluation loss” are terms used to describe different types of loss functions that are used during the training and evaluation of a model. Let’s define each term:</p><h3><strong>Training Loss:</strong></h3><ul><li>The training loss is a measure of how well a machine learning model is performing on the training data.</li><li>It is calculated during the training process and is used to update the model’s parameters through techniques like gradient descent to minimize this loss.</li><li>The training loss reflects how well the model is fitting the training data. It should decrease over time as the model learns from the data.</li><li>However, a very low training loss doesn’t necessarily mean the model will perform well on new, unseen data, as it may have overfit the training data.</li><li>In a classification problem, a common loss function is the cross-entropy loss (also known as log loss or logistic loss).</li><li>For a single data point (i), where the true label is denoted as y_i (0 or 1 for binary classification, or a one-hot encoded vector for multi-class classification) and the predicted probability of the positive class is denoted as p_i, the cross-entropy loss can be expressed as:</li></ul><blockquote>L_train(i) = -[y_i * log(p_i) + (1 — y_i) * log(1 — p_i)]</blockquote><ul><li>The training loss (L_train) is typically computed as the average of this loss over all training data points:</li></ul><blockquote>L_train = (1/N_train) * Σ L_train(i) for i in [1, N_train]</blockquote><h3>Validation Loss:</h3><ul><li>The validation loss is a measure of how well a machine learning model is performing on a separate dataset called the validation set.</li><li>During training, a portion of the data (not used for training) is set aside as the validation set.</li><li>The model’s performance on the validation set is evaluated periodically (after each epoch, for example), and the validation loss is calculated.</li><li>The validation loss helps assess how well the model generalizes to data it hasn’t seen during training.</li><li>It is used to monitor the model’s performance and to detect overfitting. If the validation loss starts increasing while the training loss is decreasing, it’s a sign of overfitting.</li><li>Similar to the training loss, the validation loss is computed using the cross-entropy loss function.</li><li>For each data point in the validation set, you calculate the loss in the same way as for the training data.</li><li>The validation loss (L_validation) is computed as the average of the losses over all validation data points:</li></ul><blockquote>L_validation = (1/N_validation) * Σ L_validation(i) for i in [1, N_validation]</blockquote><h3>Evaluation Loss (Test Loss)</h3><ul><li>The evaluation loss, sometimes referred to as the test loss, is a measure of the model’s performance on a completely separate dataset that it has never seen before, known as the test set.</li><li>The test set is used to provide an unbiased estimate of the model’s generalization performance.</li><li>After the model has been trained and its hyperparameters have been tuned based on the training and validation performance, it is evaluated on the test set to assess how well it will perform in real-world scenarios.</li><li>The evaluation loss on the test set helps determine the model’s readiness for deployment and provides an estimate of its expected performance on unseen data.</li><li>The evaluation loss, often referred to as the test loss, is calculated using the same loss function (cross-entropy) as the training and validation losses.</li><li>For each data point in the test set, you calculate the loss in the same way as for training and validation.</li><li>The evaluation loss (L_evaluation or L_test) is computed as the average of the losses over all test data points:</li></ul><blockquote>L_evaluation = (1/N_test) * Σ L_evaluation(i) for i in [1, N_test]</blockquote><p><em>In summary, training loss is used to optimize the model’s parameters during training, validation loss helps monitor the model’s performance during training and detect overfitting, and evaluation loss on the test set provides an unbiased estimate of the model’s generalization performance on unseen data. It’s crucial to keep these different types of losses separate to ensure that the model’s performance is accurately assessed and that it can make good predictions on new, real-world data.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c169ddeccd59" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>