From a70b190e0e1632ae3fb3ac982e720d27351c15c3 Mon Sep 17 00:00:00 2001 From: Olivier Francon Date: Wed, 3 Feb 2021 15:50:32 +0100 Subject: [PATCH 1/2] Add scenario to generate hitorical IPs for China early 2020's prescription task --- .../validation/scenario_generator.ipynb | 57 +++++++++++++++++++ 1 file changed, 57 insertions(+) diff --git a/covid_xprize/validation/scenario_generator.ipynb b/covid_xprize/validation/scenario_generator.ipynb index 170538d4..ac97d76f 100644 --- a/covid_xprize/validation/scenario_generator.ipynb +++ b/covid_xprize/validation/scenario_generator.ipynb @@ -458,6 +458,63 @@ "scenario_df.to_csv(\"/Users/m_754337/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(\"/Users/m_754337/workspace/covid-xprize-robotasks/ips/prescriptions/china_early_2020_ips.csv\", index=False)" + ] + }, { "cell_type": "code", "execution_count": null, From df0cfb1466cd6dc19c535705c08cd78a0b72c7f0 Mon Sep 17 00:00:00 2001 From: Olivier Francon Date: Wed, 3 Feb 2021 16:01:00 +0100 Subject: [PATCH 2/2] Add scenario to generate hitorical IPs for China early 2020's prescription task --- covid_xprize/validation/scenario_generator.ipynb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/covid_xprize/validation/scenario_generator.ipynb b/covid_xprize/validation/scenario_generator.ipynb index ac97d76f..fb5a4b37 100644 --- a/covid_xprize/validation/scenario_generator.ipynb +++ b/covid_xprize/validation/scenario_generator.ipynb @@ -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)" ] }, { @@ -455,7 +455,7 @@ "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)" ] }, { @@ -512,7 +512,7 @@ "metadata": {}, "outputs": [], "source": [ - "scenario_df.to_csv(\"/Users/m_754337/workspace/covid-xprize-robotasks/ips/prescriptions/china_early_2020_ips.csv\", index=False)" + "scenario_df.to_csv(\"~/workspace/covid-xprize-robotasks/ips/prescriptions/china_early_2020_ips.csv\", index=False)" ] }, {