Files changed (1) hide show
  1. app.py +2 -2
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 = round(shap_val * 10, 2)
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 {abs(impact)}%.</b></p>"
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