PassGuard is a machine learning notebook project for classifying password strength from text patterns. It uses a labeled password dataset, character-level TF-IDF features, and compares Logistic Regression, AdaBoost, and XGBoost models.
| Path | Description |
|---|---|
main.ipynb |
Data loading, preprocessing, visualization, model training, cross-validation, and evaluation. |
data.csv |
Password dataset with password and strength columns. |
verify_project.py |
Lightweight reproducibility check for the dataset/vectorizer/model pipeline. |
notebook-requirements.txt |
Python dependencies for running the notebook and verification script. |
index.html, style.css, script.js |
Static public showcase page for GitHub/Vercel. |
The notebook loads data.csv with pd.read_csv("data.csv", on_bad_lines="skip").
- Loaded rows:
669,640 - Clean rows after dropping one null password:
669,639 - Labels:
0weak,1medium,2strong - Class counts:
0:89,7011:496,8012:83,137
- Load and clean the password dataset.
- Tokenize each password at the character level.
- Convert passwords into TF-IDF feature vectors.
- Split the dataset into training and test sets.
- Compare Logistic Regression, AdaBoost, and XGBoost.
- Evaluate with accuracy, precision, recall, F1 score, cross-validation, and confusion matrices.
| Model | Holdout Accuracy | Weighted Precision | Weighted Recall | Weighted F1 |
|---|---|---|---|---|
| Logistic Regression | 0.8197 |
0.8028 |
0.8197 |
0.8026 |
| AdaBoost | 0.8320 |
0.8314 |
0.8320 |
0.7911 |
| XGBoost | 0.9805 |
0.9804 |
0.9805 |
0.9804 |
The strongest recorded model in the notebook is XGBoost, with about 98.05% holdout accuracy.
This project was completed as part of the Machine Learning course at UNICA, Università degli Studi di Cagliari.
python3 -m venv .venv
source .venv/bin/activate
pip install -r notebook-requirements.txtRun the quick verification script:
python verify_project.pyRun on the full dataset:
python verify_project.py --fullOpen the notebook:
jupyter notebook main.ipynbThe static showcase page is served from index.html, so Vercel can use the repository root as the project root.
For local preview:
python3 -m http.server 8000Then open http://localhost:8000.