# nikita-hub6377/cybershield-analytics architecture

> Architecture diagram of the GitHub repository nikita-hub6377/cybershield-analytics, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-07). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/nikita-hub6377/cybershield-analytics
- Repository: https://github.com/nikita-hub6377/cybershield-analytics

## Overview

CyberShield Analytics is an offline cybersecurity-incident analysis and risk-assessment project. Its main workflow takes historical incident data through cleaning and risk-feature engineering, then produces model predictions and complementary anomaly, forecasting, explanation, similarity, and monitoring analyses for analyst review in Power BI. The README documents the overall flow; sampled scripts confirm several data reads, writes, and merges. Other source files and the dashboard implementation were not inspected, so their internal behavior and undocumented connections are not inferred.

Main entry points: [`Data/processed/cybersecurity_processed.csv`](https://github.com/nikita-hub6377/cybershield-analytics/blob/main/Data/processed/cybersecurity_processed.csv) (Processed incidents), [`outputs/ml`](https://github.com/nikita-hub6377/cybershield-analytics/tree/main/outputs/ml) (ML result files), [`src/predict_all_incidents.py`](https://github.com/nikita-hub6377/cybershield-analytics/blob/main/src/predict_all_incidents.py) (Incident prediction), [`src/create_master_dataset.py`](https://github.com/nikita-hub6377/cybershield-analytics/blob/main/src/create_master_dataset.py) (Master ML dataset)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_prep["Data preparation"]
  node_raw["Threat dataset"]
  node_understanding["Data understanding"]
  node_cleaning["Data cleaning<br/>[clean_data.py]"]
  node_cleaned["Cleaned incidents"]
  node_engineering["Risk engineering"]
  node_processed["Processed incidents"]
end

subgraph group_analytics["Incident analytics"]
  node_eda["Exploratory analysis<br/>[02_eda.py]"]
  node_training["Random Forest training"]
  node_model["Risk model"]
  node_prediction["Incident prediction"]
  node_anomalies["Anomaly detection"]
  node_forecast["Trend forecasting"]
end

subgraph group_intelligence["Risk intelligence"]
  node_explanation["Prediction explanations"]
  node_similarity["Similar incidents"]
  node_monitoring["Risk monitoring<br/>[risk_monitoring.py]"]
  node_master["Master ML dataset"]
end

subgraph group_delivery["Results and review"]
  node_mysql_import["MySQL import<br/>[import_to_mysql.py]"]
  node_mysql[("Incident database")]
  node_sql["Database schema"]
  node_dashboard["Power BI dashboard"]
  node_ml_outputs["ML result files"]
end

node_analyst(("Security analyst"))

node_raw -->|"inspects"| node_understanding
node_raw -->|"cleans"| node_cleaning
node_cleaning -->|"writes"| node_cleaned
node_cleaned -->|"engineers"| node_engineering
node_engineering -->|"writes"| node_processed
node_processed -->|"analyzes"| node_eda
node_processed -->|"trains on"| node_training
node_training -->|"saves"| node_model
node_processed -->|"predicts"| node_prediction
node_model -->|"loads"| node_prediction
node_processed -->|"detects"| node_anomalies
node_processed -->|"forecasts"| node_forecast
node_processed -->|"explains"| node_explanation
node_processed -->|"compares"| node_similarity
node_processed -->|"monitors"| node_monitoring
node_prediction -->|"writes"| node_ml_outputs
node_anomalies -->|"writes"| node_ml_outputs
node_forecast -->|"writes"| node_ml_outputs
node_explanation -->|"writes"| node_ml_outputs
node_similarity -->|"writes"| node_ml_outputs
node_monitoring -->|"merges results"| node_master
node_prediction -->|"merges results"| node_master
node_anomalies -->|"merges results"| node_master
node_master -->|"writes"| node_ml_outputs
node_processed -->|"imports"| node_mysql_import
node_mysql_import -->|"writes"| node_mysql
node_sql -.->|"defines schema"| node_mysql
node_ml_outputs -->|"visualizes"| node_dashboard
node_analyst -->|"reviews"| node_dashboard

click node_raw "https://github.com/nikita-hub6377/cybershield-analytics/blob/main/Data/raw/Global_Cybersecurity_Threats_2015-2024.csv"
click node_understanding "https://github.com/nikita-hub6377/cybershield-analytics/blob/main/Notebooks/01_data_understanding.py"
click node_cleaning "https://github.com/nikita-hub6377/cybershield-analytics/blob/main/src/clean_data.py"
click node_cleaned "https://github.com/nikita-hub6377/cybershield-analytics/blob/main/Data/cleaned/cybersecurity_cleaned.csv"
click node_engineering "https://github.com/nikita-hub6377/cybershield-analytics/blob/main/src/feature_engineering.py"
click node_processed "https://github.com/nikita-hub6377/cybershield-analytics/blob/main/Data/processed/cybersecurity_processed.csv"
click node_eda "https://github.com/nikita-hub6377/cybershield-analytics/blob/main/Notebooks/02_eda.py"
click node_training "https://github.com/nikita-hub6377/cybershield-analytics/blob/main/src/train_random_forest.py"
click node_model "https://github.com/nikita-hub6377/cybershield-analytics/blob/main/models/random_forest_model.pkl"
click node_prediction "https://github.com/nikita-hub6377/cybershield-analytics/blob/main/src/predict_all_incidents.py"
click node_anomalies "https://github.com/nikita-hub6377/cybershield-analytics/blob/main/src/detect_anomalies.py"
click node_forecast "https://github.com/nikita-hub6377/cybershield-analytics/blob/main/src/forecast_incidents.py"
click node_explanation "https://github.com/nikita-hub6377/cybershield-analytics/blob/main/src/explain_predictions.py"
click node_similarity "https://github.com/nikita-hub6377/cybershield-analytics/blob/main/src/similar_incidents.py"
click node_monitoring "https://github.com/nikita-hub6377/cybershield-analytics/blob/main/src/risk_monitoring.py"
click node_master "https://github.com/nikita-hub6377/cybershield-analytics/blob/main/src/create_master_dataset.py"
click node_mysql_import "https://github.com/nikita-hub6377/cybershield-analytics/blob/main/src/import_to_mysql.py"
click node_sql "https://github.com/nikita-hub6377/cybershield-analytics/blob/main/SQL/cybershield_analytics.sql"
click node_dashboard "https://github.com/nikita-hub6377/cybershield-analytics/blob/main/Powerbi/CyberShield_Analytics_Dashboard.pbix"
click node_ml_outputs "https://github.com/nikita-hub6377/cybershield-analytics/tree/main/outputs/ml"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_raw,node_understanding,node_cleaning,node_cleaned,node_engineering,node_processed toneBlue
class node_eda,node_training,node_model,node_prediction,node_anomalies,node_forecast toneAmber
class node_explanation,node_similarity,node_monitoring,node_master toneMint
class node_mysql_import,node_mysql,node_sql,node_dashboard,node_ml_outputs toneRose
class node_analyst toneIndigo
```

## Components

### Data preparation

- [Threat dataset](https://github.com/nikita-hub6377/cybershield-analytics/blob/main/Data/raw/Global_Cybersecurity_Threats_2015-2024.csv): `Data/raw/Global_Cybersecurity_Threats_2015-2024.csv`
- [Data understanding](https://github.com/nikita-hub6377/cybershield-analytics/blob/main/Notebooks/01_data_understanding.py): `Notebooks/01_data_understanding.py`
- [Data cleaning](https://github.com/nikita-hub6377/cybershield-analytics/blob/main/src/clean_data.py): `src/clean_data.py`
- [Cleaned incidents](https://github.com/nikita-hub6377/cybershield-analytics/blob/main/Data/cleaned/cybersecurity_cleaned.csv): `Data/cleaned/cybersecurity_cleaned.csv`
- [Risk engineering](https://github.com/nikita-hub6377/cybershield-analytics/blob/main/src/feature_engineering.py): `src/feature_engineering.py`
- [Processed incidents](https://github.com/nikita-hub6377/cybershield-analytics/blob/main/Data/processed/cybersecurity_processed.csv): `Data/processed/cybersecurity_processed.csv`

### Incident analytics

- [Exploratory analysis](https://github.com/nikita-hub6377/cybershield-analytics/blob/main/Notebooks/02_eda.py): `Notebooks/02_eda.py`
- [Random Forest training](https://github.com/nikita-hub6377/cybershield-analytics/blob/main/src/train_random_forest.py): `src/train_random_forest.py`
- [Risk model](https://github.com/nikita-hub6377/cybershield-analytics/blob/main/models/random_forest_model.pkl): `models/random_forest_model.pkl`
- [Incident prediction](https://github.com/nikita-hub6377/cybershield-analytics/blob/main/src/predict_all_incidents.py): `src/predict_all_incidents.py`
- [Anomaly detection](https://github.com/nikita-hub6377/cybershield-analytics/blob/main/src/detect_anomalies.py): `src/detect_anomalies.py`
- [Trend forecasting](https://github.com/nikita-hub6377/cybershield-analytics/blob/main/src/forecast_incidents.py): `src/forecast_incidents.py`

### Risk intelligence

- [Prediction explanations](https://github.com/nikita-hub6377/cybershield-analytics/blob/main/src/explain_predictions.py): `src/explain_predictions.py`
- [Similar incidents](https://github.com/nikita-hub6377/cybershield-analytics/blob/main/src/similar_incidents.py): `src/similar_incidents.py`
- [Risk monitoring](https://github.com/nikita-hub6377/cybershield-analytics/blob/main/src/risk_monitoring.py): `src/risk_monitoring.py`
- [Master ML dataset](https://github.com/nikita-hub6377/cybershield-analytics/blob/main/src/create_master_dataset.py): `src/create_master_dataset.py`

### Results and review

- [MySQL import](https://github.com/nikita-hub6377/cybershield-analytics/blob/main/src/import_to_mysql.py): `src/import_to_mysql.py`
- **Incident database**
- [Database schema](https://github.com/nikita-hub6377/cybershield-analytics/blob/main/SQL/cybershield_analytics.sql): `SQL/cybershield_analytics.sql`
- [Power BI dashboard](https://github.com/nikita-hub6377/cybershield-analytics/blob/main/Powerbi/CyberShield_Analytics_Dashboard.pbix): `Powerbi/CyberShield_Analytics_Dashboard.pbix`
- [ML result files](https://github.com/nikita-hub6377/cybershield-analytics/tree/main/outputs/ml): `outputs/ml`

### Other components

- **Security analyst**

## Connections

- Threat dataset → Data understanding: inspects (evidence: `Notebooks/01_data_understanding.py`)
- Threat dataset → Data cleaning: cleans (evidence: `README.md`)
- Data cleaning → Cleaned incidents: writes (evidence: `README.md`)
- Cleaned incidents → Risk engineering: engineers (evidence: `src/feature_engineering.py`)
- Risk engineering → Processed incidents: writes (evidence: `src/feature_engineering.py`)
- Processed incidents → Exploratory analysis: analyzes (evidence: `Notebooks/02_eda.py`)
- Processed incidents → Random Forest training: trains on (evidence: `src/train_random_forest.py`)
- Random Forest training → Risk model: saves (evidence: `README.md`)
- Processed incidents → Incident prediction: predicts (evidence: `src/predict_all_incidents.py`)
- Risk model → Incident prediction: loads (evidence: `src/predict_all_incidents.py`)
- Processed incidents → Anomaly detection: detects (evidence: `src/detect_anomalies.py`)
- Processed incidents → Trend forecasting: forecasts (evidence: `src/forecast_incidents.py`)
- Processed incidents → Prediction explanations: explains (evidence: `README.md`)
- Processed incidents → Similar incidents: compares (evidence: `README.md`)
- Processed incidents → Risk monitoring: monitors (evidence: `src/risk_monitoring.py`)
- Incident prediction → ML result files: writes (evidence: `src/predict_all_incidents.py`)
- Anomaly detection → ML result files: writes (evidence: `src/detect_anomalies.py`)
- Trend forecasting → ML result files: writes (evidence: `src/forecast_incidents.py`)
- Prediction explanations → ML result files: writes (evidence: `src/explain_predictions.py`)
- Similar incidents → ML result files: writes (evidence: `src/similar_incidents.py`)
- Risk monitoring → Master ML dataset: merges results (evidence: `src/create_master_dataset.py`)
- Incident prediction → Master ML dataset: merges results (evidence: `src/create_master_dataset.py`)
- Anomaly detection → Master ML dataset: merges results (evidence: `src/create_master_dataset.py`)
- Master ML dataset → ML result files: writes (evidence: `src/create_master_dataset.py`)
- Processed incidents → MySQL import: imports (evidence: `src/import_to_mysql.py`)
- MySQL import → Incident database: writes (evidence: `src/import_to_mysql.py`)
- Database schema → Incident database: defines schema
- ML result files → Power BI dashboard: visualizes (evidence: `README.md`)
- Security analyst → Power BI dashboard: reviews (evidence: `README.md`)
