Credit Risk Assessment Model

信用風險評估模型分析工具

基於 Logistic Regression 的信用風險評估系統,透過多階段變數篩選與模型訓練, 建構企業違約預測模型。

Logistic Regression Stepwise Selection ROC / AUC Python / Gradio

Project Overview / 專案概述

📊

Single Factor Analysis

單因子分析

對每個變數進行個別 Logistic Regression, 以 P-value 篩選具統計顯著性的變數。

🔗

Correlation Analysis

相關性分析

計算變數間相關係數矩陣,移除高度共線性變數, 降低多重共線性對模型的影響。

🔍

Stepwise Regression

逐步回歸

透過前向選擇與後向淘汰的逐步回歸法, 在限制條件下選出最佳變數子集。

🎯

Model Evaluation

模型評估

使用 ROC 曲線、AUC、混淆矩陣、 Type I/II Error 全面評估模型效能。

Methodology / 分析流程

1

Data Upload

資料上傳

上傳財務變數與類別變數 CSV 檔案,自動翻譯中文欄位名稱為英文

2

Variable Screening

變數篩選

以 P-value 門檻進行單因子分析,篩選出統計顯著變數

3

Correlation Filter

相關性過濾

移除高度相關變數,產生相關係數熱力圖

4

Stepwise Selection

逐步選擇

設定財務 / 類別變數數量上限,逐步回歸選出最佳組合

5

Model Training

模型訓練

Logistic Regression 訓練,產生 ROC 曲線與混淆矩陣

Key Statistical Methods / 主要統計方法

Method Description Purpose
Z-score Standardization 將財務變數標準化至均值 0、標準差 1,並裁切至 ±2 消除量綱差異
Logistic Regression 以 Maximum Likelihood Estimation 擬合二元分類模型 預測違約機率
Stepwise Regression Forward Selection + Backward Elimination 自動變數選擇
ROC / AUC 繪製 Receiver Operating Characteristic 曲線 評估分類效能
Confusion Matrix 計算 TP, TN, FP, FN 及 Type I / II Error 閾值優化

Interactive App / 互動式應用

以下嵌入部署於 Hugging Face Spaces 的 Gradio 應用程式。 請依序操作各分頁完成完整的信用風險模型建構流程。

Credit Risk Assessment Model

Open in Hugging Face →

If the embedded app does not load, please visit Hugging Face Space directly.

Data Format / 資料格式

Financial Variables CSV (CreditFinx.csv)

財務變數檔案

ColumnDescription
Index (first column)Company / Sample ID
YTarget variable (0 = Non-default, 1 = Default)
Other columnsFinancial ratio features (continuous)

Categorical Variables CSV (CreditDumx.csv)

類別變數檔案

ColumnDescription
Index (first column)Company / Sample ID
Other columnsDummy / categorical features (0 or 1)

Tech Stack / 技術棧

Python Gradio Pandas NumPy Statsmodels Scikit-learn Matplotlib Seaborn Deep Translator python-docx Hugging Face Spaces GitHub Pages