# rayhan1705/4911-resikokredit architecture

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

- Interactive diagram: https://gitdiagram.com/rayhan1705/4911-resikokredit
- Repository: https://github.com/rayhan1705/4911-resikokredit

## Overview

This is a small Streamlit credit-risk prediction app. Users enter demographic and loan details, the app validates employment length and displays a summary, then scales the features and predicts default risk using a selected XGBoost or Random Forest model. The graph reflects the single sampled runtime file; the notebook, dataset, and serialized assets are present in the tree, but their contents and use are not established by the excerpts.

Main entry points: [`app.py`](https://github.com/rayhan1705/4911-resikokredit/blob/main/app.py) (Prediction flow), [`scaler.pkl`](https://github.com/rayhan1705/4911-resikokredit/blob/main/scaler.pkl) (Feature scaler), [`model_xgboost.pkl`](https://github.com/rayhan1705/4911-resikokredit/blob/main/model_xgboost.pkl) (XGBoost model), [`model_random_forest.pkl`](https://github.com/rayhan1705/4911-resikokredit/blob/main/model_random_forest.pkl) (Random Forest model)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["User interface"]
  node_inputs["Input and validation<br/>[app.py]"]
  node_summary["Applicant summary<br/>[app.py]"]
  node_results["Risk results<br/>[app.py]"]
end

subgraph group_prediction["Prediction runtime"]
  node_predict["Prediction flow<br/>[app.py]"]
end

subgraph group_assets["Model assets"]
  node_scaler["Feature scaler<br/>[scaler.pkl]"]
  node_xgb["XGBoost model<br/>[model_xgboost.pkl]"]
  node_rf["Random Forest model"]
  node_encoders["Label encoders<br/>[label_encoders.pkl]"]
end

node_borrower(("Applicant"))

node_borrower -->|"enters data"| node_inputs
node_inputs -->|"displays summary"| node_summary
node_inputs -->|"provides validated data"| node_predict
node_predict -->|"scales features"| node_scaler
node_predict -->|"predicts with"| node_xgb
node_predict -->|"predicts with"| node_rf
node_predict -->|"renders prediction"| node_results

click node_inputs "https://github.com/rayhan1705/4911-resikokredit/blob/main/app.py"
click node_summary "https://github.com/rayhan1705/4911-resikokredit/blob/main/app.py"
click node_predict "https://github.com/rayhan1705/4911-resikokredit/blob/main/app.py"
click node_scaler "https://github.com/rayhan1705/4911-resikokredit/blob/main/scaler.pkl"
click node_xgb "https://github.com/rayhan1705/4911-resikokredit/blob/main/model_xgboost.pkl"
click node_rf "https://github.com/rayhan1705/4911-resikokredit/blob/main/model_random_forest.pkl"
click node_results "https://github.com/rayhan1705/4911-resikokredit/blob/main/app.py"
click node_encoders "https://github.com/rayhan1705/4911-resikokredit/blob/main/label_encoders.pkl"

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_inputs,node_summary,node_results toneBlue
class node_predict toneAmber
class node_scaler,node_xgb,node_rf,node_encoders toneMint
class node_borrower toneIndigo
```

## Components

### User interface

- [Input and validation](https://github.com/rayhan1705/4911-resikokredit/blob/main/app.py): `app.py`
- [Applicant summary](https://github.com/rayhan1705/4911-resikokredit/blob/main/app.py): `app.py`
- [Risk results](https://github.com/rayhan1705/4911-resikokredit/blob/main/app.py): `app.py`

### Prediction runtime

- [Prediction flow](https://github.com/rayhan1705/4911-resikokredit/blob/main/app.py): `app.py`

### Model assets

- [Feature scaler](https://github.com/rayhan1705/4911-resikokredit/blob/main/scaler.pkl): `scaler.pkl`
- [XGBoost model](https://github.com/rayhan1705/4911-resikokredit/blob/main/model_xgboost.pkl): `model_xgboost.pkl`
- [Random Forest model](https://github.com/rayhan1705/4911-resikokredit/blob/main/model_random_forest.pkl): `model_random_forest.pkl`
- [Label encoders](https://github.com/rayhan1705/4911-resikokredit/blob/main/label_encoders.pkl): `label_encoders.pkl`

### Other components

- **Applicant**

## Connections

- Applicant → Input and validation: enters data (evidence: `app.py`)
- Input and validation → Applicant summary: displays summary (evidence: `app.py`)
- Input and validation → Prediction flow: provides validated data (evidence: `app.py`)
- Prediction flow → Feature scaler: scales features (evidence: `app.py`)
- Prediction flow → XGBoost model: predicts with (evidence: `app.py`)
- Prediction flow → Random Forest model: predicts with (evidence: `app.py`)
- Prediction flow → Risk results: renders prediction (evidence: `app.py`)
