Spaces:
Sleeping
Sleeping
Azie88
commited on
Commit
·
f9a5f05
1
Parent(s):
8fce87c
app update
Browse files- app.py +7 -8
- styles.css +0 -23
app.py
CHANGED
@@ -66,8 +66,11 @@ def predict(SeniorCitizen, Partner, Dependents, tenure,
|
|
66 |
final_df = pd.concat([remaining_columns, first_three_columns], axis=1)
|
67 |
|
68 |
# Make predictions using the model
|
69 |
-
|
70 |
-
prediction_label =
|
|
|
|
|
|
|
71 |
|
72 |
return prediction_label
|
73 |
|
@@ -136,9 +139,5 @@ with gr.Blocks(theme=gr.themes.Soft()) as app:
|
|
136 |
""")
|
137 |
|
138 |
predict_btn.click(fn=predict, inputs=input_interface, outputs=output_interface)
|
139 |
-
|
140 |
-
app.launch(share=True
|
141 |
-
|
142 |
-
# Include the custom CSS file
|
143 |
-
app.queue() # Enable queueing for shared links
|
144 |
-
app.launch(share=True, inline=False, custom_css="style.css")
|
|
|
66 |
final_df = pd.concat([remaining_columns, first_three_columns], axis=1)
|
67 |
|
68 |
# Make predictions using the model
|
69 |
+
prediction_probs = model.predict_proba(final_df)[0]
|
70 |
+
prediction_label = {
|
71 |
+
"Prediction: CHURN 🔴": prediction_probs[1],
|
72 |
+
"Prediction: STAY ✅": prediction_probs[0]
|
73 |
+
}
|
74 |
|
75 |
return prediction_label
|
76 |
|
|
|
139 |
""")
|
140 |
|
141 |
predict_btn.click(fn=predict, inputs=input_interface, outputs=output_interface)
|
142 |
+
|
143 |
+
app.launch(share=True)
|
|
|
|
|
|
|
|
styles.css
DELETED
@@ -1,23 +0,0 @@
|
|
1 |
-
body {
|
2 |
-
background-color: #121212;
|
3 |
-
color: #ffffff;
|
4 |
-
}
|
5 |
-
|
6 |
-
.gradio-container {
|
7 |
-
background-color: #121212;
|
8 |
-
color: #ffffff;
|
9 |
-
}
|
10 |
-
|
11 |
-
.gr-input, .gr-label, .gr-button, .gr-radio, .gr-slider {
|
12 |
-
background-color: #333333;
|
13 |
-
color: #ffffff;
|
14 |
-
border-color: #444444;
|
15 |
-
}
|
16 |
-
|
17 |
-
.gr-button {
|
18 |
-
background-color: #444444;
|
19 |
-
}
|
20 |
-
|
21 |
-
.gr-button:hover {
|
22 |
-
background-color: #555555;
|
23 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|