Spaces:
Build error
Build error
Upload folder using huggingface_hub
Browse files
app.py
CHANGED
|
@@ -11,15 +11,13 @@ st.title("Customer Status Prediction")
|
|
| 11 |
st.write("""
|
| 12 |
This web app predicts the **status** of a customer based on their activity and profile information.
|
| 13 |
""")
|
|
|
|
|
|
|
|
|
|
|
|
|
| 14 |
|
| 15 |
-
|
| 16 |
-
@st.cache_data
|
| 17 |
-
def load_model(model_path):
|
| 18 |
-
with open(model_path, "rb") as f:
|
| 19 |
-
model = pickle.load(f)
|
| 20 |
-
return model
|
| 21 |
|
| 22 |
-
model = load_model("best_model.pkl") # Replace with your model path
|
| 23 |
|
| 24 |
# 3️⃣ Create UI for user input
|
| 25 |
st.sidebar.header("Provide Input Features")
|
|
|
|
| 11 |
st.write("""
|
| 12 |
This web app predicts the **status** of a customer based on their activity and profile information.
|
| 13 |
""")
|
| 14 |
+
# Load the trained model
|
| 15 |
+
@st.cache_resource
|
| 16 |
+
def load_model():
|
| 17 |
+
return joblib.load("my_model_v1_0.joblib")
|
| 18 |
|
| 19 |
+
model = load_model()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 20 |
|
|
|
|
| 21 |
|
| 22 |
# 3️⃣ Create UI for user input
|
| 23 |
st.sidebar.header("Provide Input Features")
|