This repository was created for a senior project in ENGT 375 Applied Machine Learning at Old Dominion University. It is provided for educational and research demonstration purposes only. It is not intended for production use, security filtering, or making real-world spam/phishing decisions. Always use established security tools for operational email protection.
1import joblib
2from utils import preprocess_text, compute_metadata_features
3
4model = joblib.load("voting_model.joblib")
5tfidf = joblib.load("tfidf_vectorizer.joblib")
6scaler = joblib.load("meta_scaler.joblib")
7threshold = joblib.load("optimal_threshold.joblib")
8
9email = "Congratulations! You've won a free iPhone!"
10text_features = tfidf.transform([preprocess_text(email)])
11meta_features = scaler.transform([compute_metadata_features(email)])
12features = hstack([text_features, csr_matrix(meta_features)])
13
14proba = model.predict_proba(features)[0][1]
15label = "SPAM" if proba >= threshold else "HAM"
1@misc{voltagevagabond2026spamgradio,
2 title={Spam Email Classifier — sklearn Voting Ensemble (Gradio)},
3 author={VoltageVagabond},
4 year={2026},
5 howpublished={\url{https://huggingface.co/VoltageVagabond/spam-classifier-gradio-model}},
6 note={ENGT 375 — Applied Machine Learning, Old Dominion University, Spring 2026}
7}