Skip to content

A machine learning project that performs sentiment analysis on Twitter data using Logistic Regression in Python. The model classifies tweets as Positive, Negative, or Neutral based on their text content.

Notifications You must be signed in to change notification settings

karlos-2k/sentimental-analysis

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Machine learning project

🐦 Twitter Sentiment Analysis using Logistic Regression

This project performs sentiment analysis on tweets using a Logistic Regression classifier. It classifies tweets into Positive, Negative, or Neutral sentiments based on their text content.

The model is trained using Python in Google Colab, and saved as a .sav file using pickle.


📁 Project Structure

📊 Dataset

The project uses a labeled Twitter dataset containing tweets and their corresponding sentiment classes. Preprocessing steps include:

  • Lowercasing text
  • Removing URLs, mentions, and punctuation
  • Removing stopwords
  • Tokenization and vectorization using TfidfVectorizer

⚙️ Model

  • Algorithm: Logistic Regression (scikit-learn)
  • Features: TF-IDF vectors from tweet text
  • Target Labels: Positive, Negative, Neutral

Core Dependencies

  • NumPy: For numerical computing and array operations
  • Pandas: For data manipulation and analysis
  • Scikit-learn: For machine learning and statistical modeling

Installation

  1. Clone the repository
  2. Install the required dependencies:
pip install -r requirements.txt

Requirements

  • Python 3.8+
  • See requirements.txt for specific package versions

Getting Started

import numpy as np
import pandas as pd
from sklearn import model_selection

About

A machine learning project that performs sentiment analysis on Twitter data using Logistic Regression in Python. The model classifies tweets as Positive, Negative, or Neutral based on their text content.

Topics

Resources

Stars

Watchers

Forks