# abdur1r/fake-profile-detection-using-ml architecture

> Architecture diagram of the GitHub repository abdur1r/fake-profile-detection-using-ml, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-05-30). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/abdur1r/fake-profile-detection-using-ml
- Repository: https://github.com/abdur1r/fake-profile-detection-using-ml

## Overview

##### Project type and purpose
- This is a data-science / machine-learning pipeline whose goal is to detect fake profiles in online social networks. The README and directory structure show multiple modeling experiments (Neural Network, Random Forest, SVM) implemented both as Jupyter notebooks and standalone Python scripts, with input data in CSVs and output reports in HTML/PDF.

##### File structure
- Top-level:
- Neural Network.ipynb & .py
- Random Forest.ipynb & .py
- Support Vector Machine.ipynb & .py
- data/ (fusers.csv, users.csv)
- html/ (model report outputs)
- pdf/ (model report outputs)
- requirement/ (presumably dependency listing)
- Pattern: each algorithm is a separate module; data lives in a “data” bucket; outputs are captured in “html” and “pdf.”

##### README for additional insights
- Dependencies: numpy, pandas, matplotlib, scikit-learn, pybrain, sexmachine.
- Execution modes: Jupyter notebooks (recommended) or Python scripts.
- All experiment outputs are saved in HTML/PDF for easy sharing.

a. Main components
1. Data Storage Layer
– CSV files under data/
2. Data Preprocessing Module
– routines in each .py/.ipynb that load CSVs, clean, feature-engineer (e.g., using pandas, sexmachine for gender inference)
3. Model Training & Evaluation Modules
– Neural Network (pybrain)
– Random Forest (scikit-learn)
– Support Vector Machine (scikit-learn)
4. Reporting/Export Module
– generates HTML (in html/) and PDF (in pdf/) via notebook export or Python script
5. Execution Environment
– Jupyter Notebook server or Python CLI
6. Dependency Manager
– pip with requirement files
b. Relationships & Data Flow
– The Execution Environment orchestrates end-to-end flow; Dependency Manager provides libraries
c. Architectural Patterns & Design Principles
– Modular experimentation: each algorithm is isolated in its own script/notebook
– Pipeline pattern: linear flow from raw data to reports
– Separation of concerns: data ingestion, model logic, and reporting are distinct
d. Technologies/Frameworks
– pandas & numpy for data ops
– sexmachine for gender inference
– scikit-learn for Random Forest & SVM
– pybrain for neural networks
– matplotlib for visualizations
– Jupyter Notebook/IPython for interactive exploration/export

##### Diagramming recommendations
- Blue = Data / Storage
- Green = Compute / Models
- Orange = Reporting / Export
- Gray = Environment / Dependencies

##### Detail level
- Sub-components in each module (e.g., “Feature Engineering,” “Model Training,” “Model Evaluation”).
- That requirement/ (or requirements.txt) feeds into the Dependency Manager.
- That each algorithm’s notebooks/scripts import the preprocessing code.

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Pipeline Layers
    S0[(Data Storage Layer)]:::data
    PP[/"Data Preprocessing Module"/]:::compute
    subgraph "Modeling Modules"
        NN["Neural Network Module"]:::compute
        RF["Random Forest Module"]:::compute
        SVM["Support Vector Machine Module"]:::compute
    end
    RP[/Reporting/Export Module/]:::report
    HTMLO["HTML Outputs"]:::report
    PDFO["PDF Outputs"]:::report

    %% Environment & Dependencies
    DM["Dependency Manager"]:::env
    EE["Execution Environment"]:::env

    %% Data Flow
    S0 --> PP
    PP --> NN
    PP --> RF
    PP --> SVM
    NN --> RP
    RF --> RP
    SVM --> RP
    RP --> HTMLO
    RP --> PDFO

    %% Orchestration Flow
    DM --> EE
    EE --> PP

    %% Click Events
    click S0 "https://github.com/abdur1r/fake-profile-detection-using-ml/tree/master/data/"
    click NN "https://github.com/abdur1r/fake-profile-detection-using-ml/blob/master/Neural Network.ipynb"
    click NN "https://github.com/abdur1r/fake-profile-detection-using-ml/blob/master/Neural Network.py"
    click RF "https://github.com/abdur1r/fake-profile-detection-using-ml/blob/master/Random Forest.ipynb"
    click RF "https://github.com/abdur1r/fake-profile-detection-using-ml/blob/master/Random Forest.py"
    click SVM "https://github.com/abdur1r/fake-profile-detection-using-ml/blob/master/Support Vector Machine.ipynb"
    click SVM "https://github.com/abdur1r/fake-profile-detection-using-ml/blob/master/Support Vector Machine.py"
    click HTMLO "https://github.com/abdur1r/fake-profile-detection-using-ml/tree/master/html/"
    click PDFO "https://github.com/abdur1r/fake-profile-detection-using-ml/tree/master/pdf/"
    click DM "https://github.com/abdur1r/fake-profile-detection-using-ml/tree/master/requirement/"

    %% Styles
    classDef data fill:#87CEFA,stroke:#000,stroke-width:1px
    classDef compute fill:#90EE90,stroke:#000,stroke-width:1px
    classDef report fill:#FFA500,stroke:#000,stroke-width:1px
    classDef env fill:#D3D3D3,stroke:#000,stroke-width:1px
```
