Spaces:
Sleeping
Sleeping
Update app.py
Browse files
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 |
-
|
|
|
|
|
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()
|