Skip to content

Commit

Permalink
Merge pull request #199 from leaf-ai/china_task
Browse files Browse the repository at this point in the history
Add scenario to generate hitorical IPs for China early 2020's prescription task
  • Loading branch information
ofrancon authored Feb 3, 2021
2 parents b1ae1f2 + df0cfb1 commit 5150e36
Showing 1 changed file with 59 additions and 2 deletions.
61 changes: 59 additions & 2 deletions covid_xprize/validation/scenario_generator.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,7 @@
"metadata": {},
"outputs": [],
"source": [
"scenario_df.to_csv(\"/Users/m_754337/workspace/covid-xprize-robotasks/ips/prescriptions/uk_future_test_ips.csv\", index=False)"
"scenario_df.to_csv(\"~/workspace/covid-xprize-robotasks/ips/prescriptions/uk_future_test_ips.csv\", index=False)"
]
},
{
Expand Down Expand Up @@ -455,7 +455,64 @@
"metadata": {},
"outputs": [],
"source": [
"scenario_df.to_csv(\"/Users/m_754337/workspace/covid-xprize-robotasks/ips/prescriptions/all_2020_ips.csv\", index=False)"
"scenario_df.to_csv(\"~/workspace/covid-xprize-robotasks/ips/prescriptions/all_2020_ips.csv\", index=False)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## China early 2020 test"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"start_date_str = None\n",
"end_date_str = \"2020-02-14\"\n",
"latest_df = load_dataset(LATEST_DATA_URL, GEO_FILE)\n",
"countries = [\"China\"]\n",
"scenario_df = generate_scenario(start_date_str, end_date_str, latest_df, countries, scenario=\"Historical\")"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"end_date = pd.to_datetime(end_date_str, format='%Y-%m-%d')\n",
"scenario_df = scenario_df[scenario_df.Date <= end_date]"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"scenario_df.tail()"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"len(scenario_df)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"scenario_df.to_csv(\"~/workspace/covid-xprize-robotasks/ips/prescriptions/china_early_2020_ips.csv\", index=False)"
]
},
{
Expand Down

0 comments on commit 5150e36

Please sign in to comment.