# ankit152/password-strength-classifier architecture

> Architecture diagram of the GitHub repository ankit152/password-strength-classifier, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-04-02). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/ankit152/password-strength-classifier
- Repository: https://github.com/ankit152/password-strength-classifier

## Overview

##### Project Type and Purpose
- This project is a machine learning-based classifier that predicts the strength of a password.
- Its purpose is to demonstrate how feature engineering and an MLP classifier (from sklearn) can be applied to determine whether a password is weak, medium, or strong.
- The project uses Jupyter notebooks for exploration (EDA) and model training, while saving the resulting model and scaler artifacts.

##### Analyzing the File Structure
- Top-level Files:
- .gitignore & LICENSE: Standard files for version control and licensing.
- README.md: Provides a detailed explanation, dataset source, algorithm description, and visualizations.
- model.ipynb: Likely contains the core model building, training, and evaluation code.
- passwordEDA.ipynb: Contains exploratory data analysis and feature engineering steps.
- Directories:
- asset: Contains the pre-trained model (model.pkl) and scaler (scaler.pkl) which are used for subsequent predictions.
- img: Contains various images and plots for visualizing data distributions, feature statistics, confusion matrix, and overall model performance.

##### Main Components
a. Data Source & Ingestion:
- External Dataset: Indicated with Kaggle dataset link.
- Data retrieved may go directly into the EDA phase.
b. Exploratory Data Analysis (EDA) & Feature Engineering:
- This component corresponding to passwordEDA.ipynb where data cleaning, visualization (e.g., value counts, length, capital letters, digits, etc.), and feature extraction is performed.
c. Model Training & Evaluation:
- Process outlined in model.ipynb where the MLP Classifier is built (with two hidden layers each having 16 nodes and ReLU activation).
d. Artifact Saving & Persistence:
- Saving of the trained model and scaler in the asset folder (model.pkl and scaler.pkl).
e. Visualization / Reporting:
- Creation and later use (or viewing) of various plotted images in the img folder for analysis and reports.

##### Relationships and Interactions
- Flow starts at Data Ingestion from the external dataset.
- Data flows into the EDA & Feature Engineering stage where visualizations are generated.
- The prepared/processed data then enters the Model Training stage, where the classification algorithm (MLP Classifier) is trained.
- After evaluation, the ML model and the scaler are saved to the asset folder.
- The outputs (plots, confusion matrix images) feed back into the analysis, which is documented in README.md.

##### Architectural Patterns & Design Principles
- This is a stand-alone ML pipeline (a simplified, linear data-processing pipeline).
- There is a clear separation between data preparation (EDA) and model training.
- Persistence of artifacts is used, enabling a decoupled inference stage in a production or deployment scenario.

- Optionally, indicate points where external validation occurs (i.e., evaluation metrics like the confusion matrix).

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% External Data Source
    ext["Kaggle Dataset"]:::external

    %% EDA & Feature Engineering
    eda["Exploratory Data Analysis & Feature Engineering"]:::process

    %% Model Training & Evaluation
    training["Model Training & Evaluation"]:::process

    %% Artifact Persistence Subgraph
    subgraph "Artifact Persistence"
        modelArtifact["Trained Model"]:::artifact
        scalerArtifact["Scaler"]:::artifact
    end

    %% Visualization & Reporting
    visualization["Visualization & Reporting"]:::viz

    %% Documentation
    documentation["Project Documentation"]:::doc

    %% Connections
    ext -->|"raw_data"| eda
    eda -->|"processed_features"| training
    training -->|"save_model"| modelArtifact
    training -->|"save_scaler"| scalerArtifact
    eda -->|"plots"| visualization
    training -->|"evaluation_metrics"| visualization
    visualization -->|"report_insights"| documentation

    %% Click Events
    click eda "https://github.com/ankit152/password-strength-classifier/blob/main/passwordEDA.ipynb"
    click training "https://github.com/ankit152/password-strength-classifier/blob/main/model.ipynb"
    click modelArtifact "https://github.com/ankit152/password-strength-classifier/blob/main/asset/model.pkl"
    click scalerArtifact "https://github.com/ankit152/password-strength-classifier/blob/main/asset/scaler.pkl"
    click visualization "https://github.com/ankit152/password-strength-classifier/tree/main/img/"
    click documentation "https://github.com/ankit152/password-strength-classifier/blob/main/README.md"

    %% Styles
    classDef external fill:#f9e79f,stroke:#d35400,stroke-width:2px,color:#000;
    classDef process fill:#aed6f1,stroke:#2471a3,stroke-width:2px,color:#000;
    classDef artifact fill:#a9dfbf,stroke:#28b463,stroke-width:2px,color:#000;
    classDef viz fill:#d2b4de,stroke:#7d3c98,stroke-width:2px,color:#000;
    classDef doc fill:#f5b7b1,stroke:#c0392b,stroke-width:2px,color:#000;
```
