{"id":40699837,"url":"https://github.com/dssg/masld_prediction","last_synced_at":"2026-01-21T12:02:58.606Z","repository":{"id":263705874,"uuid":"891230960","full_name":"dssg/masld_prediction","owner":"dssg","description":null,"archived":false,"fork":false,"pushed_at":"2025-02-26T02:55:11.000Z","size":86,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-02-26T03:30:06.020Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dssg.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-11-20T00:49:09.000Z","updated_at":"2025-02-26T02:55:14.000Z","dependencies_parsed_at":null,"dependency_job_id":"c38bc579-35cf-4924-801a-d6d031021c96","html_url":"https://github.com/dssg/masld_prediction","commit_stats":null,"previous_names":["dssg/masld_prediction"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/dssg/masld_prediction","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dssg%2Fmasld_prediction","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dssg%2Fmasld_prediction/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dssg%2Fmasld_prediction/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dssg%2Fmasld_prediction/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dssg","download_url":"https://codeload.github.com/dssg/masld_prediction/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dssg%2Fmasld_prediction/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28632781,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-21T04:47:28.174Z","status":"ssl_error","status_checked_at":"2026-01-21T04:47:22.943Z","response_time":86,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-01-21T12:02:50.515Z","updated_at":"2026-01-21T12:02:58.592Z","avatar_url":"https://github.com/dssg.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# MASLD Risk Prediction Project\n\n# Early Warning Tool for prioritizing individuals for screenings based on risk of MASLD related liver complications)\n\n## Documentation\n[Documentation of steps and code](documentation.md)\n\n\n## Formulation\nFor every patient \n1. who has *had at least one clinical visit* in the past 3 years\n2. is 18+ years of age (and alive)\n3. has not been diagnosed yet with MASLD related liver_complications or hepatitis or alcohol related or other liver complications\n\nPredict the top k individuals (based on intervention capacity) who are at risk of having MASLD related liver complications in the *next 3 years*\n\n\n## Analysis to be done\n- Predict risk of having MASLD related liver complications in the next 3 years\n- Define Baselines:\n     - age, most recent fib4, co-morbidities\n     - clinical guidelines - t2dm, obesity, high tg, glucose, hdl, bp, ast or alt\n- Metric(s):\n   - Primary: Precision (PPV) or Recall (sensitivity) at top k (need to determine k based on capacity)\n   - AUC (if capacity is TBD but not recommended)\n- Fairness metric: TPR disparity by Race, Gender (need to determine acceptable ratio)\n\n## Methodology\n1. **Define cohort based on formulation**: All patients \u003e 18 years, at least one outpatient visit in the past 3 years, no previous diagnosis of liver-related complications or other liver-related diagnosis exclusions. [sql file used in config](triage_config_files/cohort_label_query_CTE.sql)\n2. **Define Outcome/Label based on formulation (will get diagnosed with X in the next z months)**:  Liver complications (defined as development of cirrhosis or liver-related complications) developed in the next 3 years following prediction date [sql file used in config](triage_config_files/cohort_label_query_CTE.sql)\n3. **Define Training and Validation sets over time** \n4. **Define and generate predictors**: All features defined in [these config files](triage_config_files\n/feature_groups/)\n5. **Train Models on each training set and score all patients in the corresponding validation set** \n6. **Evaluate all models for each validation time according to each metric (PPV at top k)**\n7. **Select \"Best\" model based on results over time**\n8. **Explore the high performing models to understand who they rank high, how they compare to the cohort, and important predictors**\n9. **Check and/or correct for bias issues**\n\n## Triage background\nWe are using [Triage](https://github.com/dssg/triage) to build and select models. Some background and tutorials on Triage:\n- [Tutorial on Google Colab](https://colab.research.google.com/github/dssg/triage/blob/master/example/colab/colab_triage.ipynb) - Are you completely new to Triage? Run through a quick tutorial hosted on google colab (no setup necessary) to see what triage can do!\n- [Dirty Duck Tutorial](https://dssg.github.io/triage/dirtyduck/) - Want a more in-depth walk through of triage's functionality and concepts? Go through the dirty duck tutorial here with sample data\n- [QuickStart Guide](https://dssg.github.io/triage/quickstart/) - Try Triage out with your own project and data\n- [Suggested workflow](https://dssg.github.io/triage/triage_project_workflow/)\n- [Understanding the configuration file](https://dssg.github.io/triage/experiments/experiment-config/#experiment-configuration)\n- Installation: install triage in a python virtual environment\n\n## Running models and triage\nAssuming Triage is installed and the data is in a postgres database. To run,\n1. activate virtual environment source env/bin/activate\n2. python run.py -c configfilename\n   - if running on sample database add --sampledb flag\n   \n**Triage running - choices to Make**\n1. replace flag (set to false until we want to nuke everything)\n2. save predictions (don't for the beginning)\n3. number of processors to use\n\n## Config files, Model Selection, and Bias Analysis \n\n### current config file\n1. The current one is [here](triage_config_files/c3y_l3y_upd1y_asof1y_nofeatures_nomodels.yaml)\n2. File with design choices: [google doc](https://docs.google.com/spreadsheets/d/1DQU7vKe4vfZpDn5JPFf7yCaRJwSQR197hkte_gQ6QFc/edit#gid=724583270)\n### Config file choices to make: [example config file](https://github.com/dssg/triage/blob/master/example/config/experiment.yaml)\n1. cohort and label query: need to write a query that takes two parameters {as_of_date} and {label_timespan} and returns data in two columns (entity_id, outcome) specifying all the patients in the cohort as of {as_of_date} and outcomes can be 1 (got diagnosed with NASH/NAFLD related liver complications within the time period {label_timespan) from the {as_of_date}, 0 (did not get diagnosed), null (don't know or not sure). We can later turn nulls into 0s or ignore them. \n3. temporal config parameters\n4. features and imputation\n5. subsets to analyze: prior NASH or NAFLD diagnosis\n7. attributes to do bias audits for: sex, race\n\n## FIB-4 related analysis\n1. Of all the patients who have FIB-4 components, how many should be in our cohort (don't have nash/nafld related complications yet), and what % of them end up having them in the next 3 years?\n\n## Variations Tested\nThe following feature sets were tested using [manual_modeling.py](pipeline/manual_modeling.py). Takes 4 parameters:\n - training matrix\n - test matrix\n - model to build and test\n - feature set\n\n### All Features\n\n### Only using features for 12 months and all history (without 1,3,6 month features)\n\n### based on guidelines only\n\n### without liver-related labs and diagnosis\n\n### using top x features from the xgboost model\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdssg%2Fmasld_prediction","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdssg%2Fmasld_prediction","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdssg%2Fmasld_prediction/lists"}