Skip to content

Commit

Permalink
Conda environment in Google Colab
Browse files Browse the repository at this point in the history
  • Loading branch information
abuendia committed Jun 17, 2023
1 parent 50461e3 commit dd07655
Showing 1 changed file with 40 additions and 7 deletions.
47 changes: 40 additions & 7 deletions examples/eol/sard_eol.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"id": "n3ieKAgvPfsZ"
},
"source": [
"# Run End of Life prediction task on Synthetic Patient Data in OMOP"
"# End of Life prediction task on Synthetic Patient Data in OMOP"
]
},
{
Expand All @@ -30,13 +30,48 @@
"Data is sourced from the publicly available Medicare Claims Synthetic Public Use Files (SynPUF), released by the Centers for Medicare and Medicaid Services (CMS) and available in [Google BigQuery](https://console.cloud.google.com/marketplace/product/hhs/synpuf). The synthetic set contains 2008-2010 Medicare insurance claims for development and demonstration purposes and was coverted to the Medical Outcomes Partnership (OMOP) Common Data Model from its original CSV form."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Install conda environment "
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"If using this notebook in Google Colaboratory, the following cells must be run to create and activate the conda environment needed to run `omop-learn`."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"!pip install -q condacolab\n",
"!git clone https://github.com/clinicalml/omop-learn.git\n",
"!conda env create -f omop-learn/environment.yml"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"%%bash\n",
"source activate omop-learn"
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "YaHCADZXPfsd"
},
"source": [
"## Imports and GPU setup"
"## Imports"
]
},
{
Expand Down Expand Up @@ -92,9 +127,7 @@
"source": [
"## Cohort, Outcome and Feature Collection\n",
"\n",
"### 1. Set up a connection to the OMOP CDM database\n",
"\n",
"Parameters for connection to be specified in ./config.py"
"### 1. Set up a connection to the OMOP CDM database"
]
},
{
Expand Down Expand Up @@ -154,7 +187,7 @@
"id": "Oa7ULCSRPfsh"
},
"source": [
"### 4. Process the collected data and calculate indices needed for the deep model"
"### 2. Process the collected data and calculate indices needed for the deep model"
]
},
{
Expand Down Expand Up @@ -278,7 +311,7 @@
"# train the regression model over several choices of regularization parameter\n",
"reg_lambdas = [2, 0.2, 0.02]\n",
"lr_val_aucs = []\n",
"model = OMOPLogisticRegression(\"eol_new_50\", windowed_dataset)\n",
"model = OMOPLogisticRegression(\"synpuf_eol\", windowed_dataset)\n",
"\n",
"for reg_lambda in reg_lambdas:\n",
" # Gen and fit\n",
Expand Down

0 comments on commit dd07655

Please sign in to comment.