How cashyo/email_classification_project works
This is an academic spam-message classification project. Its user-facing workflow accepts a message, cleans and vectorizes it, applies a selected trained classifier, and displays a spam/not-spam result with confidence. Separate workflows build a combined dataset, train Logistic Regression, Naive Bayes, and Random Forest variants, then compare and report their performance. The app and preprocessing/training paths are supported by sampled source; evaluation wiring is described by the README and tree, but its implementation was not sampled.
Main entry points: preprocessing.py Text preprocessing · streamlit_app.py Streamlit interface · build_unified_dataset.py Dataset builder · unified_spam_dataset.csv Unified dataset
Components 20
Datasets
- SMS dataset
data/spam.csv - Email dataset
data/spam_ham_dataset.csv - Dataset builder
analysis/build_unified_dataset.py - Unified dataset
data/unified_spam_dataset.csv
Model Training
- Text preprocessing
analysis/preprocessing.py - Logistic training
train/train_logreg.py - Unified logistic
train/train_logreg_unified.py - Naive Bayes training
train/train_nb_streamlit.py - Random Forest training
train/train_rf.py - Unified forest
train/train_rf_unified.py - Saved model artifacts
Live Classification
- Streamlit interface
app/streamlit_app.py - Selected classifier
- Prediction and confidence
Model Evaluation
- Model comparison
analysis/compare_models.py - Evaluation results
analysis/results - Comparison plots
analysis/generate_plots.py - PDF report
analysis/generate_pdf_report.py - Report artifacts
analysis/results
Other components
- Message user
Connections 30
- SMS dataset → Dataset builder: reads
- Email dataset → Dataset builder: reads
- Dataset builder → Text preprocessing: cleans with
- Dataset builder → Unified dataset: writes
- SMS dataset → Text preprocessing: loads via
- Email dataset → Text preprocessing: loads via
- Text preprocessing → Logistic training: provides data
- Text preprocessing → Naive Bayes training: provides data
- Text preprocessing → Random Forest training: provides data
- Logistic training → Saved model artifacts: saves
- Unified dataset → Unified logistic: reads
- Unified dataset → Unified forest: reads
- Unified logistic → Text preprocessing: cleans with
- Unified forest → Text preprocessing: cleans with
- Unified logistic → Saved model artifacts: saves
- Unified forest → Saved model artifacts: saves
- Naive Bayes training → Saved model artifacts: saves
- Random Forest training → Saved model artifacts: saves
- Message user → Streamlit interface: enters message
- Streamlit interface → Text preprocessing: cleans message
- Streamlit interface → Saved model artifacts: loads selection
- Streamlit interface → Selected classifier: vectorizes and predicts
- Saved model artifacts → Selected classifier: provides model
- Selected classifier → Prediction and confidence: returns prediction
- Streamlit interface → Prediction and confidence: displays
- Model comparison → Evaluation results: writes metrics
- Evaluation results → Comparison plots: provides metrics
- Comparison plots → PDF report: provides charts
- Evaluation results → PDF report: provides summary
- PDF report → Report artifacts: generates