Zeyadd-Mostaffa commited on
Commit
b444f01
Β·
verified Β·
1 Parent(s): b59b8da

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -2
app.py CHANGED
@@ -60,7 +60,9 @@ def predict_employee_status(satisfaction_level, last_evaluation, number_project,
60
  try:
61
  dmatrix = xgb.DMatrix(input_df)
62
  prediction = model.predict(dmatrix)
63
- return "βœ… Employee is likely to quit." if prediction[0] > 0.5 else "βœ… Employee is likely to stay."
 
 
64
  except Exception as e:
65
  return f"❌ Error: {str(e)}"
66
 
@@ -84,7 +86,8 @@ interface = gr.Interface(
84
  ],
85
  outputs="text",
86
  title="Employee Retention Prediction System",
87
- description="Predict whether an employee is likely to stay or quit based on their profile."
 
88
  )
89
 
90
  interface.launch()
 
60
  try:
61
  dmatrix = xgb.DMatrix(input_df)
62
  prediction = model.predict(dmatrix)
63
+ prediction_prob = prediction[0]
64
+ result = "βœ… Employee is likely to quit." if prediction_prob > 0.5 else "βœ… Employee is likely to stay."
65
+ return f"{result} (Probability: {prediction_prob:.2%})"
66
  except Exception as e:
67
  return f"❌ Error: {str(e)}"
68
 
 
86
  ],
87
  outputs="text",
88
  title="Employee Retention Prediction System",
89
+ description="Predict whether an employee is likely to stay or quit based on their profile.",
90
+ theme="dark"
91
  )
92
 
93
  interface.launch()