Download app/utils/data_loader.py from Zirok05/CreditScoringSystemSimulation: direct link, hf CLI and curl.
- Browser
- Download file 846 Bytes
-
https://huggingface.co/spaces/Zirok05/CreditScoringSystemSimulation/resolve/main/app/utils/data_loader.py
- Command line
-
hf download hf://spaces/Zirok05/CreditScoringSystemSimulation/app/utils/data_loader.py
-
curl -L -o data_loader.py https://huggingface.co/spaces/Zirok05/CreditScoringSystemSimulation/resolve/main/app/utils/data_loader.py
846 Bytes
| import streamlit as st | |
| import joblib | |
| import os | |
| def load_artifacts(models_path, preprocessor_path): | |
| """Загрузка препроцессоров и моделей""" | |
| preprocessor = joblib.load(os.path.join(preprocessor_path, 'preprocessor_150.pkl')) | |
| scaler = joblib.load(os.path.join(preprocessor_path, 'scaler_150.pkl')) | |
| models = {} | |
| model_files = { | |
| 'Logistic Regression': 'logreg_150_model.pkl', | |
| 'XGBoost': 'xgb_150_model.pkl', | |
| 'LightGBM': 'lgbm_150_model.pkl', | |
| 'CatBoost': 'catboost_150_model.pkl', | |
| 'Random Forest': 'rfc_150_model.pkl' | |
| } | |
| for name, filename in model_files.items(): | |
| path = os.path.join(models_path, filename) | |
| if os.path.exists(path): | |
| models[name] = joblib.load(path) | |
| return preprocessor, scaler, models |