Update app.py
Browse files
app.py
CHANGED
|
@@ -84,9 +84,14 @@ def main():
|
|
| 84 |
# Make predictions
|
| 85 |
prediction = model.predict(input_data)
|
| 86 |
probability = model.predict_proba(input_data)[:, 1]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 87 |
|
| 88 |
# Display characteristic-based recommendations
|
| 89 |
-
st.subheader("
|
| 90 |
if job_satisfaction == 1 or environment_satisfaction == 1:
|
| 91 |
st.markdown("- Enhance job and environment satisfaction through initiatives such as recognition programs and improving workplace conditions.")
|
| 92 |
if years_since_last_promotion > 5:
|
|
|
|
| 84 |
# Make predictions
|
| 85 |
prediction = model.predict(input_data)
|
| 86 |
probability = model.predict_proba(input_data)[:, 1]
|
| 87 |
+
|
| 88 |
+
# Display prediction probability
|
| 89 |
+
if prediction[0] == 1:
|
| 90 |
+
st.subheader("Prediction Probability")
|
| 91 |
+
st.write(f"The probability of the employee leaving is: {probability[0]*100:.2f}%")
|
| 92 |
|
| 93 |
# Display characteristic-based recommendations
|
| 94 |
+
st.subheader("Recommendations for Retaining The Employee:")
|
| 95 |
if job_satisfaction == 1 or environment_satisfaction == 1:
|
| 96 |
st.markdown("- Enhance job and environment satisfaction through initiatives such as recognition programs and improving workplace conditions.")
|
| 97 |
if years_since_last_promotion > 5:
|