Update My Project File.
Browse files
app.py
CHANGED
@@ -81,6 +81,31 @@ def predict_churn(gender, SeniorCitizen, Partner, Dependents, tenure,
|
|
81 |
prediction = model.predict(processed_df)
|
82 |
return "Churn" if prediction[0] == 1 else "No Churn"
|
83 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
84 |
# Launch the Gradio app
|
85 |
iface = gr.Interface(predict_churn, inputs=input_components, outputs=output_components)
|
86 |
iface.launch(inbrowser= True, show_error= True)
|
|
|
81 |
prediction = model.predict(processed_df)
|
82 |
return "Churn" if prediction[0] == 1 else "No Churn"
|
83 |
|
84 |
+
|
85 |
+
# Add Image Tags
|
86 |
+
gr.markdown(
|
87 |
+
"""
|
88 |
+
<div class="row">
|
89 |
+
<div class="column">
|
90 |
+
<img src="https://user-images.githubusercontent.com/115732734/271723332-6c824e95-5e2f-48ec-af1c-b66ac7db1d7a.jpeg" style="width:550"></div>
|
91 |
+
|
92 |
+
<div class="column">
|
93 |
+
<img src="https://user-images.githubusercontent.com/115732734/271723345-50f27ca9-94ee-4e7c-ad3b-2b10f27d31bb.jpeg" style="width:550"></div>
|
94 |
+
</div>
|
95 |
+
<style>
|
96 |
+
.row {
|
97 |
+
display: flex;
|
98 |
+
}
|
99 |
+
.column {
|
100 |
+
flex: 33.33%;
|
101 |
+
padding: 5px;
|
102 |
+
}
|
103 |
+
</style>
|
104 |
+
""",
|
105 |
+
unsafe_allow_html=True
|
106 |
+
)
|
107 |
+
|
108 |
+
|
109 |
# Launch the Gradio app
|
110 |
iface = gr.Interface(predict_churn, inputs=input_components, outputs=output_components)
|
111 |
iface.launch(inbrowser= True, show_error= True)
|