Skip to content
Snippets Groups Projects
Commit b67315b1 authored by Luke Effenberger's avatar Luke Effenberger
Browse files

first exp for multiday pred

parent 0a12e275
No related branches found
No related tags found
No related merge requests found
......@@ -3,12 +3,12 @@
#$ -t 1-9
#$ -l mem=14G
#$ -m n
#$ -q ni.q
#$ -l h='!(ramsauer.ikw.uni-osnabrueck.de|vector.cv.uni-osnabrueck.de|righty.ni.uni-osnabrueck.de)'
#$ -wd /net/store/ni/projects/BSTIM/src/
#$ -e /net/store/ni/projects/BSTIM/logs_backup/e_$TASK_ID.txt
#$ -o /net/store/ni/projects/BSTIM/logs_backup/o_$TASK_ID.txt
#$ -pe default 4
echo "#$ -q ni.q"
echo "#$ -l h='!(ramsauer.ikw.uni-osnabrueck.de|vector.cv.uni-osnabrueck.de|righty.ni.uni-osnabrueck.de)'"
#$ -wd /net/projects/scratch/summer/valid_until_31_January_2021/leffenberger/BSTIM-Covid19/src
#$ -e /net/projects/scratch/summer/valid_until_31_January_2021/leffenberger/BSTIM-Covid19/logs_backup/e_$TASK_ID.txt
#$ -o //net/projects/scratch/summer/valid_until_31_January_2021/leffenberger/BSTIM-Covid19/logs_backup/o_$TASK_ID.txt
echo "#$ -pe default 4"
echo "Running job ${JOB_ID}, task ${SGE_TASK_ID} on `hostname`."
......
import matplotlib
matplotlib.use('TkAgg')
from matplotlib import pyplot as plt
from config import *
from shared_utils import *
......@@ -7,7 +9,7 @@ import numpy as np
from collections import OrderedDict
from pymc3.stats import quantiles
def curves_appendix(use_interactions=True, use_repot_delay=True, save_plot=False):
def curves_appendix(use_interactions=True, use_report_delay=True, save_plot=False):
with open('../data/counties/counties.pkl', "rb") as f:
counties = pkl.load(f)
......@@ -81,18 +83,19 @@ def curves_appendix(use_interactions=True, use_repot_delay=True, save_plot=False
prediction_region = "germany"
data = load_daily_data(disease, prediction_region, counties)
data = data[data.index < pd.Timestamp(2020, 3, 30)]
data = data[data.index < pd.Timestamp(2020, 4, 25)]
_, target, _, _ = split_data(
data, train_start=pd.Timestamp(
2020, 1, 28), test_start=pd.Timestamp(
2020, 3, 30), post_test=pd.Timestamp(
2020, 3, 31)) # plots for the training period!
2020, 4, 22), post_test=pd.Timestamp(
2020, 4, 24)) # plots for the training period!
county_ids = target.columns
# Load our prediction samples
res = load_pred(disease, use_interactions, use_report_delay)
n_days = 62 # for now; get from timestamps up top! / configs!
n_days = 85 # for now; get from timestamps up top! / configs!
prediction_samples = np.reshape(res['y'], (res['y'].shape[0], n_days, -1))
prediction_quantiles = quantiles(prediction_samples, (5, 25, 75, 95))
......@@ -198,7 +201,7 @@ def curves_appendix(use_interactions=True, use_repot_delay=True, save_plot=False
va='center', rotation='vertical', fontsize=22)
if save_plot:
plt.savefig("../figures/curves_{}_appendix.pdf".format(disease))
plt.savefig("../figures/luke_curves_{}_appendix.pdf".format(disease))
return plt
......
......@@ -8,6 +8,7 @@ import os
i = int(os.environ["SGE_TASK_ID"])-1
#NOTE: for jureca, extend to the number of available cores (chains and cores!)
num_samples = 250
# num_sample = 1
......@@ -34,7 +35,7 @@ data = load_daily_data(disease, prediction_region, county_info)
data_train, target_train, data_test, target_test = split_data(
data,
train_start=pd.Timestamp(2020, 1, 28),
test_start=pd.Timestamp(2020, 4, 22),
test_start=pd.Timestamp(2020, 4, 12),
post_test=pd.Timestamp(2020, 4, 23)
)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment