rasmodev commited on
Commit
e4540d7
ยท
verified ยท
1 Parent(s): 99b3ca1

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -6
app.py CHANGED
@@ -34,19 +34,14 @@ st.image("https://www.aihr.com/wp-content/uploads/Reasons-for-Employee-Attrition
34
 
35
  # Link to Detailed Article on Employee Attrition
36
  st.markdown("๐Ÿ”— **Learn more about employee attrition from [Academy to Innovate HR (AIHR)](https://www.aihr.com/wp-content/uploads/Reasons-for-Employee-Attrition.png)**")
37
-
38
  st.markdown("---")
39
 
40
- # Display an icon representing employee attrition
41
- st.markdown('<i class="fas fa-user-slash"></i> Employee Attrition', unsafe_allow_html=True)
42
-
43
-
44
  # Additional Information for Sample Prediction
45
  st.write("๐Ÿ“Š To make a prediction, input the information of the employee whose attrition you want to predict.")
46
  st.write("Please provide the following information to make a prediction:")
47
 
48
  # About Section with Style
49
- st.sidebar.title("โ„น๏ธ About")
50
  st.sidebar.info(
51
  "This app predicts employee attrition using machine learning on HR data, aiding HR professionals in retention strategies. "
52
  "It utilizes a CatBoost machine learning model trained on an employee attrition dataset."
@@ -124,6 +119,13 @@ def main():
124
  # Make predictions
125
  prediction = model.predict(input_data)
126
  probability = model.predict_proba(input_data)[:, 1]
 
 
 
 
 
 
 
127
 
128
  # Display prediction probability
129
  if prediction[0] == 1:
 
34
 
35
  # Link to Detailed Article on Employee Attrition
36
  st.markdown("๐Ÿ”— **Learn more about employee attrition from [Academy to Innovate HR (AIHR)](https://www.aihr.com/wp-content/uploads/Reasons-for-Employee-Attrition.png)**")
 
37
  st.markdown("---")
38
 
 
 
 
 
39
  # Additional Information for Sample Prediction
40
  st.write("๐Ÿ“Š To make a prediction, input the information of the employee whose attrition you want to predict.")
41
  st.write("Please provide the following information to make a prediction:")
42
 
43
  # About Section with Style
44
+ st.sidebar.title("About")
45
  st.sidebar.info(
46
  "This app predicts employee attrition using machine learning on HR data, aiding HR professionals in retention strategies. "
47
  "It utilizes a CatBoost machine learning model trained on an employee attrition dataset."
 
119
  # Make predictions
120
  prediction = model.predict(input_data)
121
  probability = model.predict_proba(input_data)[:, 1]
122
+
123
+ # Display predicted attrition status
124
+ st.subheader("Predicted Attrition Status ๐Ÿ”ฎ")
125
+ if prediction[0] == 1:
126
+ st.error("Employee is predicted to leave (Attrition = Yes)")
127
+ else:
128
+ st.success("Employee is predicted to stay (Attrition = No)")
129
 
130
  # Display prediction probability
131
  if prediction[0] == 1: