Hey, I created a Fake News Prediction Model using Logistic Regression and various text preprocessing techniques like stemming, stopword removal, and TF-IDF vectorization.
This project is machine learning model that classifies news articles as Real (1) or Fake (0) based on their textual content.
- Python 3
- NumPy
- Pandas
- NLTK (Natural Language Toolkit)
- Scikit-learn (
sklearn)
-
Data Cleaning:
- Lowercasing
- Removing special characters & numbers
- Removing stopwords
- Stemming words (Porter Stemmer)
-
Feature Extraction:
- Used TF-IDF Vectorizer to convert text into numeric features.
-
Model Training:
- Used Logistic Regression for binary classification.
-
Model Evaluation:
- Calculated Accuracy Score on the test set.
The dataset contains columns like:
titletextlabelβ 0 for Fake, 1 for Real
-
Install dependencies:
pip install numpy pandas scikit-learn nltk
-
Run the Python script / notebook (
FakeNews.ipynb).
β Model Accuracy: Around 95.28%
- Try other models like SVM, Random Forest.
- Tune hyperparameters for better accuracy.
- Add API endpoints using Flask/FastAPI.
Rakshit Jain (@rakshitjain23)