Skip to content

feat: tune heuristic for signal good/bad/neutral #522

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 6, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 17 additions & 6 deletions src/server/endpoints/covidcast_utils/meta.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,29 @@ class SignalCategory(str, Enum):


def guess_name(source: str, signal: str) -> str:
return f"{source.capitalize()}: {signal.capitalize()}"
return f"{source.upper()}: {' '.join((s.capitalize() for s in signal.split('_')))}"


def guess_high_values_are(source: str, signal: str) -> HighValuesAre:
if source == "fb-survey":
if "mask" in signal or "vaccine" in signal:
if signal.endswith("_ili") or signal.endswith("_wili") or signal.endswith("_cli") or signal.endswith("_wcli"):
return HighValuesAre.bad
if source == "chng" and signal.endswith("_covid"):
return HighValuesAre.bad
if source == "covid-act-now":
if signal.endswith("_positivity_rate"):
return HighValuesAre.bad
if signal.endswith("_total_tests"):
return HighValuesAre.good
if signal.endswith("_ili") or signal.endswith("_cli") or "tested_positive" in signal:
if source == "fb-survey":
if "tested_positive" in signal:
return HighValuesAre.bad
if "anxious" in signal or "depressed" in signal or "felt_isolated" in signal or "worried" in signal:
return HighValuesAre.bad
if source in ["quidel", "indicator-combination", "google-symptoms", "doctor-visits", "hospital-admissions"]:
if "hesitancy_reason" in signal or "vaccine_likely" in signal or "dontneed_reason" in signal:
return HighValuesAre.neutral
if "mask" in signal or "vaccine" in signal or "vaccinated" in signal:
return HighValuesAre.good
if source in ["quidel", "indicator-combination", "google-symptoms", "doctor-visits", "hospital-admissions", "usa-facts", "jhu-csse", "hhs"]:
return HighValuesAre.bad

return HighValuesAre.neutral
Expand Down Expand Up @@ -102,4 +113,4 @@ def intergrate(self, row: Dict[str, Any]):
def asdict(self):
r = asdict(self)
r["geo_types"] = {k: asdict(v) for k, v in self.geo_types.items()}
return r
return r