# devgru-3-2/football-analytics architecture

> Architecture diagram of the GitHub repository devgru-3-2/football-analytics, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-03-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/devgru-3-2/football-analytics
- Repository: https://github.com/devgru-3-2/football-analytics

## Overview

##### Main Components
- Data Sources: Represent the CSV files and data folders. This includes raw match data, fixture information, and additional datasets (like players data) stored under the “data” directory.
- Data Ingestion & Extraction: Include the initial notebooks and scripts such as “1-Extraction.ipynb” and “1.get_missing_data.py” that read the CSV files, handle missing data, and prepare the data for further processes.
- Data Cleaning & Pre-processing: Represent the “2.data_cleaning.ipynb” component. This stage refines the data further to remove inconsistencies and outliers.
- Feature Engineering & Data Transformation: From scripts such as “1.get_results_and_fixture.py” and possibly parts of the extraction notebooks, show the process where raw data is converted into a structured format featuring relevant metrics for prediction.
- Model Training & Prediction: Highlight the “predict_world_cup.ipynb” component where the Poisson Distribution-based model is applied to the clean data to predict match outcomes.
- Data Visualization & Analysis: Represent the “3.data_visualization_best_lineup.ipynb” where visual insight (e.g., best lineups, historical trends) is provided to support the analytics.

##### Relationships & Data Flow
- Extraction to Data Cleaning & Pre-processing, indicating that the cleaned data is used for both feature engineering and further modeling.
- From Data Cleaning, branch out data flow in two parts: one to Feature Engineering (which may then feed into the Model Training component) and another to Data Visualization for an exploratory analysis.
- Optionally, include an output path from Model Training, where predicted results might be visualized or exported (and possibly used by sports analysts or decision-making tools).

##### Architectural Patterns & Design Principles
- Pipeline Architecture: Emphasize that the project follows a sequential pipeline – starting from raw data ingestion and moving through cleaning, transformation, modeling, and visualization.
- Integration Through Data Files: Note that the intermediate data and outputs are often stored in CSVs or serialized data, acting as the “glue” between components.

##### Specify Relevant Technologies & Libraries
- Data Handling & Pre-processing: Pandas (as mentioned), which is used heavily in data transformation.
- Visualization: Matplotlib for plotting graphs and trends.
- Machine Learning: Scikit-learn (if used for helper functions), along with your custom implementation of the Poisson Distribution for predictions.
- Jupyter Notebooks: They serve as interactive environments for development and experimentation across various stages of the pipeline.

## Diagram (Mermaid)

```mermaid
graph TD
    dataSources["Data Sources (CSV Files)"]:::data
    extraction["1-Extraction.ipynb"]:::ingestion
    missing["1.get_missing_data.py"]:::ingestion
    cleaning["Data Cleaning & Pre-processing"]:::cleaning
    feature["Feature Engineering & Data Transformation"]:::feature
    model["Model Training & Prediction (Poisson)"]:::model
    visualization["Data Visualization & Analysis"]:::visualization

    dataSources -->|"feeds"| extraction
    dataSources -->|"feeds"| missing
    extraction -->|"processes"| cleaning
    missing -->|"processes"| cleaning
    cleaning -->|"outputs to"| feature
    cleaning -->|"outputs to"| visualization
    feature -->|"trains"| model
    model -->|"exports"| visualization

    click dataSources "https://github.com/devgru-3-2/football-analytics/tree/main/data/"
    click extraction "https://github.com/devgru-3-2/football-analytics/blob/main/1-Extraction.ipynb"
    click missing "https://github.com/devgru-3-2/football-analytics/blob/main/1.get_missing_data.py"
    click cleaning "https://github.com/devgru-3-2/football-analytics/blob/main/2.data_cleaning.ipynb"
    click feature "https://github.com/devgru-3-2/football-analytics/blob/main/1.get_results_and_fixture.py"
    click model "https://github.com/devgru-3-2/football-analytics/blob/main/4.predict_world_cup.ipynb"
    click visualization "https://github.com/devgru-3-2/football-analytics/blob/main/3.data_visualization_best_lineup.ipynb"

    classDef data fill:#cce5ff,stroke:#333,stroke-width:2px;
    classDef ingestion fill:#d4edda,stroke:#333,stroke-width:2px;
    classDef cleaning fill:#fff3cd,stroke:#333,stroke-width:2px;
    classDef feature fill:#d1ecf1,stroke:#333,stroke-width:2px;
    classDef model fill:#f8d7da,stroke:#333,stroke-width:2px;
    classDef visualization fill:#e2e3e5,stroke:#333,stroke-width:2px;
```
