<?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 Amruthjithraj V.R on Medium]]></title>
        <description><![CDATA[Stories by Amruthjithraj V.R on Medium]]></description>
        <link>https://medium.com/@amruthjithraj11?source=rss-6eb1b140c39a------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*-fy7KBUop93CY62pELyD3A.jpeg</url>
            <title>Stories by Amruthjithraj V.R on Medium</title>
            <link>https://medium.com/@amruthjithraj11?source=rss-6eb1b140c39a------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 02:50:09 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@amruthjithraj11/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[Comparing Word Embeddings for Text Classification: Word2Vec vs. GloVe vs. FastText]]></title>
            <link>https://medium.com/@amruthjithraj11/comparing-word-embeddings-for-text-classification-word2vec-vs-glove-vs-fasttext-be58c30ac898?source=rss-6eb1b140c39a------2</link>
            <guid isPermaLink="false">https://medium.com/p/be58c30ac898</guid>
            <category><![CDATA[embedding]]></category>
            <category><![CDATA[data-preprocessing]]></category>
            <category><![CDATA[algorithms]]></category>
            <category><![CDATA[nlp]]></category>
            <category><![CDATA[classification]]></category>
            <dc:creator><![CDATA[Amruthjithraj V.R]]></dc:creator>
            <pubDate>Tue, 10 Sep 2024 21:01:15 GMT</pubDate>
            <atom:updated>2025-07-04T15:41:37.059Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/844/1*KUi_sGsEcWs-rC2kKrwdOw.jpeg" /></figure><p>In the world of Natural Language Processing (NLP), word embeddings have transformed how we work with text data. They help us convert text into vectors, making it easier for machine-learning models to understand language. But with so many embedding techniques out there, how do you know which one to use?</p><p>Today, we’re going to compare three of the most widely used word embedding techniques: <strong>Word2Vec</strong>, <strong>GloVe</strong>, and <strong>FastText</strong>. By the end of this post, you’ll have a better understanding of each method’s strengths, weaknesses, and when to use them for your text classification projects.</p><p><strong>What Are Word Embeddings?</strong></p><p>Word embeddings are dense vector representations of words. Unlike traditional methods like Bag of Words or TF-IDF, embeddings capture semantic relationships between words. For example, in a good embedding space, “king” might be close to “queen,” and “man” might be close to “woman.” These vectors help machine learning models capture the contextual meaning of words, improving their ability to process text data.</p><p>Let’s dive into each of these popular embedding methods and see how they differ.</p><ol><li><strong>Word2Vec: Learning Relationships from Context</strong></li></ol><p>Developed by Google, <strong>Word2Vec</strong> represents words in a continuous vector space. It uses a shallow neural network to predict word relationships based on their context, learning from either a <strong>Skip-Gram</strong> or <strong>Continuous Bag of Words (CBOW)</strong> approach.</p><p>• <strong>Skip-Gram</strong> predicts the context words given a target word, focusing on capturing the meaning of rare words.</p><p>• <strong>CBOW</strong> predicts a target word based on its surrounding context, typically faster but better suited for frequent words.</p><p><strong>Strengths:</strong></p><p>• Captures both <strong>semantic</strong> and <strong>syntactic</strong> relationships.</p><p>• Works well with medium-sized datasets.</p><p><strong>Weaknesses:</strong></p><p>• <strong>Word2Vec</strong> cannot handle out-of-vocabulary (OOV) words, meaning words not seen during training have no vectors.</p><p>• Words are treated as single entities, which can miss morphological nuances (e.g., “running” vs. “run”).</p><p><strong>When to Use:</strong></p><p>Word2Vec is a good choice when you have a relatively large corpus and want to capture rich semantic relationships between words. It works well in many NLP tasks, such as sentiment analysis or topic classification, where understanding word meaning based on context is essential.</p><p><strong>2. GloVe: Global Co-occurrence for Better Generalization</strong></p><p><strong>GloVe</strong> (Global Vectors for Word Representation) was developed by researchers at Stanford. Unlike Word2Vec, GloVe doesn’t rely on local context but instead leverages global word co-occurrence statistics across the entire corpus. It builds a word-word co-occurrence matrix and then factorizes it to generate embeddings.</p><p><strong>Strengths:</strong></p><p>• Captures global relationships between words, which can make it more robust in smaller datasets.</p><p>• Generates embeddings that work well across different domains, especially for generalized tasks.</p><p><strong>Weaknesses:</strong></p><p>• Like Word2Vec, it struggles with OOV words.</p><p>• GloVe training requires more computational resources due to the large co-occurrence matrix.</p><p><strong>When to Use:</strong></p><p>GloVe is excellent for tasks where capturing global word relationships is crucial, such as document similarity or when dealing with domain-specific data. It performs well when you have a smaller corpus or when you need embeddings pre-trained on large datasets (e.g., Wikipedia).</p><p><strong>3. FastText: Handling Subword Information</strong></p><p>Developed by Facebook, <strong>FastText</strong> extends Word2Vec by taking into account subword information. Instead of treating each word as a single entity, FastText breaks words down into n-grams (subword units). This allows it to generate embeddings for words not seen during training by combining the n-grams that make up the word.</p><p><strong>Strengths:</strong></p><p>• Handles OOV words by generating embeddings based on subword components.</p><p>• Better performance for morphologically rich languages (e.g., German, Finnish).</p><p><strong>Weaknesses:</strong></p><p>• FastText can generate noisier embeddings because subword information might not always reflect meaning (e.g., “apple” and “applesauce”).</p><p>• Slower training compared to Word2Vec due to the increased number of parameters from subword information.</p><p><strong>When to Use:</strong></p><p>FastText shines in tasks where you need to handle OOV words or work with languages with complex morphology. It’s especially useful in text classification tasks where you might encounter variations of the same word or need to work with domain-specific terms.</p><p><strong>Comparing Word Embeddings: Which One Should You Use?</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FkmsQJdUDjYVS9AYMdO7kQ.png" /></figure><p><strong>Conclusion</strong></p><p>Choosing the right word embedding depends on your task, dataset, and specific needs. If you’re dealing with a large, diverse corpus and want to capture complex semantic relationships, <strong>Word2Vec</strong> is a solid choice. <strong>GloVe</strong> is better suited for general-purpose embeddings where global context is essential, and <strong>FastText</strong> is your go-to when handling OOV words or working with highly inflected languages.</p><p>Each embedding technique has its unique strengths, so it’s worth experimenting with different methods to see which one works best for your project. Hopefully, this comparison has given you a clearer idea of when to use Word2Vec, GloVe, or FastText for your text classification needs.</p><p>I hope you learned something new! Please consider following for more such blogs!</p><p>“Transformer models revolutionized text summarization tasks. In fact, I’ve used these very techniques to build <strong>Crux</strong>, an app delivering personalized, bite-sized news summaries. If that interests you, feel free to <a href="https://cruxnews.io/">join our waitlist!</a>”</p><p>Cheers!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=be58c30ac898" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Evaluating Machine Learning Models: A Comprehensive Guide]]></title>
            <link>https://medium.com/@amruthjithraj11/evaluating-machine-learning-models-a-comprehensive-guide-a4a4ad019b1a?source=rss-6eb1b140c39a------2</link>
            <guid isPermaLink="false">https://medium.com/p/a4a4ad019b1a</guid>
            <category><![CDATA[classification]]></category>
            <category><![CDATA[data]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[evaluation]]></category>
            <category><![CDATA[data-science]]></category>
            <dc:creator><![CDATA[Amruthjithraj V.R]]></dc:creator>
            <pubDate>Fri, 21 Apr 2023 16:15:12 GMT</pubDate>
            <atom:updated>2025-07-04T15:44:08.865Z</atom:updated>
            <content:encoded><![CDATA[<p>Machine learning models are incredibly useful in a wide range of applications, from image recognition to natural language processing. However, building a model is only half the battle; evaluating the model’s performance is equally important. In this blog, we will take a comprehensive look at various evaluation metrics used to assess the performance of machine learning models.</p><ol><li>Classification Metrics:</li></ol><p>Classification is the task of predicting a categorical label for a given input. It can be a binary or multi-class classification problem. Some of the commonly used metrics for classification are:</p><ul><li>Accuracy: This metric calculates the proportion of correctly predicted instances over the total number of instances.</li></ul><pre>accuracy = (TP + TN) / (TP + TN + FP + FN)</pre><p>where TP, TN, FP, and FN are the number of true positives, true negatives, false positives, and false negatives, respectively.</p><ul><li>Precision: This metric calculates the proportion of true positive predictions over the total number of positive predictions.</li></ul><pre>precision = TP / (TP + FP)</pre><p>Recall: This metric calculates the proportion of true positive predictions over the total number of actual positives.</p><pre>recall = TP / (TP + FN)</pre><p>F1 Score: This metric is the harmonic mean of precision and recall.</p><pre>f1_score = 2 * (precision * recall) / (precision + recall)</pre><p>2. Regression Metrics:</p><p>Regression is the task of predicting a continuous output for a given input. Some of the commonly used metrics for regression are:</p><ul><li>Mean Squared Error (MSE): This metric calculates the average squared difference between the predicted and actual values.</li></ul><pre>MSE = 1/n * sum((y_pred - y_actual)^2)</pre><p>where n is the number of instances in the dataset.</p><ul><li>Root Mean Squared Error (RMSE): This metric is the square root of MSE.</li></ul><pre>RMSE = sqrt(MSE)</pre><ul><li>Mean Absolute Error (MAE): This metric calculates the average absolute difference between the predicted and actual values.</li></ul><pre>MAE = 1/n * sum(abs(y_pred - y_actual))</pre><ol><li>Clustering Metrics:</li></ol><p>Clustering is the task of grouping similar instances together. Some of the commonly used metrics for clustering are:</p><ul><li>Silhouette Score: This metric measures how well each instance fits into its assigned cluster, as compared to other clusters. The silhouette score ranges from -1 to 1, where a higher score indicates better clustering.</li><li>Calinski-Harabasz Index: This metric calculates the ratio of the between-cluster variance to the within-cluster variance. A higher score indicates better clustering.</li></ul><ol><li>Time Series Metrics:</li></ol><p>Time series models are used to predict a continuous value over time. Some of the commonly used metrics for time series are:</p><ul><li>Mean Absolute Scaled Error (MASE): This metric measures the accuracy of a model by comparing it to a naive forecast.</li></ul><pre>MASE = mean(abs(y_actual - y_pred)) / mean(abs(y_actual - y_naive))</pre><p>where y_naive is the naive forecast, which is the value of the previous time step.</p><ul><li>Mean Absolute Percentage Error (MAPE): This metric calculates the average percentage difference between the predicted and actual values.</li></ul><pre>MAPE = 100/n * sum(abs((y_actual - y_pred) / y_actual))</pre><p>where n is the number of instances in the dataset.</p><p>In conclusion, evaluating machine learning models is a critical step in the model-building process. There are various metrics available to assess the performance of a model, and the choice of metric depends on the problem at hand. By understanding the different evaluation metrics and their applications, you can choose the most appropriate metric for your model and make</p><p>Thank you for reading; Please consider flowing for more such blogs!</p><p>“Transformer models revolutionized text summarization tasks. In fact, I’ve used these very techniques to build <strong>Crux</strong>, an app delivering personalized, bite-sized news summaries. If that interests you, feel free to <a href="https://cruxnews.io/">join our waitlist!</a>”</p><p>Hope you learned something new!</p><p>Cheers!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a4a4ad019b1a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The best feature selection technique for text classification]]></title>
            <link>https://medium.com/analytics-vidhya/the-best-feature-selection-technique-for-text-classification-23199b4a4f8d?source=rss-6eb1b140c39a------2</link>
            <guid isPermaLink="false">https://medium.com/p/23199b4a4f8d</guid>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[code]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[nlp]]></category>
            <category><![CDATA[naturallanguageprocessing]]></category>
            <dc:creator><![CDATA[Amruthjithraj V.R]]></dc:creator>
            <pubDate>Wed, 14 Oct 2020 11:50:43 GMT</pubDate>
            <atom:updated>2025-07-04T15:44:58.173Z</atom:updated>
            <content:encoded><![CDATA[<h3>Chi-Square Feature Selection for Text Classification: A Practical Guide Using Python and Sklearn</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/420/1*ovZyCBxExPCN-XgHR43XKw.jpeg" /></figure><p>Before we jump into the code let&#39;s first understand a few things about feature selection</p><ol><li>What is Feature selection?</li></ol><p><strong>Feature selection</strong> is the process of reducing the number of input variables when developing a predictive model. It is desirable to reduce the number of input variables to both reduce the computational cost of modeling and, in some cases, to improve the performance of the model.</p><p>2. How does feature selection work?</p><p><strong>Feature Selection</strong> is the process where you automatically or manually <strong>select</strong> those <strong>features</strong> which contribute most to your prediction <strong>variable</strong> or output in which you are interested in. Having irrelevant <strong>features</strong> in your data can decrease the accuracy of the models and make your model learn based on irrelevant <strong>features</strong>.</p><p>3. Importance of feature selection in text classification.</p><p>Feature selection is one of the most important steps in the field of text classification. As text data mostly have high dimensionality problems. To reduce the curse of high dimensionality, feature selection techniques are used. The basic idea behind feature selection is to keep only important features and remove less contributing features.</p><p>Issues associated with high dimensionality are as follows:</p><p>1. Adds unnecessary noise to the model</p><p>2. High space and time complexity</p><p>3. Overfitting</p><p>The feature selection technique we will talk about today is the Chi-Square feature selection.</p><p>The Chi-square test is used in statistics to test the independence of two events. More specifically in feature selection, we use it to test whether the occurrence of a specific term and the occurrence of a specific class are independent.</p><p>Without any further ado, let&#39;s jump into the code</p><pre># Load libraries</pre><pre>from sklearn.feature_selection import SelectKBest</pre><pre>from sklearn.feature_selection import chi2</pre><pre># N features with highest chi-squared statistics are selected</pre><pre>chi2_features = SelectKBest(chi2, k = can be any number)</pre><pre>X = chi2_features.fit_transform(X, y)</pre><p>The first two lines of the code are just importing the packages needed for the chi-square feature selection. SelectKBest function is used for selecting the K number of top features based on the Chi-square score. K can be any number depending on the number of features you are dealing with.</p><p>For example, if you have 50,000 features(columns) after creating a bag of words. In such a case, you should try keeping the K value from 40,000 to 10,000 and check which value gives the best results. Once you find the optimal number that gives the best accuracy you can finally set it as the default K value.</p><p>This article is for people who are starting with NLP and are stuck with the question of which feature selection technique to use and how to implement it. Feature selection for text cleaning can be a headache in most cases. This code can help you with the most basic feature selection techniques for text cleaning and can be used straight away.</p><p>Thank you for reading; Please consider following for more such blogs!</p><p>“Transformer models revolutionized text summarization tasks. In fact, I’ve used these very techniques to build <strong>Crux</strong>, an app delivering personalized, bite-sized news summaries. If that interests you, feel free to <a href="https://cruxnews.io/">join our waitlist!</a>”</p><p>I hope you learned something new!</p><p>Cheers.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=23199b4a4f8d" width="1" height="1" alt=""><hr><p><a href="https://medium.com/analytics-vidhya/the-best-feature-selection-technique-for-text-classification-23199b4a4f8d">The best feature selection technique for text classification</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[A Simple yet effective way of text cleaning using NLTK]]></title>
            <link>https://medium.com/analytics-vidhya/a-simple-yet-effective-way-of-text-cleaning-using-nltk-4f90a8ff21d4?source=rss-6eb1b140c39a------2</link>
            <guid isPermaLink="false">https://medium.com/p/4f90a8ff21d4</guid>
            <category><![CDATA[python]]></category>
            <category><![CDATA[nlp]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[text-mining]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <dc:creator><![CDATA[Amruthjithraj V.R]]></dc:creator>
            <pubDate>Thu, 04 Jun 2020 16:08:22 GMT</pubDate>
            <atom:updated>2025-07-04T15:45:40.364Z</atom:updated>
            <content:encoded><![CDATA[<h3>Comprehensive Guide to Text Cleaning in Python: Effective NLP Preprocessing with NLTK</h3><p><em>A simple code for text cleaning!</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gRNu1wGJ-67SOS6yryQu0A.jpeg" /></figure><ol><li><strong>Text Cleaning and its Importance:</strong></li></ol><p>Once the data has been acquired, it needs to be cleaned. Mostly, the data will contain duplicate entries, errors, or be inconsistent.Data pre-processing is an important step before applying any machine learning model. Same with the text data, before applying any machine learning model on text data, it requires data pre-processing. The pre-processing of text means cleaning of noise such as: removing stop words, punctuation, terms which doesn’t carry much weightage in context to the text, etc. In this article, we describe in detail how to pre-process text data for machine learning algorithms using Python(NLTK).</p><p><em>Without any further ado let’s dive into the code</em></p><p>2. <strong>Importing Important Libraries:</strong></p><pre>import re</pre><pre>import nltk</pre><pre>from nltk.corpus import stopwords</pre><pre>from nltk.stem import WordNetLemmatizer</pre><pre>nltk.download(&#39;stopwords&#39;)</pre><pre>nltk.download(&#39;wordnet&#39;)</pre><p>3.<strong> Using For loop for implementing all the text cleaning techniques in one go</strong></p><pre>corpus = []</pre><pre>text_data = &quot;&quot;</pre><pre>for i in range(0, 1732(Number of rows)):</pre><pre>text_data = re.sub(&#39;[^a-zA-Z]&#39;, &#39; &#39;, Raw_Data[&#39;Column_With_Text&#39;][i])</pre><pre>text_data = text_data.lower()</pre><pre>text_data = text_data.split()</pre><pre>wl = WordNetLemmatizer()</pre><pre>text_data = [wl.lemmatize(word) for word in text_data if not word in set(stopwords.words(&#39;english&#39;))]</pre><pre>text_data = &#39; &#39;.join(text_data)</pre><pre>corpus.append(text_data)</pre><p><strong><em>4. Now let’s see what the for loop actually does</em></strong></p><p>4.1. In the first step it will remove all terms other than English words. This step is essential because other terms in text data like special character and numbers can add noise to the data, which can adversely affect the performance of the machine learning model. A regular expression is used in this step to remove all non-English terms.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xnUCqE_G7HbuVHOB0kLPoA.png" /></figure><p>4.2. In the second step it will normalize the text data. normalizing the text is an essential step as this reduces the problem of dimensionality in the model. If the text is not normalized, it will lead to the problem of data duplication. For normalizing the text Lower () function in python is used. This function converts all the words into lower cases, which solves the problem.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/579/1*XI3UrlNUaRccyxtVIO86Jg.png" /></figure><p>4.3. In the third step it will lemetize the words. lemmatizing word is an essential step as this eliminated the problem of data duplications. Words with similar meaning such as work, working, and worked has the same meaning, but this will be considered as three different words while creating a bag of words model. WordNetLemmatizer package of NLTK library is used to tackle this problem. This package brings back any given words to its original form.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/638/1*6QLtwfT7HVDg6t8qNL_n0g.png" /></figure><p>4.4. In the fourth step it will remove all the stop words. Removing stop words is an essential step because stop words add dimensionality to the model; this additional dimensionality affects the performance of the model. Stopword package in the NLTK library is used for removing stop words. All the text in the corpus is compared to the list of stop words, and if any word matches with the stop words list, it is then removed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/546/1*DFjozbJlaSEyGix83SrlpA.png" /></figure><p>This article is for people who are starting with NLP and are stuck with text cleaning. Text cleaning can be a headache in most cases. This code can help you with the most basic text-cleaning techniques and can be used straight away.</p><p>Thank you for reading; Please consider following for more such blogs!</p><p>“Transformer models revolutionized text summarization tasks. In fact, I’ve used these very techniques to build <strong>Crux</strong>, an app delivering personalized, bite-sized news summaries. If that interests you, feel free to <a href="https://cruxnews.io/">join our waitlist!</a>”</p><p>I hope you learned something new!</p><p>Cheers.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4f90a8ff21d4" width="1" height="1" alt=""><hr><p><a href="https://medium.com/analytics-vidhya/a-simple-yet-effective-way-of-text-cleaning-using-nltk-4f90a8ff21d4">A Simple yet effective way of text cleaning using NLTK</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>