Spaces:
Running
Running
Update app.py
#12
by
sjalbright
- opened
app.py
CHANGED
@@ -74,10 +74,10 @@ def main_func(Generation_Label, WellBeing, SupportiveGM, Engagement, Workload, W
|
|
74 |
shap_values_df = shap_values_df.drop(columns=["Generation"]) # Drop Generation
|
75 |
for feature in shap_values_df.columns:
|
76 |
shap_val = shap_values_df[feature].values[0]
|
77 |
-
impact =
|
78 |
icon = "π" if shap_val > 0 else "π"
|
79 |
effect = "raises turnover risk" if shap_val > 0 else "improves retention"
|
80 |
-
risk_html += f"<p style='margin: 5px 0;'> {icon} <b>Each 1-point increase in {feature} {effect} by {
|
81 |
|
82 |
risk_html += "</div></div>"
|
83 |
|
|
|
74 |
shap_values_df = shap_values_df.drop(columns=["Generation"]) # Drop Generation
|
75 |
for feature in shap_values_df.columns:
|
76 |
shap_val = shap_values_df[feature].values[0]
|
77 |
+
impact = f"{abs(shap_val * 1):.2f}" # FIXED: Correct decimal place
|
78 |
icon = "π" if shap_val > 0 else "π"
|
79 |
effect = "raises turnover risk" if shap_val > 0 else "improves retention"
|
80 |
+
risk_html += f"<p style='margin: 5px 0;'> {icon} <b>Each 1-point increase in {feature} {effect} by {impact}%.</b></p>"
|
81 |
|
82 |
risk_html += "</div></div>"
|
83 |
|