Skip to content

Commit 42c0c74

Browse files
authored
Merge pull request #2 from Machine-Learning-Foundations/exercise-03-suggestion
Exercise 03 suggestion
2 parents bc94882 + d86873f commit 42c0c74

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,8 @@ Another way to evaluate the performance of a model is the [ROC-Curve](https://en
5858

5959
You can also use SVMs for regression. In this exercise, we will take a brief look at time-series predictions. The goal is to infer new values from a set of old observations. For this we will look at the number of Covid-19 cases.
6060

61-
0. Open `src/ex3_time_series.py`, move to the `__main__` function and have a look at the code. Inspect the dataset closely and make sure you understand what information the columns depict.
61+
0. Open `src/ex3_time_series.py`, move to the `__main__` function and have a look at the code. Inspect the dataset closely and make sure you understand what information the columns depict. To do this, you can use the `head()` function of the pandas dataframe.
62+
6263
1. In the code we generate two arrays: `raw_data` and `raw_data_short`. Plot both curves with the `plot_curve` function. Do you notice any change in behavior in these curves? Is there a point were the rate of change increases? The data that lies before this point won't be considered anymore.
6364

6465
2. With the number of covid cases for the last week (7 days), we want to predict the expected number of cases for the next 5 days. Set the number of days you want to forecast and the number of days that will be taken into account for the forecast.

src/ex3_time_series.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,10 @@ def cv_svr(train_x: np.ndarray, train_y: np.ndarray) -> GridSearchCV:
119119
"time_series_covid19_confirmed_global.csv"
120120
)
121121

122-
# only choose first 82 days
122+
# take a look at the dataframe with print(df.head()) to see how the data is structured.
123+
# head() will return the first 5 rows of the dataframe.
124+
125+
# only choose first 78 days.
123126
df = df[df.columns[:82]]
124127

125128
# compute total number of cases

0 commit comments

Comments
 (0)