pantdipendra commited on
Commit
87dd6c1
·
verified ·
1 Parent(s): 685722d

v6_remove unused labels

Browse files
Files changed (1) hide show
  1. app.py +4 -9
app.py CHANGED
@@ -36,9 +36,7 @@ class ModelPredictor:
36
  self.prediction_map = {
37
  "YOWRCONC": ["Did NOT have difficulty concentrating", "Had difficulty concentrating"],
38
  "YOSEEDOC": ["Did NOT feel the need to see a doctor", "Felt the need to see a doctor"],
39
- "YOWRHRS": ["No trouble sleeping", "Had trouble sleeping"],
40
  "YO_MDEA5": ["No restlessness/lethargy noticed", "Others noticed restlessness/lethargy"],
41
- "YOWRCHR": ["Did NOT feel so sad", "Felt so sad nothing could cheer up"],
42
  "YOWRLSIN": ["Did NOT feel bored/lose interest", "Felt bored/lost interest"],
43
  "YODPPROB": ["No other problems for 2+ weeks", "Had other problems for 2+ weeks"],
44
  "YOWRPROB": ["No 'worst time ever' feeling", "Had 'worst time ever' feeling"],
@@ -51,9 +49,7 @@ class ModelPredictor:
51
  "YO_MDEA3": ["No appetite/weight changes", "Had changes in appetite/weight"],
52
  "YODPLSIN": ["Never lost interest/felt bored", "Lost interest/felt bored"],
53
  "YOWRELES": ["Did NOT eat less than usual", "Ate less than usual"],
54
- "YODSCEV": ["Fewer severe depression symptoms", "More severe depression symptoms"],
55
- "YOPB2WK": ["No uneasy feelings 2+ weeks", "Uneasy feelings 2+ weeks"],
56
- "YO_MDEA2": ["No physical/mental issues for 2+ wks", "Had physical/mental issues 2+ wks"]
57
  }
58
 
59
  def load_models(self):
@@ -331,9 +327,9 @@ def predict(
331
  # Group them by domain
332
  domain_groups = {
333
  "Concentration and Decision Making": ["YOWRCONC", "YOWRDCSN"],
334
- "Sleep and Energy Levels": ["YOWRHRS", "YO_MDEA5", "YOWRELES", "YO_MDEA2"],
335
  "Mood and Emotional State": [
336
- "YOWRCHR", "YOWRLSIN", "YOWRDEPR", "YODPDISC", "YOLOSEV", "YODPLSIN", "YODSCEV"
337
  ],
338
  "Appetite and Weight Changes": ["YO_MDEA3", "YOWRELES"],
339
  "Duration and Severity of Depression Symptoms": [
@@ -425,7 +421,6 @@ def combined_plot(feature_list, label_col):
425
  If user picks 1 feature => distribution plot.
426
  If user picks 2 features => co-occurrence plot.
427
  Otherwise => show error or empty plot.
428
-
429
  This function also maps numeric codes to text using 'input_mapping'
430
  and 'predictor.prediction_map' so that the plots display more readable labels.
431
  """
@@ -624,4 +619,4 @@ with gr.Blocks(css=".gradio-container {max-width: 1200px;}") as demo:
624
  )
625
 
626
  # Finally, launch the Gradio app
627
- demo.launch()
 
36
  self.prediction_map = {
37
  "YOWRCONC": ["Did NOT have difficulty concentrating", "Had difficulty concentrating"],
38
  "YOSEEDOC": ["Did NOT feel the need to see a doctor", "Felt the need to see a doctor"],
 
39
  "YO_MDEA5": ["No restlessness/lethargy noticed", "Others noticed restlessness/lethargy"],
 
40
  "YOWRLSIN": ["Did NOT feel bored/lose interest", "Felt bored/lost interest"],
41
  "YODPPROB": ["No other problems for 2+ weeks", "Had other problems for 2+ weeks"],
42
  "YOWRPROB": ["No 'worst time ever' feeling", "Had 'worst time ever' feeling"],
 
49
  "YO_MDEA3": ["No appetite/weight changes", "Had changes in appetite/weight"],
50
  "YODPLSIN": ["Never lost interest/felt bored", "Lost interest/felt bored"],
51
  "YOWRELES": ["Did NOT eat less than usual", "Ate less than usual"],
52
+ "YOPB2WK": ["No uneasy feelings 2+ weeks", "Uneasy feelings 2+ weeks"]
 
 
53
  }
54
 
55
  def load_models(self):
 
327
  # Group them by domain
328
  domain_groups = {
329
  "Concentration and Decision Making": ["YOWRCONC", "YOWRDCSN"],
330
+ "Sleep and Energy Levels": ["YO_MDEA5", "YOWRELES"],
331
  "Mood and Emotional State": [
332
+ "YOWRLSIN", "YOWRDEPR", "YODPDISC", "YOLOSEV", "YODPLSIN"
333
  ],
334
  "Appetite and Weight Changes": ["YO_MDEA3", "YOWRELES"],
335
  "Duration and Severity of Depression Symptoms": [
 
421
  If user picks 1 feature => distribution plot.
422
  If user picks 2 features => co-occurrence plot.
423
  Otherwise => show error or empty plot.
 
424
  This function also maps numeric codes to text using 'input_mapping'
425
  and 'predictor.prediction_map' so that the plots display more readable labels.
426
  """
 
619
  )
620
 
621
  # Finally, launch the Gradio app
622
+ demo.launch()