Spaces:
Sleeping
Sleeping
Download utils.py from QuantumTron/telecom-churn-streamlit: direct link, hf CLI and curl.
- Browser
- Download file 389 Bytes
-
https://huggingface.co/spaces/QuantumTron/telecom-churn-streamlit/resolve/main/utils.py
- Command line
-
hf download hf://spaces/QuantumTron/telecom-churn-streamlit/utils.py
-
curl -L -o utils.py https://huggingface.co/spaces/QuantumTron/telecom-churn-streamlit/resolve/main/utils.py
389 Bytes
| import joblib | |
| import pandas as pd | |
| import streamlit as st | |
| from pathlib import Path | |
| ROOT = Path(__file__).parent | |
| def load_model(): | |
| return joblib.load(ROOT / "churn_prediction_model_v1_0.joblib") | |
| def load_data(): | |
| csv_path = ROOT / "customer_churn_data.csv" | |
| if csv_path.exists(): | |
| return pd.read_csv(csv_path) | |
| return pd.DataFrame() | |