<?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 Srishti Chandra on Medium]]></title>
        <description><![CDATA[Stories by Srishti Chandra on Medium]]></description>
        <link>https://medium.com/@srishtichandra2009?source=rss-5956fe8111bf------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*mT4TV6DcQRDtou3I</url>
            <title>Stories by Srishti Chandra on Medium</title>
            <link>https://medium.com/@srishtichandra2009?source=rss-5956fe8111bf------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 15:57:51 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@srishtichandra2009/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[Reinforcement Learning: Applications and Future Trends]]></title>
            <link>https://medium.com/@srishtichandra2009/reinforcement-learning-applications-and-future-trends-3eec286f8cc2?source=rss-5956fe8111bf------2</link>
            <guid isPermaLink="false">https://medium.com/p/3eec286f8cc2</guid>
            <category><![CDATA[drl]]></category>
            <category><![CDATA[deep-learning]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[reinforcement-learning]]></category>
            <dc:creator><![CDATA[Srishti Chandra]]></dc:creator>
            <pubDate>Thu, 27 Jun 2024 13:32:50 GMT</pubDate>
            <atom:updated>2024-06-27T14:47:28.809Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CG7D89jSLHNI0-sJ2ECRFw.jpeg" /></figure><h3>Introduction</h3><p>Reinforcement learning has become more popular than any other machine, as a result of its capacity to initialize systems by trial and error learning technique. Reinforcement Learning (RL) steps into the Machine Learning front row due to its capability of demonstrating how systems make decisions through experience. Agents can make the right choices following interaction with their surroundings through reward or punishment which ensures that they always find the best actions. This article talks about the latest advancements in Reinforcement learning, its applications across various industries, and the future trends that are shaping its evolution.</p><h3>Recent Advancements in Reinforcement Learning</h3><ol><li><strong><em>Deep Reinforcement Learning (DRL): </em></strong>Combining deep neural networks with RL algorithms, DRL takes advantage of their strength which makes it better at handling inputs of images and sound that are more complex. For example, recall AlphaGo beating the world’s human champions. Also, think about how OpenAI-powered bots are dominating the latest technologies, all these are made possible by DRL.</li><li><strong><em>Improved Exploration Strategies: </em></strong>Modern advancements help RL agents explore the environments more deeply and effectively. For example, PPO (Proximal Policy Optimization) and SAC (Soft Actor-Critic) are the techniques that enable RL agents to learn quickly and with fewer attempts.</li><li><strong><em>Transfer Learning and Meta-Learning: </em></strong>RL models now can transfer knowledge acquired in one task to another, which makes them even more versatile. This is where meta-learning comes in handy, enabling RL agents to quickly adapt to completely new tasks, especially if those tasks are in dynamic environments.</li><li><strong><em>Multi-Agent Reinforcement Learning (MARL</em>): </strong>Multiple RL agents learning and interacting with each other in the same space are enabled by MARL, suitable for autonomous driving and robot collaborations. With new algorithms, it is easier to handle multiple agent’s complexities.</li></ol><h3><strong>Applications of Reinforcement Learning</strong></h3><ol><li><strong><em>Finance: </em></strong>RL creates trading strategies that can adjust instantly to shifts in the market. It assists in the improved forecasting and reduction of financial risks.</li><li><strong><em>Healthcare: </em></strong>RL uses data and outcomes from patients to generate individualized treatment protocols. RL enhances precision and adaptability in surgery by enabling robots.</li><li><strong><em>Autonomous Systems: O</em></strong>ne of the best ways to teach self-driving cars how to navigate complicated surroundings and enable them to make instant choices is Reinforcement Learning. Drones and Robots use Reinforcement Learning (RL) to accomplish tasks and navigate autonomously.</li><li><strong><em>Manufacturing and Industrial Automation: </em></strong>RL is used to optimize manufacturing processes through continuous learning and adjustment to improve efficiency. Furthermore, predictive maintenance which enables industrial equipment to predict failures and schedule maintenance, is important in reducing downtime.</li></ol><h3><strong>Future Trends</strong></h3><ol><li><strong><em>Hybrid Models: </em></strong>Future AI systems may combine supervised, and unsupervised learning algorithms together with reinforcement learning which may lead to greater flexible model generation.</li><li><strong><em>Real-World Deployment: </em></strong>Hardware and algorithm improvements will help in deploying RL models to real-world applications ranging from smart cities to environmental sustainability.</li><li><strong><em>Interdisciplinary Research: </em></strong>To make RL faster and more adaptive in the future, researchers need to work together from different fields including psychology, and neuroscience among others for better solutions.</li></ol><p>And there are many more….</p><h3>Conclusion</h3><p>Reinforcement Learning is changing AI in a big way, with new developments that continue to grow its abilities. RL is reshaping various sectors from health care as well as the financial markets through autonomous systems among many others into ones where there exist opportunities for growth as well as the establishment of intelligent agents who have the capacity for self-adaptation. In order to unlock the complete potential of reinforcement learning, it will be necessary to integrate ethical considerations, hybrid models, and interdisciplinary research as the field progresses.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3eec286f8cc2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Exploring the Potential of Neural Networks for Image Classification with CIFAR-10]]></title>
            <link>https://medium.com/@srishtichandra2009/exploring-the-potential-of-neural-networks-for-image-classification-with-cifar-10-127dccc5347b?source=rss-5956fe8111bf------2</link>
            <guid isPermaLink="false">https://medium.com/p/127dccc5347b</guid>
            <category><![CDATA[machine-learning-ai]]></category>
            <category><![CDATA[image-recognition]]></category>
            <category><![CDATA[convolutional-neural-net]]></category>
            <category><![CDATA[artificial-neural-network]]></category>
            <category><![CDATA[image-classification]]></category>
            <dc:creator><![CDATA[Srishti Chandra]]></dc:creator>
            <pubDate>Tue, 05 Dec 2023 15:14:18 GMT</pubDate>
            <atom:updated>2023-12-05T16:06:01.152Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/607/1*Gfsb74VpAjbJc3a1pmmazA.png" /></figure><h3><strong>Introduction</strong></h3><p>Get ready to embark on an exhilarating exploration into the heart of machine learning’s dynamic landscape! Unraveling the secrets of precise image classification, I recently immersed myself in the captivating realm of TensorFlow. In this blog post, we’ll embark on a thrilling journey — from loading datasets to crafting and training both a fundamental Artificial Neural Network (ANN) and an advanced Convolutional Neural Network (CNN). Brace yourself for a rollercoaster ride through the intricacies of cutting-edge technology, where each line of code propels us closer to mastery in picture classification. Let the excitement unfold! 🚀</p><h3>Understanding the Data</h3><p>We have used TensorFlow to load and evaluate the CIFAR-10 dataset as the first step in our exploration. This dataset is a useful tool for picture classification problems because it includes 50,000 32x32 color images from 10 different classes i.e. Aircraft, cars, trucks, ships, frogs, dogs, cats, deer, and birds are among the classes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/644/1*tS8_w5Dau6V7zwhooHnLTQ.png" /></figure><p>Then followed by checking the shape of the dataset, followed by reshaping the training labels for compatibility with the machine learning models to be constructed later. In addition, we create a list of classes that correspond to the following kinds of images: [“bird”, “automobile”, “dog”, “frog”, “horse”, “ship”, “truck”, “airplane”, “cat”, “deer”, “boat”], and so on. Understanding and displaying the outcomes of our picture categorization models will be made easier with the help of these classes.</p><h3><strong>Data Preprocessing</strong></h3><p>Preprocessing is done on the data before we start building the model. To improve the neural network’s performance, this entails normalizing the pixel values to a range between 0 and 1.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/396/1*iI0PwsXXjYsBW8DN6XPbOg.png" /></figure><h3>Building the Models</h3><h4>1. Artificial Neural Network (ANN)</h4><p>The first model is a straightforward ANN consisting of three layers, serving as a baseline for comparison with the more complex CNN.</p><p>This neural network takes the flattened input images and consists of several densely connected layers.</p><p>Rectified Linear Unit (ReLU) has been used as an activation function for hidden layers, and a softmax activation has been used for the output layer to obtain class probabilities.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OLj5e04tTEIuaAEcUN9NFg.png" /><figcaption>Code Snippet for ANN Model</figcaption></figure><h4>2. Convolutional Neural Network (CNN)</h4><p>The second model is a CNN, a more sophisticated architecture well-suited for image classification tasks, comprising convolutional and pooling layers.</p><p>This is a highly effective algorithm for image data.</p><p>Convolutional layers extract features from images and Pooling layers reduce dimensions while retaining important information.</p><p>After extraction data is fully flattened and passed through fully connected layers for classification.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OLj5e04tTEIuaAEcUN9NFg.png" /><figcaption>Code Snippet for CNN Model</figcaption></figure><h3>Evaluation and Results</h3><p>The performance of both models is evaluated after they have been trained. In image classification tasks, the CNN outperforms the simpler ANN due to its ability to capture spatial hierarchies.</p><p>A thorough classification report also offers information on each class’s F1-score, recall, and precision.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/400/1*LMMFJlC27A3OgPweJwVYLw.png" /><figcaption>ANN Classification Report</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/384/1*R5KHlVoYJZWoNyIc6zyMCg.png" /><figcaption>CNN Classification Report</figcaption></figure><h3>Conclusion</h3><p>We observed the sophisticated performance of the Convolutional Neural Network (CNN) and the Artificial Neural Network (ANN) in this investigation of image classification. These models, each with their advantages, serve as a basis for further work. The knowledge gained from this project helps us explore the vast field of machine learning and discover the seemingly endless possibilities that lie ahead.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=127dccc5347b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Applying Machine Learning to the Analysis of Fuel Emissions]]></title>
            <link>https://medium.com/@srishtichandra2009/applying-machine-learning-to-the-analysis-of-fuel-emissions-199e7b3f4095?source=rss-5956fe8111bf------2</link>
            <guid isPermaLink="false">https://medium.com/p/199e7b3f4095</guid>
            <category><![CDATA[regression-analysis]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[fuel-emission]]></category>
            <category><![CDATA[co2-emissions]]></category>
            <category><![CDATA[environmental-issues]]></category>
            <dc:creator><![CDATA[Srishti Chandra]]></dc:creator>
            <pubDate>Mon, 10 Jul 2023 08:11:34 GMT</pubDate>
            <atom:updated>2023-07-10T10:29:02.444Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*u74zFjPkkyuZbBo26OZs7A.jpeg" /></figure><p>Welcome to my blog, where I express my interest for applying machine learning to identify long-term solutions to environmental problems. Today, I’d want to discuss one of the most pressing issues of our time: gasoline emissions. As you may be aware, fuel emissions are a significant source of glasshouse gases that contribute to climate change and air pollution. But what can we do to cut them down? How can we choose the greatest automobile models for our requirements and the environment? To address these concerns, I will use machine learning to analyse and estimate CO2 emissions from various automobiles based on engine size, cylinder count, and fuel use. Machine learning is a powerful technique for uncovering hidden patterns and insights in data. In this project, I will demonstrate how to utilize machine learning to investigate a dataset including statistics on fuel consumption and CO2 emissions for several automobile models. We will learn how to create and assess machine learning models that can anticipate and explain CO2 emissions from various cars. Are you ready to go on this amazing journey with me? Let’s get this party started!</p><h3>Dataset Overview</h3><p>We begin by importing the dataset, which contains information on the fuel consumption and CO2 emissions of several autos. The dataset includes information such as engine size, cylinder count, total fuel consumption, and CO2 emissions. Let’s look at the first few rows of the dataset.</p><p>For this example, let’s get the “Fuel Emission” dataset from the UCI Machine Learning Repository.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*W7ip41ObhBn8Q3KTVEgdWg.png" /><figcaption>First Five rows</figcaption></figure><p>The dataset has 13 columns and 1067 rows. For our study, we will focus on the ‘ENGINESIZE’, ‘CYLINDERS’, ‘FUELCONSUMPTION_COMB’, and ‘CO2EMISSIONS’ columns.</p><p>Before we begin creating machine learning models, let’s do some exploratory data analysis to better understand how the variables relate to one another. We’ll use a range of visualisations to help us understand the data better.</p><h3>Exploratory Data Analysis</h3><p>Let’s undertake some exploratory data analysis to better understand how the variables relate to one another before getting started on developing machine learning models. To better understand the data, we’ll employ a variety of visualizations.</p><h4>Histograms</h4><p>We can plot histograms to visualize the distribution of the variables. The histograms for “CYLINDERS,” “ENGINESIZE,” “CO2EMISSIONS,” and “FUELCONSUMPTION_COMB” should be shown:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/375/1*Ui70zrEPpHnb8EALuKUixA.png" /><figcaption>Histogram</figcaption></figure><p>The distribution of each variable is depicted visually via the histograms. For each attribute, we can see its frequency and value range.</p><h4>Scatter Plots</h4><p>Using scatter plots, let’s now investigate the connections between “CO2EMISSIONS” and the other variables. For “FUELCONSUMPTION_COMB vs. CO2EMISSIONS”, “ENGINESIZE vs. CO2EMISSIONS”, and “CYLINDERS vs. CO2EMISSIONS”, we’ll make scatter plots.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/447/1*y7ALC2ew81ywR7rv-kjvhQ.png" /><figcaption>FUELCONSUMPTION_COMB vs. CO2EMISSIONS</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/401/1*3kYJhj8EE2BfX_APyUx4Zg.png" /><figcaption>ENGINESIZE vs. CO2EMISSIONS</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/395/1*ScI4E9cWKIIHXmJgi_lKXg.png" /><figcaption>CYLINDERS vs. CO2EMISSIONS</figcaption></figure><p>We can see the links between the variables and spot any trends or patterns with the aid of the scatter plots. We can see how varied engine sizes, cylinder counts, and fuel consumption levels affect CO2 emissions.</p><h3>Building Regression Models</h3><p>Let’s now create regression models to forecast CO2 emissions based on the features that are already accessible. We’ll begin by looking at a simple linear regression model before moving on to multiple linear regression and polynomial regression models.</p><h3>Data Preparation</h3><p>Let’s first prepare our data before beginning the model training process. Our dataset will be divided into training and testing sets, with 70% of the data used to train the model and the remaining 30% used to evaluate its effectiveness.</p><p>Now, we can proceed with model training.</p><h4>Simple Linear Regression</h4><p>To train our model, we’ll use the scikit-learn library’s linear regression approach. The input (engine size) and output (fuel emissions) variables are assumed to have a linear relationship by the linear regression model.</p><h4>Model Training</h4><p>Using the ‘ENGINESIZE’ characteristic to estimate CO2 emissions, we’ll first train a simple linear regression model.</p><p>By fitting a line that most accurately depicts the correlation between engine size and fuel emissions, the model is trained. The coefficients show how the fuel emissions vary with an increase in engine size as the slope of the line. The line’s intersection with the y-axis is indicated by the intercept.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/386/1*LRjYN042LUIaRu22Qgz93A.png" /></figure><p><strong>Model Evaluation</strong></p><p>Using the testing data, we will compute a number of measures, including mean absolute error (MAE), mean squared error (MSE), and the R-squared score, to assess the effectiveness of our trained model.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/233/1*j_v7OBAiFTyCUcaHGi8mdQ.png" /><figcaption>Output</figcaption></figure><p>The mean absolute difference between the anticipated fuel emissions and the actual values is represented by the mean absolute error (MAE). The average of the squared differences between the expected and actual values is measured by the mean squared error (MSE). The R-squared score shows the percentage of the target variable’s variance that the model can account for.</p><h4>Multiple Linear Regression Model</h4><p>We will examine how multiple linear regression can be used to forecast fuel emissions. In order to forecast the goal variable, which is the CO2 emissions, multiple linear regression takes into account a number of input variables, including the number of cylinders, engine size, and fuel consumption.</p><h4>Model Training</h4><p>We’ll employ the scikit-learn library’s LinearRegression technique to train the multiple linear regression model.</p><p>We will be considering the ‘CYLINDERS’, ‘ENGINESIZE’, and ‘FUELCONSUMPTION_COMB’ features.</p><p>We take the target variable (‘CO2EMISSIONS’) and the input features (‘CYLINDERS’, ‘ENGINESIZE’, and ‘FUELCONSUMPTION_COMB’) from the training dataset and turn them into NumPy arrays. We establish a linear regression class instance and fit the model to the training set of data. Estimating the coefficients (weights) necessary to reduce the total squared deviation between the expected and actual target values is required.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/426/1*w3vEcmaO0ZDvZ3EuJsrB0Q.png" /></figure><h4>Model Evaluation</h4><p>We will evaluate the effectiveness of our multiple linear regression model using a number of metrics, such as the residual sum of squares (RSS) and the variance score, also referred to as the R-squared score.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/248/1*mNLtNvabiv2XLzSKr0h5Iw.png" /></figure><p>The evaluation of the model using metrics such as the residual sum of squares (RSS) and the variance score provides insights into the accuracy and performance of the multiple linear regression model. A lower RSS and a higher variance score indicate better predictive performance and a better fit for the data.</p><h4>Polynomial Linear Regression Model</h4><p>We’ll investigate polynomial regression as a different strategy for forecasting fuel emissions. We can identify non-linear correlations between the input variable (engine size) and the goal variable (fuel emissions) using polynomial regression. We’ll make use of the LinearRegression class from the sklearn.linear_model module and the PolynomialFeatures class from the sklearn.preprocessing module.</p><p>The input features will be transformed using polynomial terms to capture the non-linear relationship. Here, a second-degree polynomial will be used as an example:</p><p><strong>poly = PolynomialFeatures(degree=2) train_x_poly = poly.fit_transform(train_x)</strong></p><p>The PolynomialFeatures class takes the powers and interactions of the original features to produce a new set of features. In this instance, the engine size original feature (ENGINESIZE), its square, and the interaction term between the original feature and its square are all produced as new features via the degree=2 parameter.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/158/1*kcqi9v8sR26Ebr_OPizC2Q.png" /><figcaption>Output</figcaption></figure><h4>Model Training</h4><p>Next, we will train the polynomial regression model using the transformed training data.</p><p><strong>clf = linear_model.LinearRegression()<br>train_y_ = clf.fit(train_x_poly, train_y)</strong></p><p>The modified training data (train_x_poly) and matching target variable (train_y) are used to fit the linear regression model.</p><p><strong>Model Visualisation</strong></p><p>We can plot the regression curve on a scatter plot to show the polynomial regression model:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/527/1*_jTPqdwLgRJV6WVcLzowoQ.png" /></figure><p>In the scatter plot, engine sizes (ENGINESIZE) are plotted against actual fuel emissions levels (CO2EMISSIONS). By reflecting the non-linear relationship, the polynomial equation’s representation of the regression curve demonstrates how the model accurately fits the data.</p><p><strong>Model Evaluation</strong></p><p>We can evaluate the performance of the polynomial regression model using various metrics, including mean absolute error (MAE), residual sum of squared error (RSS), and accuracy (R-squared score)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/296/1*vFuFJ6fCOHz8TDFSRznYJg.png" /></figure><p>The MAE calculates the average absolute difference between the calculated fuel emissions and the actual emissions. The average squared difference between the expected and actual values is measured by the RSS. The R-squared value, which stands for accuracy, shows how much of the variation in fuel emissions is explained by the model.</p><h3>Conclusion</h3><p>Using machine learning techniques, we examined a dataset on fuel usage and CO2 emissions for this research. The data was examined using histograms and scatter plots, correlations between the variables were found, and regression models were created to forecast CO2 emissions.</p><p>Understanding the connections between engine size and CO2 emissions was made possible by the linear regression models. Additional parameters like cylinder count and fuel consumption were added to the multiple linear regression model to enhance predictions. Finally, nonlinear relationships were included in the polynomial regression model, enabling more precise predictions.</p><p>We can learn important lessons and create models by using machine learning to analyze fuel emission data, which will help the automobile sector adopt more environmentally friendly practices.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=199e7b3f4095" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Fake News Classification Using Machine Learning]]></title>
            <link>https://medium.com/@srishtichandra2009/fake-news-classification-using-machine-learning-15b8980c94d3?source=rss-5956fe8111bf------2</link>
            <guid isPermaLink="false">https://medium.com/p/15b8980c94d3</guid>
            <category><![CDATA[decision-tree-algorithm]]></category>
            <category><![CDATA[news-classification]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[ml-algorithm]]></category>
            <category><![CDATA[logistic-regression]]></category>
            <dc:creator><![CDATA[Srishti Chandra]]></dc:creator>
            <pubDate>Thu, 13 Apr 2023 19:34:22 GMT</pubDate>
            <atom:updated>2023-04-14T05:38:33.716Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*URm5GcOlwu-9vtzeaGWDCA.jpeg" /></figure><p>In today&#39;s digital world, the introduction of social media platforms has had a huge impact on how news and information are communicated. People no longer rely only on reliable news sources for accurate and reliable information. Fake news has emerged as a serious concern in our information society, with far-reaching repercussions that might undermine public trust in the media, incite conflict, and influence critical decisions. The enormity of this problem has become evident to me, and I&#39;ve decided to contribute to its resolution by developing a categorization system that can consistently identify fake news. In this post, we will look at the challenges that false news is causing in today&#39;s digital environment, as well as the technical complexities of designing a classification algorithm to combat this chronic problem and maintain the integrity of news and information in our communities.</p><p>One of the most troubling aspects of fake news is its harmful impact on the trust of legitimate news sources. News organizations have always been considered as credible and held to high standards of truth and journalistic integrity. However, as fake news spreads on social media, the public&#39;s capacity to discriminate between trustworthy news and disinformation has deteriorated. Because of the speed and scope of social media, it is particularly prone to the rapid dissemination of false news, which is often done without adequate fact-checking or verification. This might lead to misinformation spreading and reaching a broad audience before it can be addressed, resulting in public misinformation and poor decision-making.<br>Fake news has the potential to exacerbate societal division and political strife while also weakening trust in the media. False information that supports people&#39;s pre-existing beliefs or sentiments has the potential to further polarize society, making informed and productive discussions about vital issues more difficult. Furthermore, as we witnessed during the COVID-19 outbreak with the spread of misinformation about the virus and immunizations, false news may have serious consequences, including influencing elections, public policy decisions, and even public health outcomes. It may also destroy people&#39;s and organizations’ reputations, causing societal ambiguity and mistrust.<br>To counteract the spread of fake news, individuals must critically analyse the content they encounter on social media and other internet sources. Before spreading news reports, it is necessary to double-check and confirm them. Furthermore, social media platforms, news organizations, and governments must take a proactive approach to detecting and combatting fake news. This includes bolstering trustworthy sources, increasing algorithmic detection of disinformation, and instituting regulations to restrict the spread of false information.</p><p>I decided to come up with a fake news classification project because I was concerned about the prevalence of fake news in today’s media landscape, and wanted to contribute to efforts to combat it. Also I am interested in the technical challenges of developing a classification model using Machine Learning algorithms that could accurately identify fake news.</p><p><strong><em>Expected Solution:</em></strong></p><p>In this project, I applied Machine learning concepts to predict whether the news is Fake or True.</p><p><strong><em>Objective:</em></strong></p><p>Training model which can determine whether the news is True or Fake.</p><p><strong><em>Steps:</em></strong></p><h3><strong>IMPORTING DATASETS</strong></h3><ol><li>Import important libraries that are required. I used pandas, numpy, train_test_split, and classification_report from sklearn, re, and string.</li></ol><p>2. Import all 2 datasets news from UCI Machine Learning Repository. One for training the model, and another for testing the model.</p><h3><strong>Data Analysis/ Visualisation</strong></h3><p>Started with displaying the first few 10 records of the Fake News Dataset and did the same with the True News dataset.</p><p>Then checked the size of the Fake News Dataset and True News Dataset.</p><p>Now, I had inserted a column ‘ class’ as a target feature.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/161/1*1nskcTIpvmshyx2qckBkCg.png" /><figcaption>Target column</figcaption></figure><p>Then, the last 10 rows for manual testing were removed from the Fake News Dataset and also from the True Dataset using the drop() function where the axis is 0 and inplace is True. And merged both datasets.</p><p>Now, I had removed/dropped all those columns which are not required for further training.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/432/1*w32Zjh-VhgBdDf1UFvwclw.png" /><figcaption>Dropped columns</figcaption></figure><p>Then to check whether there is any null value present in the dataset I used to the info() function to display the complete information of the merged dataset and found that no null value is present in the Dataset.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/297/1*wxm2QwbTYaAUNW97NMQruQ.png" /><figcaption>Information of the dataset</figcaption></figure><p>Used the sample() function for random shuffling.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/632/1*NPCtENMrW-rnttMkd0oS9g.png" /><figcaption>Random Shuffling</figcaption></figure><p>Here, in the above picture, we can see the random shuffling has been successfully implemented and class 0 represents the Fake Dataset and class 1 represents the True Dataset.</p><p>Now, as I had deleted a few columns above so I am left with two columns i.e. ‘text’ and ‘class’.</p><p>I had created a function to process the text and all the special characters gets removed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/477/1*f4yqNHZVckt8n1UinyQvCQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/377/1*vb6YI_XL8T4TeSpgKlOpMg.png" /></figure><p>Now, defined x as the independent variable and y as the dependent variable for training purposes where,</p><p>x= df[‘text’]</p><p>y=df[‘class’]</p><h3>Train- Test Split</h3><p>Splitted the dataset in 75:25 ratio where the model will be trained on 75% of the dataset and then the rest 25% will be used for testing the model.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/497/1*qLJCdMF37XryOcZ8ei9gvQ.png" /></figure><p>Then converted the text in vector form using the library TfidfVectorizer</p><p>imported from sklearn.feature_extraction.text.</p><h3><strong>Training the Model</strong></h3><p>I had trained the model using Logistic Regression and Decision Tree Classification.</p><ol><li><em>Logistic Regression</em></li></ol><p>This is a classification algorithm for categorical values. It is a statistical and machine learning technique and is analogous to linear regression but tries to predict a discrete field.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/210/1*fLxXjn9KodHcBU8NZQou-A.png" /><figcaption>Model Training</figcaption></figure><p>So, here I had imported LogisticRegression from the library sklearn.linear_model. And used the fit() function to train the model and then predicted the accuracy using the function predict()</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/212/1*6NcLLw7QncxBxZKxu4saSw.png" /><figcaption>Accuracy</figcaption></figure><p>The accuracy of the model is pretty good i.e. 98.707% .</p><p>The classification report for the model is a performance evaluation metric that gives good precision, recall, F1 Score, and support of your trained classification model.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/377/1*atVsdrZ_FQQ3_5Vet3A7FA.png" /><figcaption>Classification Report of Logistic Regression</figcaption></figure><p>2. <em>Decision Tree Classification</em></p><p>It is known to be the simplest binary classifier which maps out all possible decision paths in the form tree. It test the attributes and branches all the cases based on the result of test.</p><p>For this, I had to import DecisionTreeClassifier from the library sklearn.tree. And used the fit() function to train the model.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/372/1*0TNvVhs6MbIXDFzaLAPaEg.png" /><figcaption>Model Training</figcaption></figure><p>Then checked the accuracy of the trained model and found it to be better than Logistic Regression.</p><p>The accuracy of the Decision Tree Model is 99.5% .</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/212/1*YYnzB7QYi40O5k8-79v96w.png" /><figcaption>Accuracy</figcaption></figure><p>The classification report also outputs a better result as shown below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/377/1*QifPMTMvrtgWGBsEkExa0A.png" /></figure><h3><strong>Summary</strong></h3><p>In conclusion, using Machine Learning for news categorization has shown potential in combating the pervasive problem of false news. The project&#39;s use of Logistic Regression and Decision Tree Classification models, as well as data analysis and visualization, revealed the promise of employing technology to reliably classify news as genuine or false. However, the impact of false news extends beyond disinformation to have a negative influence on trust, polarization, and decision-making in our society.</p><p>Individuals, social media platforms, news organizations, and governments must all work together to fight false news as we navigate the digital era and the ubiquitous impact of social media. We can protect the importance of truth in our communities and contribute to a better informed and trustworthy information environment by safeguarding the integrity of news and information. We can make a difference by working together to combat false news and promote ethical information transmission.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=15b8980c94d3" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>