mns6rh commited on
Commit
d98b884
·
verified ·
1 Parent(s): c11d9ee

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +29 -29
app.py CHANGED
@@ -230,7 +230,35 @@ def predict(
230
  # Buttons
231
  # =========================
232
  def load_at_risk_group():
233
- # At risk group = average of Cluster 1 and Cluster 2
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
234
  avg = {v: (CLUSTER_1[v] + CLUSTER_2[v]) / 2.0 for v in ALL_DRIVER_VARS}
235
 
236
  headline, drivers_fig, shap_fig = predict(
@@ -257,34 +285,6 @@ def load_at_risk_group():
257
  )
258
 
259
 
260
- def apply_recommendation():
261
- # Apply recommendation = move to Cluster 3 target levels
262
- target = {v: CLUSTER_3[v] for v in ALL_DRIVER_VARS}
263
-
264
- headline, drivers_fig, shap_fig = predict(
265
- target["Engagement"],
266
- target["SupportiveGM"],
267
- target["WellBeing"],
268
- target["WorkEnvironment"],
269
- target["Voice"],
270
- target["DecisionAutonomy"],
271
- target["Workload"],
272
- )
273
-
274
- return (
275
- target["Engagement"],
276
- target["SupportiveGM"],
277
- target["WellBeing"],
278
- target["WorkEnvironment"],
279
- target["Voice"],
280
- target["DecisionAutonomy"],
281
- target["Workload"],
282
- headline,
283
- drivers_fig,
284
- shap_fig,
285
- )
286
-
287
-
288
  # =========================
289
  # UI Layout (tight, no big gaps)
290
  # =========================
 
230
  # Buttons
231
  # =========================
232
  def load_at_risk_group():
233
+ # At-risk group = Cluster 3 (lowest means)
234
+ target = {v: CLUSTER_3[v] for v in ALL_DRIVER_VARS}
235
+
236
+ headline, drivers_fig, shap_fig = predict(
237
+ target["Engagement"],
238
+ target["SupportiveGM"],
239
+ target["WellBeing"],
240
+ target["WorkEnvironment"],
241
+ target["Voice"],
242
+ target["DecisionAutonomy"],
243
+ target["Workload"],
244
+ )
245
+
246
+ return (
247
+ target["Engagement"],
248
+ target["SupportiveGM"],
249
+ target["WellBeing"],
250
+ target["WorkEnvironment"],
251
+ target["Voice"],
252
+ target["DecisionAutonomy"],
253
+ target["Workload"],
254
+ headline,
255
+ drivers_fig,
256
+ shap_fig,
257
+ )
258
+
259
+ def apply_recommendation():
260
+ # Recommendation = move toward high performers
261
+ # average of Cluster 1 and Cluster 2
262
  avg = {v: (CLUSTER_1[v] + CLUSTER_2[v]) / 2.0 for v in ALL_DRIVER_VARS}
263
 
264
  headline, drivers_fig, shap_fig = predict(
 
285
  )
286
 
287
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
288
  # =========================
289
  # UI Layout (tight, no big gaps)
290
  # =========================