# syx113/hwz-cas-ml-finance architecture

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

- Interactive diagram: https://gitdiagram.com/syx113/hwz-cas-ml-finance
- Repository: https://github.com/syx113/hwz-cas-ml-finance

## Overview

##### Project type and purpose
- This is an educational Machine-Learning-for-Finance repository (HWZ-CAS-ML-Finance).
- It’s a collection of Jupyter notebooks (Exercises & Labs) organized into four “Blocks,” each block covering a different topic (financial fundamentals, predictive modeling, deep learning, time series).
- It uses real-world datasets (credit risk, S&P 500, transactions) to bridge theory and practice.

##### File structure
- Top-level folders:
- Block1 through Block4 – each with subfolders “Exercises” (.ipynb) and sometimes “Labs” (.ipynb + CSVs).
- Data – raw CSV datasets organized by domain.
- inspect_transactions.ipynb – a standalone exploratory notebook.
- requirements.txt – Python dependencies.
- No web frontend or backend server – it’s a batch/interactive analytics repo.
- Key config: requirements.txt (defines Python 3.11 env + ML libraries).

##### README for additional insights
- Blocks correspond to course modules: from fundamentals (Block 1) → predictive models (Block 2) → deep learning (Block 3) → time series (Block 4).
- Data sources and use cases are specified.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% External Services
    subgraph "External Services"
        Kaggle["Kaggle Datasets"]:::external
        PyPI["PyPI Registry"]:::external
    end

    %% Data Layer
    subgraph "Data Layer" 
        CreditRisk["credit_risk_dataset.csv"]:::data
        SP500Companies["sp500_companies.csv"]:::data
        SP500Index["sp500_index.csv"]:::data
        SP500Stocks["sp500_stocks.csv"]:::data
        TransactionLogs["transaction_logs.csv"]:::data
    end

    %% Compute/Analysis Layer
    subgraph "Compute/Analysis Layer"
        subgraph "Block 1: Financial Fundamentals"
            B1E3["Exercise3.ipynb"]:::notebook
            B1E4["Exercise4.ipynb"]:::notebook
        end
        subgraph "Block 2: Predictive Modeling"
            B2E2["Exercise2.ipynb"]:::notebook
            LM["LinearModels.ipynb"]:::notebook
            LGM["LogisticModels.ipynb"]:::notebook
            AccountsCSV["Accounts.csv"]:::data
            CompanyGrowthCSV["CompanyGrowth.csv"]:::data
        end
        subgraph "Block 3: Deep Learning"
            B3E1["Exercise1.ipynb"]:::notebook
            B3E2["Exercise2.ipynb"]:::notebook
            LSTMs["LSTMs.ipynb"]:::notebook
        end
        subgraph "Block 4: Time Series Analysis"
            B4E1["Exercise1.ipynb"]:::notebook
        end
    end

    %% Environment Layer
    subgraph "Environment Layer"
        Env["Python 3.11 + Jupyter<br/>requirements.txt"]:::env
    end

    %% Version Control & Metadata
    subgraph "Repository Metadata"
        Gitignore[".gitignore"]:::external
        Readme["README.md"]:::external
    end

    %% Relationships
    Kaggle -.-> CreditRisk
    Kaggle -.-> SP500Companies
    Kaggle -.-> SP500Index
    Kaggle -.-> SP500Stocks
    Kaggle -.-> TransactionLogs

    CreditRisk -->|loads| B1E3
    CreditRisk -->|loads| B1E4
    SP500Companies -->|loads| B1E3
    SP500Index -->|loads| B1E3
    SP500Stocks -->|loads| B1E3
    TransactionLogs -->|loads| B1E3

    CreditRisk -->|feeds| B2E2
    AccountsCSV -->|feeds| LM
    CompanyGrowthCSV -->|feeds| LM
    AccountsCSV -->|feeds| LGM
    CompanyGrowthCSV -->|feeds| LGM

    CreditRisk -->|feeds| B3E1
    SP500Index -->|feeds| B3E1
    SP500Stocks -->|feeds| B3E1
    SP500Index -->|feeds| LSTMs
    SP500Stocks -->|feeds| LSTMs

    CreditRisk -->|feeds| B4E1
    SP500Index -->|feeds| B4E1
    SP500Stocks -->|feeds| B4E1

    Env -->|runs| B1E3
    Env -->|runs| B1E4
    Env -->|runs| B2E2
    Env -->|runs| LM
    Env -->|runs| LGM
    Env -->|runs| B3E1
    Env -->|runs| B3E2
    Env -->|runs| LSTMs
    Env -->|runs| B4E1

    PyPI -.-> Env

    Readme --> Env
    Gitignore --> Env

    %% Click Events
    click CreditRisk "https://github.com/syx113/hwz-cas-ml-finance/blob/main/Data/credit_risk/credit_risk_dataset.csv"
    click SP500Companies "https://github.com/syx113/hwz-cas-ml-finance/blob/main/Data/sp500_stocks/sp500_companies.csv"
    click SP500Index "https://github.com/syx113/hwz-cas-ml-finance/blob/main/Data/sp500_stocks/sp500_index.csv"
    click SP500Stocks "https://github.com/syx113/hwz-cas-ml-finance/blob/main/Data/sp500_stocks/sp500_stocks.csv"
    click TransactionLogs "https://github.com/syx113/hwz-cas-ml-finance/blob/main/Data/transactions/transaction_logs.csv"

    click B1E3 "https://github.com/syx113/hwz-cas-ml-finance/blob/main/Block1/Exercises/Exercise3.ipynb"
    click B1E4 "https://github.com/syx113/hwz-cas-ml-finance/blob/main/Block1/Exercises/Exercise4.ipynb"

    click B2E2 "https://github.com/syx113/hwz-cas-ml-finance/blob/main/Block2/Exercises/Exercise2.ipynb"
    click LM "https://github.com/syx113/hwz-cas-ml-finance/blob/main/Block2/Labs/LinearModels.ipynb"
    click LGM "https://github.com/syx113/hwz-cas-ml-finance/blob/main/Block2/Labs/LogisticModels.ipynb"
    click AccountsCSV "https://github.com/syx113/hwz-cas-ml-finance/blob/main/Block2/Labs/Accounts.csv"
    click CompanyGrowthCSV "https://github.com/syx113/hwz-cas-ml-finance/blob/main/Block2/Labs/CompanyGrowth.csv"

    click B3E1 "https://github.com/syx113/hwz-cas-ml-finance/blob/main/Block3/Exercises/Exercise1.ipynb"
    click B3E2 "https://github.com/syx113/hwz-cas-ml-finance/blob/main/Block3/Exercises/Exercise2.ipynb"
    click LSTMs "https://github.com/syx113/hwz-cas-ml-finance/blob/main/Block3/Labs/LSTMs.ipynb"

    click B4E1 "https://github.com/syx113/hwz-cas-ml-finance/blob/main/Block4/Exercises/Exercise1.ipynb"

    click Env "https://github.com/syx113/hwz-cas-ml-finance/blob/main/requirements.txt"
    click Readme "https://github.com/syx113/hwz-cas-ml-finance/blob/main/README.md"
    click Gitignore "https://github.com/syx113/hwz-cas-ml-finance/blob/main/.gitignore"

    %% Styles
    classDef data fill:#add8e6,stroke:#000;
    classDef notebook fill:#90ee90,stroke:#000;
    classDef env fill:#ffa500,stroke:#000;
    classDef external fill:#d3d3d3,stroke:#000;
```
