# sonalpriyanshi529/loanapprovalprediction architecture

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

- Interactive diagram: https://gitdiagram.com/sonalpriyanshi529/loanapprovalprediction
- Repository: https://github.com/sonalpriyanshi529/loanapprovalprediction

## Overview

This repository trains and serves a binary loan-approval classifier. The main user workflow is applicant details in the Streamlit app → feature preparation → model prediction and approval probabilities. A separate training workflow loads loan data, preprocesses and engineers features, trains and evaluates several models, then saves artifacts consumed by the app. The README also documents notebook-based EDA and model comparisons; notebook internals are not sampled, so only its documented role is shown.

Main entry points: [`train_model.py`](https://github.com/sonalpriyanshi529/loanapprovalprediction/blob/main/train_model.py) (Training orchestrator), [`Streamlit_App/app.py`](https://github.com/sonalpriyanshi529/loanapprovalprediction/blob/main/Streamlit_App/app.py) (Streamlit interface), [`Model`](https://github.com/sonalpriyanshi529/loanapprovalprediction/tree/main/Model) (Model artifacts), [`Dataset/loan_data.csv`](https://github.com/sonalpriyanshi529/loanapprovalprediction/blob/main/Dataset/loan_data.csv) (Loan dataset)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_analysis["Analysis"]
  node_notebook["EDA and comparison"]
end

subgraph group_training["Training"]
  node_loan_data["Loan dataset<br/>[loan_data.csv]"]
  node_trainer["Training orchestrator<br/>[train_model.py]"]
  node_preprocessing["Preprocessing and features<br/>[train_model.py]"]
  node_model_training["Model training<br/>[train_model.py]"]
  node_evaluation["Model evaluation<br/>[train_model.py]"]
  node_artifacts[("Model artifacts")]
end

subgraph group_serving["Prediction app"]
  node_streamlit["Streamlit interface<br/>[app.py]"]
  node_artifact_loader["Artifact loading<br/>[app.py]"]
  node_input_features["Input feature building<br/>[app.py]"]
  node_inference["Approval inference<br/>[app.py]"]
  node_prediction_result["Decision and probabilities<br/>[app.py]"]
end

node_applicant(("Applicant"))

node_notebook -.->|"analyzes"| node_loan_data
node_trainer -->|"loads"| node_loan_data
node_trainer -->|"calls"| node_preprocessing
node_preprocessing -->|"provides features"| node_model_training
node_trainer -->|"calls"| node_model_training
node_trainer -->|"calls"| node_evaluation
node_model_training -->|"evaluated by"| node_evaluation
node_trainer -->|"saves"| node_artifacts
node_evaluation -->|"metrics saved"| node_artifacts
node_applicant -->|"enters details"| node_streamlit
node_streamlit -->|"loads models"| node_artifact_loader
node_artifact_loader -->|"reads"| node_artifacts
node_streamlit -->|"submits inputs"| node_input_features
node_input_features -->|"provides features"| node_inference
node_streamlit -->|"requests prediction"| node_inference
node_inference -->|"returns decision"| node_prediction_result
node_streamlit -->|"displays"| node_prediction_result

click node_loan_data "https://github.com/sonalpriyanshi529/loanapprovalprediction/blob/main/Dataset/loan_data.csv"
click node_notebook "https://github.com/sonalpriyanshi529/loanapprovalprediction/blob/main/Notebook/Loan_Approval_Prediction.ipynb"
click node_trainer "https://github.com/sonalpriyanshi529/loanapprovalprediction/blob/main/train_model.py"
click node_preprocessing "https://github.com/sonalpriyanshi529/loanapprovalprediction/blob/main/train_model.py"
click node_model_training "https://github.com/sonalpriyanshi529/loanapprovalprediction/blob/main/train_model.py"
click node_evaluation "https://github.com/sonalpriyanshi529/loanapprovalprediction/blob/main/train_model.py"
click node_artifacts "https://github.com/sonalpriyanshi529/loanapprovalprediction/tree/main/Model"
click node_streamlit "https://github.com/sonalpriyanshi529/loanapprovalprediction/blob/main/Streamlit_App/app.py"
click node_artifact_loader "https://github.com/sonalpriyanshi529/loanapprovalprediction/blob/main/Streamlit_App/app.py"
click node_input_features "https://github.com/sonalpriyanshi529/loanapprovalprediction/blob/main/Streamlit_App/app.py"
click node_inference "https://github.com/sonalpriyanshi529/loanapprovalprediction/blob/main/Streamlit_App/app.py"
click node_prediction_result "https://github.com/sonalpriyanshi529/loanapprovalprediction/blob/main/Streamlit_App/app.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_notebook toneBlue
class node_loan_data,node_trainer,node_preprocessing,node_model_training,node_evaluation,node_artifacts toneAmber
class node_streamlit,node_artifact_loader,node_input_features,node_inference,node_prediction_result toneMint
class node_applicant toneIndigo
```

## Components

### Analysis

- [EDA and comparison](https://github.com/sonalpriyanshi529/loanapprovalprediction/blob/main/Notebook/Loan_Approval_Prediction.ipynb): `Notebook/Loan_Approval_Prediction.ipynb`

### Training

- [Loan dataset](https://github.com/sonalpriyanshi529/loanapprovalprediction/blob/main/Dataset/loan_data.csv): `Dataset/loan_data.csv`
- [Training orchestrator](https://github.com/sonalpriyanshi529/loanapprovalprediction/blob/main/train_model.py): `train_model.py`
- [Preprocessing and features](https://github.com/sonalpriyanshi529/loanapprovalprediction/blob/main/train_model.py): `train_model.py`
- [Model training](https://github.com/sonalpriyanshi529/loanapprovalprediction/blob/main/train_model.py): `train_model.py`
- [Model evaluation](https://github.com/sonalpriyanshi529/loanapprovalprediction/blob/main/train_model.py): `train_model.py`
- [Model artifacts](https://github.com/sonalpriyanshi529/loanapprovalprediction/tree/main/Model): `Model`

### Prediction app

- [Streamlit interface](https://github.com/sonalpriyanshi529/loanapprovalprediction/blob/main/Streamlit_App/app.py): `Streamlit_App/app.py`
- [Artifact loading](https://github.com/sonalpriyanshi529/loanapprovalprediction/blob/main/Streamlit_App/app.py): `Streamlit_App/app.py`
- [Input feature building](https://github.com/sonalpriyanshi529/loanapprovalprediction/blob/main/Streamlit_App/app.py): `Streamlit_App/app.py`
- [Approval inference](https://github.com/sonalpriyanshi529/loanapprovalprediction/blob/main/Streamlit_App/app.py): `Streamlit_App/app.py`
- [Decision and probabilities](https://github.com/sonalpriyanshi529/loanapprovalprediction/blob/main/Streamlit_App/app.py): `Streamlit_App/app.py`

### Other components

- **Applicant**

## Connections

- EDA and comparison → Loan dataset: analyzes
- Training orchestrator → Loan dataset: loads
- Training orchestrator → Preprocessing and features: calls
- Preprocessing and features → Model training: provides features
- Training orchestrator → Model training: calls
- Training orchestrator → Model evaluation: calls
- Model training → Model evaluation: evaluated by
- Training orchestrator → Model artifacts: saves
- Model evaluation → Model artifacts: metrics saved
- Applicant → Streamlit interface: enters details
- Streamlit interface → Artifact loading: loads models
- Artifact loading → Model artifacts: reads
- Streamlit interface → Input feature building: submits inputs
- Input feature building → Approval inference: provides features
- Streamlit interface → Approval inference: requests prediction
- Approval inference → Decision and probabilities: returns decision
- Streamlit interface → Decision and probabilities: displays
