Giter Club home page Giter Club logo

articles-analysis's Introduction

Articles Analysis

Predictive analysis of a dataset containing news articles from 2015 to 2018, related to business and sports, sourced from Kaggle. The primary objective of this project was to compare the performance of various machine learning methods using a simple bag-of-words approach for classification.

Features:

  • Word Analysis: Provides an analysis of the most frequent words in the dataset for both news types (Business and Sports).
  • Predictive Analysis: Compared the performance of several machine learning models, including K Nearest Neighbors (KNN), Logistic Regression (LR), Forward-Feed Neural Networks (FNN), and Multinomial Naive Bayes (MNB), on the task of predicting the type of news article (Business or Sports) based on its content.

Technical Details:

  • Programming Language: Python
  • Data Cleaning: Regular expressions and pandas
  • Machine learning: Scikit-learn
  • Visualization: Matplotlib and Seaborn

Kaggle Dataset: https://www.kaggle.com/datasets/asad1m9a9h6mood/news-articles

Instructions to Run Code

Demo

Video Instructions to Run Code

This code requires python3.6.

  1. Clone the repository: git clone https://github.com/asad1996172/Articles-Analysis
  2. Create a conda environment: conda create -n articles python=3.6
  3. Activate the environment: conda activate articles
  4. Install the requirements:pip install -r requirements.txt
  5. Run the code: python3 main_code.py

Discussion and Results

First, I did some word analysis on the different News Types. There are two News Types in this dataset i.e., Business and Sports. Following are the top 20 words with respect to frequency along with their number of occurences.

Business Words

Sports Words

Intersection of these two sets contains very less words so intuitively classification accuracies are expected to be high. Following are the models we use for comparison

  1. K Nearest Neighbors (KNN)
  2. Logistic Regression (LR)
  3. Forward-Feed Neural Networks (FNN)
  4. Multinomial Naive Bayes (MNB)

I used the 80-20 train test split. Following are the accuracies for different models on the 20% test set.

Classifier Accuracy
KNN (k=3) 94.06%
LR 99.44%
FNN 99.07%
MNB 99.63%

As evident from the table, the best performing model among these is Multinomial Naive Bayes.

articles-analysis's People

Contributors

asad1996172 avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.