# morisde/financial-statements architecture

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

- Interactive diagram: https://gitdiagram.com/morisde/financial-statements
- Repository: https://github.com/morisde/financial-statements

## Overview

##### Main Components
- Data Ingestion – This component represents the source of the dataset: the “Financial Statements.csv”.
- Data Analysis/EDA – This module covers both the generation of the in-depth EDA report (via ydata_profiling) and the visual analytics (including SNS.pairplot explorations).
- Machine Learning Pipeline – The section where PyCaret is employed to set up the regression model (using Lasso) to predict Gross Profit.
- Output/Reporting – This includes the final visualization results in the Jupyter Notebook and the generated “report.html”.

##### Structure and Relationships
- Data Input (Financial Statements.csv): At the beginning of the pipeline, the raw CSV data is imported into the Jupyter Notebook (“Financial_Statements_of_Major_Companies(2009_2023).ipynb”).
- EDA Process: From the raw data, an exploratory step is performed. Use the ydata_profiling library to build an in-depth report, and include preliminary visualizations like SNS.pairplot (noting that this function may be optionally skipped due to execution time). This module serves two purposes:
- Data understanding and validation.
- Informing any subsequent cleaning or preprocessing steps.
- Machine Learning (ML) Execution: Following EDA, the PyCaret library is used. This part of the notebook is responsible for:
- Preparing a ML model (Lasso regression) for predicting Gross Profit.
- Evaluating model performance by comparing predicted vs. actual values in the final visualization.
- Reporting/Visualization Output: The final results – including the execution of predictive modeling and final comparison plots – are saved and/or rendered as “report.html” and may also be restored in the notebook.

## Diagram (Mermaid)

```mermaid
flowchart TD
    A["Financial Statements.csv"]:::data
    B["Financial_Statements_of_Major_Companies(2009_2023).ipynb"]:::notebook

    subgraph "Data Processing"
        E["EDA: ydata_profiling (Data Profiling)"]:::eda
        EP["(Optional) SNS.pairplot (Visual Analytics)"]:::edaOptional
        M["ML Pipeline: PyCaret (Lasso Regression)"]:::ml
    end

    C["report.html"]:::output

    %% Data Flow
    A -->|"ingests"| B
    B -->|"executes EDA"| E
    E -->|"feeds cleaned data"| M
    M -->|"generates"| C
    %% Optional SNS.pairplot step with dashed arrow
    B -.->|"optional SNS.pairplot"| EP

    %% Click Events
    click A "https://github.com/morisde/financial-statements/blob/main/Financial Statements.csv"
    click B "https://github.com/morisde/financial-statements/blob/main/Financial_Statements_of_Major_Companies(2009_2023).ipynb"
    click C "https://github.com/morisde/financial-statements/blob/main/report.html"

    %% Styles
    classDef data fill:#FFF2CC,stroke:#D4AC0D,stroke-width:2px;
    classDef notebook fill:#D6EAF8,stroke:#2874A6,stroke-width:2px;
    classDef eda fill:#D5F5E3,stroke:#28B463,stroke-width:2px;
    classDef edaOptional fill:#FDEBD0,stroke:#E67E22,stroke-width:2px,stroke-dasharray: 5, 5;
    classDef ml fill:#FADBD8,stroke:#CD6155,stroke-width:2px;
    classDef output fill:#F9E79F,stroke:#B7950B,stroke-width:2px;
```
