How Many COVID-19 Cases Will a Country Report Next Month?
From each country's daily history, how many new cases will France, Germany and Italy report over the next four weeks? Health services plan beds and staff around a range, not a single number.
The table
Daily COVID-19 cases, deaths, tests and vaccinations for every country, from Our World in Data. It's in Welt's research catalogue as Data on COVID-19 (Coronavirus) Country Statistics, 170,646 rows by 67 columns, licensed CC BY 4.0. The catalogue measures its signal at 0.83, in time order. Chronos-2 forecasts the 3 series named below in one request and needs no training.
Walkthrough
Load it from the catalogue
Find the table, read its recorded target and print the column names.
import pandas as pd from welt import Client, Forecast with Client() as client: item = client.research_datasets(q="Data on COVID-19 country statistics", limit=1)["items"][0] info = client.research_dataset(item["id"]) data = client.load_research_dataset(item["id"]) target = info["targets"][0] target = target["name"] if isinstance(target, dict) else target print([column["name"] for column in info["schema"]], target)Pick the history
Keep the time column and the target, for the series you want.
time, series = "date", "location" history = data[data[series].isin(["France", "Germany", "Italy"])][[series, time, target]].dropna() history[time] = pd.to_datetime(history[time])Forecast with a range
Ask for the next 28 steps, one per day. The median is the forecast, and the 10% and 90% columns give a low and a high case.
model = Forecast(model="chronos-2").fit(history, time=time, id=series, target=[target]) result = model.forecast(28, quantile_levels=[0.1, 0.5, 0.9]) print(result.to_frame()[["id", "timestamp", "median", "q_0.1", "q_0.9"]].head(28))
What you get
Try it
Use Open with to run the research datasets notebook in Colab, Kaggle or Jupyter and search for "Data on COVID-19 country statistics", or run the code above after pip install "welt-client[parquet]".
Open with
- Type
- Use case
- Area
- Healthcare
- Question
- How Many COVID-19 Cases Will a Country Report Next Month?
- Model
- Chronos-2
- Data
- Data on COVID-19 (Coronavirus) Country Statistics, 170,646 rows
- For
- Public-health analysts and data journalists
- Licence
- CC BY 4.0