# %% imported need packages
import numpy as np
import tensorflow as tf
import os
import optuna
import matplotlib.pyplot as plt
from load_data import get_all_time_series
from load_data import to_float
from load_data import to_float_vec

mypath = r'../COVID-19/'
subpath = r'csse_covid_19_data/csse_covid_19_time_series'
the_path = os.path.join(mypath, subpath)
[df_infected, df_confirmed, df_recovered,
 df_deaths] = get_all_time_series(the_path)
from information import df_information

countries = ['Italy']
for country_code in countries:
    infected = df_infected[country_code].values
    deaths = df_deaths[country_code].values
    recovered = df_recovered[country_code].values
    population = df_information[df_information.country ==
                                country_code].population.values[0]
    Regr = int(
        df_information[df_information.country == country_code].Regr.values[0])

    # %% find start_time
    start_time = 0
    for i in infected:
        if i != 0:
Exemple #2
0
# %% load needed packages
import tensorflow as tf
import matplotlib.pyplot as plt 
import numpy as np
import os
from load_data import get_all_time_series
from load_data import to_float
from load_data import to_float_vec
# %% load the data from user input
mypath = r'../COVID-19/'
subpath = r'csse_covid_19_data/csse_covid_19_time_series'
the_path = os.path.join(mypath,subpath)
[df_infected,df_confirmed,df_recovered,df_deaths] = get_all_time_series(the_path)
#%% create df of needed information for each country
from information import df_information
print(df_information)
# %% user input the country to train
countries = ['Italy']
country_code = countries[0]
infected = df_infected[country_code].values
deaths = df_deaths[country_code].values
recovered = df_recovered[country_code].values
population = df_information[df_information.country==country_code].population.values[0]
Regr = int(df_information[df_information.country==country_code].Regr.values[0])

#%% find start_time
start_time = 0
for i in infected:
    if i!=0:
        break
    start_time = start_time+1