mns6rh commited on
Commit
4734da8
·
verified ·
1 Parent(s): 1c0e717

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +18 -19
app.py CHANGED
@@ -276,8 +276,8 @@ def predict(
276
  # Buttons
277
  # =========================
278
  def load_at_risk_group():
279
- # At-risk group = Cluster 3 (lowest means)
280
- target = {v: CLUSTER_3[v] for v in ALL_DRIVER_VARS}
281
 
282
  headline, drivers_fig, shap_fig = predict(
283
  target["Engagement"],
@@ -304,28 +304,27 @@ def load_at_risk_group():
304
 
305
 
306
  def apply_recommendation():
307
- # Recommendation = move toward high performers
308
- # average of Cluster 1 and Cluster 2
309
- avg = {v: (CLUSTER_1[v] + CLUSTER_2[v]) / 2.0 for v in ALL_DRIVER_VARS}
310
 
311
  headline, drivers_fig, shap_fig = predict(
312
- avg["Engagement"],
313
- avg["SupportiveGM"],
314
- avg["WellBeing"],
315
- avg["WorkEnvironment"],
316
- avg["Voice"],
317
- avg["DecisionAutonomy"],
318
- avg["Workload"],
319
  )
320
 
321
  return (
322
- avg["Engagement"],
323
- avg["SupportiveGM"],
324
- avg["WellBeing"],
325
- avg["WorkEnvironment"],
326
- avg["Voice"],
327
- avg["DecisionAutonomy"],
328
- avg["Workload"],
329
  headline,
330
  drivers_fig,
331
  shap_fig,
 
276
  # Buttons
277
  # =========================
278
  def load_at_risk_group():
279
+ # At-risk group = average of the two lowest clusters (2 and 3)
280
+ target = {v: (CLUSTER_2[v] + CLUSTER_3[v]) / 2.0 for v in ALL_DRIVER_VARS}
281
 
282
  headline, drivers_fig, shap_fig = predict(
283
  target["Engagement"],
 
304
 
305
 
306
  def apply_recommendation():
307
+ # Recommendation = highest cluster (Cluster 1)
308
+ target = {v: CLUSTER_1[v] for v in ALL_DRIVER_VARS}
 
309
 
310
  headline, drivers_fig, shap_fig = predict(
311
+ target["Engagement"],
312
+ target["SupportiveGM"],
313
+ target["WellBeing"],
314
+ target["WorkEnvironment"],
315
+ target["Voice"],
316
+ target["DecisionAutonomy"],
317
+ target["Workload"],
318
  )
319
 
320
  return (
321
+ target["Engagement"],
322
+ target["SupportiveGM"],
323
+ target["WellBeing"],
324
+ target["WorkEnvironment"],
325
+ target["Voice"],
326
+ target["DecisionAutonomy"],
327
+ target["Workload"],
328
  headline,
329
  drivers_fig,
330
  shap_fig,