# shanigarapusheshanth2007-wq/sdc-project-1 architecture

> Architecture diagram of the GitHub repository shanigarapusheshanth2007-wq/sdc-project-1, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-17). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/shanigarapusheshanth2007-wq/sdc-project-1
- Repository: https://github.com/shanigarapusheshanth2007-wq/sdc-project-1

## Overview

This repository implements a loan-risk prediction API: a client submits loan attributes to a FastAPI endpoint and receives an approval prediction, probability, and feature-influence explanation. At startup, the backend loads and cleans the configured loan dataset, removes rows without a target, splits the data, and loads a trained model. The prediction endpoint aligns submitted features to the model’s expected columns, predicts, and computes an explanation using the training data. The README is empty; the graph reflects the sampled backend code, and configured data/model files are not present in the tree.

Main entry points: [`BACKEND/main.py`](https://github.com/shanigarapusheshanth2007-wq/sdc-project-1/blob/main/BACKEND/main.py) (Prediction API), [`BACKEND/SRC/preprocessing.py`](https://github.com/shanigarapusheshanth2007-wq/sdc-project-1/blob/main/BACKEND/SRC/preprocessing.py) (Dataset loader), [`BACKEND/CONFIGS/paths.py`](https://github.com/shanigarapusheshanth2007-wq/sdc-project-1/blob/main/BACKEND/CONFIGS/paths.py) (Data and model paths), [`BACKEND/SRC/cleaning.py`](https://github.com/shanigarapusheshanth2007-wq/sdc-project-1/blob/main/BACKEND/SRC/cleaning.py) (Cleaning and encoding)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_serving["Prediction service"]
  node_api["Prediction API<br/>[main.py]"]
  node_result["Prediction response<br/>[main.py]"]
end

subgraph group_preparation["Data preparation"]
  node_loader["Dataset loader<br/>[preprocessing.py]"]
  node_cleaner["Cleaning and encoding<br/>[cleaning.py]"]
  node_splitter["Train-validation-test split<br/>[splitting.py]"]
end

subgraph group_configuration["Configuration and inputs"]
  node_dataset["Configured loan dataset"]
  node_paths["Data and model paths<br/>[paths.py]"]
end

subgraph group_inference["Inference and explanation"]
  node_model["Trained risk model"]
  node_explainer["Feature influence analysis<br/>[analysis.py]"]
end

node_client(("Loan applicant client"))

node_client -->|"submits loan data"| node_api
node_api -->|"loads dataset"| node_loader
node_loader -->|"reads data paths"| node_paths
node_dataset -.->|"provides rows"| node_loader
node_api -->|"preprocesses data"| node_cleaner
node_api -->|"splits data"| node_splitter
node_api -->|"loads model path"| node_paths
node_model -->|"located by"| node_paths
node_api -->|"loads and predicts"| node_model
node_api -->|"requests explanation"| node_explainer
node_api -->|"returns prediction"| node_result
node_result -.->|"sends response"| node_client

click node_api "https://github.com/shanigarapusheshanth2007-wq/sdc-project-1/blob/main/BACKEND/main.py"
click node_paths "https://github.com/shanigarapusheshanth2007-wq/sdc-project-1/blob/main/BACKEND/CONFIGS/paths.py"
click node_loader "https://github.com/shanigarapusheshanth2007-wq/sdc-project-1/blob/main/BACKEND/SRC/preprocessing.py"
click node_cleaner "https://github.com/shanigarapusheshanth2007-wq/sdc-project-1/blob/main/BACKEND/SRC/cleaning.py"
click node_splitter "https://github.com/shanigarapusheshanth2007-wq/sdc-project-1/blob/main/BACKEND/SRC/splitting.py"
click node_explainer "https://github.com/shanigarapusheshanth2007-wq/sdc-project-1/blob/main/BACKEND/SRC/analysis.py"
click node_result "https://github.com/shanigarapusheshanth2007-wq/sdc-project-1/blob/main/BACKEND/main.py"

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_api,node_result,node_client toneBlue
class node_loader,node_cleaner,node_splitter toneAmber
class node_dataset,node_paths toneMint
class node_model,node_explainer toneRose
```

## Components

### Prediction service

- [Prediction API](https://github.com/shanigarapusheshanth2007-wq/sdc-project-1/blob/main/BACKEND/main.py): `BACKEND/main.py`
- [Prediction response](https://github.com/shanigarapusheshanth2007-wq/sdc-project-1/blob/main/BACKEND/main.py): `BACKEND/main.py`

### Data preparation

- [Dataset loader](https://github.com/shanigarapusheshanth2007-wq/sdc-project-1/blob/main/BACKEND/SRC/preprocessing.py): `BACKEND/SRC/preprocessing.py`
- [Cleaning and encoding](https://github.com/shanigarapusheshanth2007-wq/sdc-project-1/blob/main/BACKEND/SRC/cleaning.py): `BACKEND/SRC/cleaning.py`
- [Train-validation-test split](https://github.com/shanigarapusheshanth2007-wq/sdc-project-1/blob/main/BACKEND/SRC/splitting.py): `BACKEND/SRC/splitting.py`

### Configuration and inputs

- **Configured loan dataset**
- [Data and model paths](https://github.com/shanigarapusheshanth2007-wq/sdc-project-1/blob/main/BACKEND/CONFIGS/paths.py): `BACKEND/CONFIGS/paths.py`

### Inference and explanation

- **Trained risk model**
- [Feature influence analysis](https://github.com/shanigarapusheshanth2007-wq/sdc-project-1/blob/main/BACKEND/SRC/analysis.py): `BACKEND/SRC/analysis.py`

### Other components

- **Loan applicant client**

## Connections

- Loan applicant client → Prediction API: submits loan data (evidence: `BACKEND/main.py`)
- Prediction API → Dataset loader: loads dataset (evidence: `BACKEND/main.py`)
- Dataset loader → Data and model paths: reads data paths (evidence: `BACKEND/SRC/preprocessing.py`)
- Configured loan dataset → Dataset loader: provides rows
- Prediction API → Cleaning and encoding: preprocesses data (evidence: `BACKEND/main.py`)
- Prediction API → Train-validation-test split: splits data (evidence: `BACKEND/main.py`)
- Prediction API → Data and model paths: loads model path (evidence: `BACKEND/main.py`)
- Trained risk model → Data and model paths: located by (evidence: `BACKEND/CONFIGS/paths.py`)
- Prediction API → Trained risk model: loads and predicts (evidence: `BACKEND/main.py`)
- Prediction API → Feature influence analysis: requests explanation (evidence: `BACKEND/main.py`)
- Prediction API → Prediction response: returns prediction (evidence: `BACKEND/main.py`)
- Prediction response → Loan applicant client: sends response
