Skip to content

Commit

Permalink
Fixed notebooks
Browse files Browse the repository at this point in the history
  • Loading branch information
nils-braun committed Jan 28, 2024
1 parent 7e320ca commit af039f9
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 17 deletions.
18 changes: 9 additions & 9 deletions notebooks/05 Timeseries Forecasting.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"we now have 1252 unique windows (identified by stock symbol and ending date):"
"we now have 1253 unique windows (identified by stock symbol and ending date):"
]
},
{
Expand Down Expand Up @@ -342,7 +342,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"Just to repeat: the features in this row were only calculated using the time series values of `AAPL` up to and including `2015-07-14` and the last 20 days."
"Just to repeat: the features in this row were only calculated using the time series values of `AAPL` up to and including `2020-07-14` and the last 20 days."
]
},
{
Expand Down Expand Up @@ -418,7 +418,7 @@
"source": [
"We can now train normal AdaBoostRegressors to predict the next time step .\n",
"Let's split the data into a training and testing sample (but make sure to keep temporal consistency).\n",
"We take everything until 2019 as train data an the rest as test:"
"We take everything until 2020 as train data an the rest as test:"
]
},
{
Expand All @@ -427,7 +427,7 @@
"metadata": {},
"outputs": [],
"source": [
"X[:\"2018\"]"
"X[:\"2020\"]"
]
},
{
Expand All @@ -436,11 +436,11 @@
"metadata": {},
"outputs": [],
"source": [
"X_train = X[:\"2018\"]\n",
"X_test = X[\"2019\":]\n",
"X_train = X[:\"2020\"]\n",
"X_test = X[\"2021\":]\n",
"\n",
"y_train = y[:\"2018\"]\n",
"y_test = y[\"2019\":]"
"y_train = y[:\"2020\"]\n",
"y_test = y[\"2021\":]"
]
},
{
Expand Down Expand Up @@ -535,7 +535,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.9"
"version": "3.10.13"
}
},
"nbformat": 4,
Expand Down
19 changes: 13 additions & 6 deletions notebooks/advanced/05 Timeseries Forecasting (multiple ids).ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"Just to repeat: the features in this row were only calculated using the time series values of `AAPL` up to and including `2015-07-15` and the last 20 days."
"Just to repeat: the features in this row were only calculated using the time series values of `AAPL` up to and including `2020-07-14` and the last 20 days."
]
},
{
Expand Down Expand Up @@ -268,11 +268,11 @@
"metadata": {},
"outputs": [],
"source": [
"X_train = X.loc[(slice(None), slice(None, \"2018\")), :]\n",
"X_test = X.loc[(slice(None), slice(\"2019\", \"2020\")), :]\n",
"X_train = X.loc[(slice(None), slice(None, \"2020\")), :]\n",
"X_test = X.loc[(slice(None), slice(\"2021\", \"2022\")), :]\n",
"\n",
"y_train = y.loc[(slice(None), slice(None, \"2018\"))]\n",
"y_test = y.loc[(slice(None), slice(\"2019\", \"2020\"))]"
"y_train = y.loc[(slice(None), slice(None, \"2020\"))]\n",
"y_test = y.loc[(slice(None), slice(\"2021\", \"2022\"))]"
]
},
{
Expand Down Expand Up @@ -336,6 +336,13 @@
"y.unstack(\"Symbols\").plot(ax=plt.gca())\n",
"y_pred.unstack(\"Symbols\").plot(ax=plt.gca(), legend=None, marker=\".\")"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
Expand All @@ -354,7 +361,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.7"
"version": "3.10.13"
}
},
"nbformat": 4,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,7 @@
"from tsfresh.feature_extraction import ComprehensiveFCParameters\n",
"\n",
"matplotlib.rcParams[\"figure.figsize\"] = [16, 6]\n",
"matplotlib.rcParams[\"font.size\"] = 14\n",
"matplotlib.style.use('seaborn-darkgrid')"
"matplotlib.rcParams[\"font.size\"] = 14"
]
},
{
Expand Down

0 comments on commit af039f9

Please sign in to comment.