email-spam-detection

Gmail Spam Detection with Logistic Regression

This repository provides a user-friendly web application built with Streamlit to predict whether an email is spam or not. It leverages a pre-trained machine learning model for classification.

Features

Requirements

Installing Required Libraries:

Open a terminal or command prompt and run the following command:

pip install streamlit joblib scikit-learn numpy

Usage

  1. Clone the Repository:

    Use Git to clone this repository to your local machine:

    git clone https://github.com/Shreesh-Sree/Email_spam_detection.git
    
  2. Navigate to the Project Directory:

    Use the cd command to change directories:

    cd Email_spam_detection
    
  3. Ensure Model Files Exist (Optional):

    The app relies on pre-trained model files (model.pkl and vectorizer.pkl) located in the same directory as the app.py script. These files are crucial for the app to function. If you don’t have them, you’ll need to train your own model (see the “Model Training” section below).

  4. Run the Streamlit App:

    In your terminal within the project directory, execute the following command to launch the app:

    streamlit run app.py
    

This will open the web app in your default web browser, usually at http://localhost:8501.

Using the Web App:

Model Training (Optional)

If you want to train a custom model using your own email data, here’s a basic example using scikit-learn:

Understanding the Code (Optional):

Important Note: This code snippet serves as a basic example. Training a robust model requires careful data preparation, feature engineering, and hyperparameter tuning for optimal performance.

Contributing

I welcome contributions to this project! Feel free to fork the repository, make changes, and submit a pull request.

License

This project is licensed under the MIT License. See the LICENSE file for details.