Upload app.py
Browse files
app.py
CHANGED
@@ -85,6 +85,7 @@ data_final = preprocess.transform(data)
|
|
85 |
if st.button('Predict'):
|
86 |
prediction = model.predict(data_final)
|
87 |
prediction = np.where(prediction >= 0.5, 1, 0)
|
|
|
88 |
|
89 |
if prediction == 0:
|
90 |
prediction = 'Congratulations, this person most likely will stay!'
|
@@ -92,4 +93,5 @@ if st.button('Predict'):
|
|
92 |
prediction = 'Churn alert, we need to save this person!'
|
93 |
|
94 |
st.write('Prediction result: ')
|
95 |
-
st.write(prediction)
|
|
|
|
85 |
if st.button('Predict'):
|
86 |
prediction = model.predict(data_final)
|
87 |
prediction = np.where(prediction >= 0.5, 1, 0)
|
88 |
+
confidence = model.evaluate(data_final)
|
89 |
|
90 |
if prediction == 0:
|
91 |
prediction = 'Congratulations, this person most likely will stay!'
|
|
|
93 |
prediction = 'Churn alert, we need to save this person!'
|
94 |
|
95 |
st.write('Prediction result: ')
|
96 |
+
st.write(prediction)
|
97 |
+
st.write(f'Confidence level: {confidence[1]:.2f}%')
|