Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

6 Commits
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ”– Fake News Prediction Model

Hey, I created a Fake News Prediction Model using Logistic Regression and various text preprocessing techniques like stemming, stopword removal, and TF-IDF vectorization.


πŸš€ Project Overview

This project is machine learning model that classifies news articles as Real (1) or Fake (0) based on their textual content.


πŸ”§ Technologies Used

  • Python 3
  • NumPy
  • Pandas
  • NLTK (Natural Language Toolkit)
  • Scikit-learn (sklearn)

πŸ› οΈ Machine Learning Pipeline

  1. Data Cleaning:

    • Lowercasing
    • Removing special characters & numbers
    • Removing stopwords
    • Stemming words (Porter Stemmer)
  2. Feature Extraction:

    • Used TF-IDF Vectorizer to convert text into numeric features.
  3. Model Training:

    • Used Logistic Regression for binary classification.
  4. Model Evaluation:

    • Calculated Accuracy Score on the test set.

πŸ“ Dataset

The dataset contains columns like:

  • title
  • text
  • label β†’ 0 for Fake, 1 for Real

🏁 How to Run

  1. Install dependencies:

    pip install numpy pandas scikit-learn nltk
  2. Run the Python script / notebook (FakeNews.ipynb).


πŸ“Š Example Accuracy

βœ… Model Accuracy: Around 95.28%


πŸ€– Future Improvements

  • Try other models like SVM, Random Forest.
  • Tune hyperparameters for better accuracy.
  • Add API endpoints using Flask/FastAPI.

πŸ“Œ Author

Rakshit Jain (@rakshitjain23)

About

A project for predicting fake or real news using logistic regression.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages