sdbrgo commited on
Commit
49627a9
Β·
verified Β·
1 Parent(s): 9b456ab

Update phase/compute.py

Browse files

modified PCI description to be dynamic

Files changed (1) hide show
  1. phase/compute.py +16 -7
phase/compute.py CHANGED
@@ -45,21 +45,30 @@ class ParticipationAdoptionIndex:
45
 
46
  # ----- percent-based values -----
47
  final_pcr = round(pcr * 100, 2)
 
 
48
  final_peg = round(peg * 100, 2)
49
- final_pci = round(pci * 100, 2)
 
 
 
 
50
 
51
  self.components_1 = {
52
- "PCR (Participation Coverage Ratio)": {"Value": final_pcr, "Description": "β‰ˆ100 β†’ Participation closely matches the target population. β‰ˆ0 β†’ Participation reached very few of the intended population."},
53
- "SPI-A (Silent Participation Inference - Silent Non-Adoption)": {"Value": spi_a, "Description": "High β†’ Large segments of the target population were not reached or excluded. Low β†’ Minimal non-participation across the target population."},
54
- "SPI-B (Silent Participation Inference - Silent Adoption)": {"Value": spi_b, "Description": "High β†’ Silent participation dominates. Low β†’ Expressive participation dominates."},
55
- "PEG (Participation-to-Expression Gap)": {"Value": final_peg, "Description": "β‰ˆ100 β†’ High expression gap among participants. β‰ˆ0 β†’ Minimal expression gap."}
56
  }
57
 
58
  self.components_2 = {
59
  "PCI (Participation Concentration Index)":
60
  {"Value": final_pci,
61
- "Description": "β‰ˆ100 β†’ Participation is concentrated to certain groups. β‰ˆ0 β†’ Participation is balanced across groups."
62
- },
 
 
 
63
  "Group Summary":
64
  {"Minimum Participating Groups": f"At least {effective_groups_int} groups meaningfully participated.",
65
  "Effective Participation Groups": f"Participation is roughly equivalent to {effective_groups_rounded} equally sized groups."
 
45
 
46
  # ----- percent-based values -----
47
  final_pcr = round(pcr * 100, 2)
48
+ final_spi_a = round(spi_a * 100, 2)
49
+ final_spi_b = round(spi_b * 100, 2)
50
  final_peg = round(peg * 100, 2)
51
+ final_pci = round(pci, 2)
52
+
53
+ # ----- pci pivot value -----
54
+ pic_mid = 0.5
55
+ # ---------------------------
56
 
57
  self.components_1 = {
58
+ "PCR (Participation Coverage Ratio)": {"Value": final_pcr, "Description": f"{final_pcr}% of the target population has participated."},
59
+ "SPI-A (Silent Participation Inference - Silent Non-Adoption)": {"Value": final_spi_a, "Description": f"{final_spi_a}% of the target population were not reached or excluded."},
60
+ "SPI-B (Silent Participation Inference - Silent Adoption)": {"Value": final_spi_b, "Description": f"{final_spi_b}% of the target population has participated silently."},
61
+ "PEG (Participation-to-Expression Gap)": {"Value": final_peg, "Description": f"{final_peg}% of participants did not express feedback despite participating."}
62
  }
63
 
64
  self.components_2 = {
65
  "PCI (Participation Concentration Index)":
66
  {"Value": final_pci,
67
+ "Description": (
68
+ f"A PCI of {final_pci} suggests "
69
+ f"{'high' if final_pci >= pci_mid else 'low'} participation concentration, "
70
+ f"{'dominated by fewer groups' if final_pci >= pci_mid else 'with participation spread across groups'}."
71
+ ),
72
  "Group Summary":
73
  {"Minimum Participating Groups": f"At least {effective_groups_int} groups meaningfully participated.",
74
  "Effective Participation Groups": f"Participation is roughly equivalent to {effective_groups_rounded} equally sized groups."