title | emoji | colorFrom | colorTo | sdk | app_port | pinned | license |
---|---|---|---|---|---|---|---|
Credit Risk Modeling |
📈 |
indigo |
blue |
docker |
8501 |
false |
openrail |
An interactive tool demonstrating credit risk modelling.
Emphasis on:
- Building models
- Comparing techniques
- Interpretating results
Processor: 11th Gen Intel(R) Core(TM) i7-1165G7 @2.80Ghz, 2803 Mhz, 4 Core(s), 8 Logical Processor(s)
Memory (RAM): 16GB
git clone https://github.com/pkiage/tool-credit-risk-modelling.git
or
gh repo clone pkiage/tool-credit-risk-modelling
Download ZIP
python -m venv venv
.\venv\bin\activate
.\venv\Scripts\activate
pip install -r requirements.txt
https://graphviz.org/download/
streamlit app.py
Hugging Face Space Deployment Tips
Initial Setup
- When creating the Spaces Configuration Reference check logs to specify the Docker Space app_port based on build
- In Dockerfile bind Streamlit to a port e.g. 0.0.0.0
- Install Graphiz on Debian rather than use Streamlit Space to solve
failed to execute posixpath('dot'), make sure the graphviz executables are on your systems' path
error given don't have access to terminal with Streamlit Space
git remote add space https://huggingface.co/spaces/pkiage/credit_risk_modeling_demo
git push --force space main
- When syncing with Hugging Face via Github Actions the User Access Token created on Hugging Face (HF) should have write access
- Run space from main branch since running from other branches currently isn't suppported
- Ensure integrate remote changes (
git pull
) before push to HF space (git push --force space main
)
To view/submit ideas as well as contribute please view issues.
pydeps Python module depenency visualization
Delete init.py and main.py then run the following
pydeps src/app.py --max-bacon=5 --cluster --rankdir BT -o docs/module-dependency-graph/src-app-clustered.svg
Features, models, & visualization links:
pydeps src/app.py --only features models visualization --max-bacon=4 --rankdir BT -o docs/module-dependency-graph/src-feature-model-visualization.svg
pydeps src/app.py --only features --max-bacon=5 --cluster --max-cluster-size=3 --rankdir BT -o docs/module-dependency-graph/src-features.svg
pydeps src/app.py --only models --max-bacon=5 --cluster --max-cluster-size=15 --rankdir BT -o docs/module-dependency-graph/src-models.svg
code2flow Call graphs for a pretty good estimate of project structure
code2flow src/models/logistic_train_model.py -o docs/call-graph/logistic_train_model.svg
code2flow src/models/logistic_model.py -o docs/call-graph/logistic_model.svg
code2flow src/models/xgboost_train_model.py -o docs/call-graph/xgboost_train_model.svg
code2flow src/models/xgboost_model.py -o docs/call-graph/xgboost_model.svg
code2flow src/models/util_test.py -o docs/call-graph/util_test.svg
code2flow src/models/util_predict_model_threshold.py -o docs/call-graph/util_predict_model_threshold.svg
code2flow src/models/util_predict_model.py -o docs/call-graph/util_predict_model.svg
code2flow src/models/util_model_comparison.py -o docs/call-graph/util_model_comparison.svg
Credit Risk Modeling in Python by Datacamp
- General Methodology
- Data
A Gentle Introduction to Threshold-Moving for Imbalanced Classification
- Selecting optimal threshold using Youden's J statistic