{ "cells": [ { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [], "source": [ "# Import packages\n", "import plotly.graph_objects as go\n", "import pandas as pd\n", "import plotly.express as px\n", "from statsmodels.tsa.holtwinters import ExponentialSmoothing" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [], "source": [ "# Read in the data\n", "data = pd.read_csv(\"../coal-price-data/AirPassengers.csv\")" ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [], "source": [ "data[\"Month\"] = pd.to_datetime(data[\"Month\"])" ] }, { "cell_type": "code", "execution_count": 5, "metadata": {}, "outputs": [], "source": [ "# Split train and test\n", "train = data.iloc[: -int(len(data) * 0.2)]\n", "test = data.iloc[-int(len(data) * 0.2) :]" ] }, { "cell_type": "code", "execution_count": 6, "metadata": {}, "outputs": [], "source": [ "def plot_func(forecast: list[float], title: str, save_path: str = None) -> None:\n", " \"\"\"Function to plot the forecasts.\"\"\"\n", " fig = go.Figure()\n", " fig.add_trace(\n", " go.Scatter(x=train[\"Month\"], y=train[\"#Passengers\"], name=\"Train\")\n", " )\n", " fig.add_trace(\n", " go.Scatter(x=test[\"Month\"], y=test[\"#Passengers\"], name=\"Test\")\n", " )\n", " fig.add_trace(go.Scatter(x=test[\"Month\"], y=forecast, name=\"Forecast\"))\n", " fig.update_layout(\n", " template=\"simple_white\",\n", " font=dict(size=18),\n", " title_text=title,\n", " width=700,\n", " title_x=0.5,\n", " height=400,\n", " xaxis_title=\"Date\",\n", " yaxis_title=\"Passenger Volume\",\n", " )\n", "\n", " return fig.show()" ] }, { "cell_type": "code", "execution_count": 7, "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "/home/ibnu/miniconda3/envs/py311-kfp240-airflow251/lib/python3.11/site-packages/statsmodels/tsa/holtwinters/model.py:83: RuntimeWarning: overflow encountered in matmul\n", " return err.T @ err\n" ] } ], "source": [ "# Fit Holt Winters model and get forecasts\n", "model = ExponentialSmoothing(\n", " train[\"#Passengers\"], trend=\"mul\", seasonal=\"mul\", seasonal_periods=12\n", ").fit(optimized=True)" ] }, { "cell_type": "code", "execution_count": 13, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "" ] }, "execution_count": 13, "metadata": {}, "output_type": "execute_result" } ], "source": [ "model" ] }, { "cell_type": "code", "execution_count": 8, "metadata": {}, "outputs": [], "source": [ "forecasts = model.forecast(len(test))" ] }, { "cell_type": "code", "execution_count": 12, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
Month#Passengers
1161958-09-01404
1171958-10-01359
1181958-11-01310
1191958-12-01337
1201959-01-01360
1211959-02-01342
1221959-03-01406
1231959-04-01396
1241959-05-01420
1251959-06-01472
1261959-07-01548
1271959-08-01559
1281959-09-01463
1291959-10-01407
1301959-11-01362
1311959-12-01405
1321960-01-01417
1331960-02-01391
1341960-03-01419
1351960-04-01461
1361960-05-01472
1371960-06-01535
1381960-07-01622
1391960-08-01606
1401960-09-01508
1411960-10-01461
1421960-11-01390
1431960-12-01432
\n", "
" ], "text/plain": [ " Month #Passengers\n", "116 1958-09-01 404\n", "117 1958-10-01 359\n", "118 1958-11-01 310\n", "119 1958-12-01 337\n", "120 1959-01-01 360\n", "121 1959-02-01 342\n", "122 1959-03-01 406\n", "123 1959-04-01 396\n", "124 1959-05-01 420\n", "125 1959-06-01 472\n", "126 1959-07-01 548\n", "127 1959-08-01 559\n", "128 1959-09-01 463\n", "129 1959-10-01 407\n", "130 1959-11-01 362\n", "131 1959-12-01 405\n", "132 1960-01-01 417\n", "133 1960-02-01 391\n", "134 1960-03-01 419\n", "135 1960-04-01 461\n", "136 1960-05-01 472\n", "137 1960-06-01 535\n", "138 1960-07-01 622\n", "139 1960-08-01 606\n", "140 1960-09-01 508\n", "141 1960-10-01 461\n", "142 1960-11-01 390\n", "143 1960-12-01 432" ] }, "execution_count": 12, "metadata": {}, "output_type": "execute_result" } ], "source": [ "test" ] }, { "cell_type": "code", "execution_count": 10, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "116 421.344912\n", "117 362.116133\n", "118 318.903773\n", "119 356.258190\n", "120 366.281250\n", "121 349.727205\n", "122 408.310119\n", "123 402.054810\n", "124 422.533093\n", "125 506.604413\n", "126 566.761747\n", "127 553.397062\n", "128 476.524463\n", "129 409.539052\n", "130 360.667579\n", "131 402.913950\n", "132 414.249635\n", "133 395.527664\n", "134 461.782627\n", "135 454.708120\n", "136 477.868249\n", "137 572.949593\n", "138 640.985163\n", "139 625.870233\n", "140 538.930358\n", "141 463.172502\n", "142 407.900795\n", "143 455.679773\n", "dtype: float64" ] }, "execution_count": 10, "metadata": {}, "output_type": "execute_result" } ], "source": [ "forecasts" ] }, { "cell_type": "code", "execution_count": 9, "metadata": {}, "outputs": [ { "data": { "application/vnd.plotly.v1+json": { "config": { "plotlyServerURL": "https://plot.ly" }, "data": [ { "name": "Train", "type": "scatter", "x": [ "1949-01-01T00:00:00", "1949-02-01T00:00:00", "1949-03-01T00:00:00", "1949-04-01T00:00:00", "1949-05-01T00:00:00", "1949-06-01T00:00:00", "1949-07-01T00:00:00", "1949-08-01T00:00:00", "1949-09-01T00:00:00", "1949-10-01T00:00:00", "1949-11-01T00:00:00", "1949-12-01T00:00:00", "1950-01-01T00:00:00", "1950-02-01T00:00:00", "1950-03-01T00:00:00", "1950-04-01T00:00:00", "1950-05-01T00:00:00", "1950-06-01T00:00:00", "1950-07-01T00:00:00", "1950-08-01T00:00:00", "1950-09-01T00:00:00", "1950-10-01T00:00:00", "1950-11-01T00:00:00", "1950-12-01T00:00:00", "1951-01-01T00:00:00", "1951-02-01T00:00:00", "1951-03-01T00:00:00", "1951-04-01T00:00:00", "1951-05-01T00:00:00", "1951-06-01T00:00:00", "1951-07-01T00:00:00", "1951-08-01T00:00:00", "1951-09-01T00:00:00", "1951-10-01T00:00:00", "1951-11-01T00:00:00", "1951-12-01T00:00:00", "1952-01-01T00:00:00", "1952-02-01T00:00:00", "1952-03-01T00:00:00", "1952-04-01T00:00:00", "1952-05-01T00:00:00", "1952-06-01T00:00:00", "1952-07-01T00:00:00", "1952-08-01T00:00:00", "1952-09-01T00:00:00", "1952-10-01T00:00:00", "1952-11-01T00:00:00", "1952-12-01T00:00:00", "1953-01-01T00:00:00", "1953-02-01T00:00:00", "1953-03-01T00:00:00", "1953-04-01T00:00:00", "1953-05-01T00:00:00", "1953-06-01T00:00:00", "1953-07-01T00:00:00", "1953-08-01T00:00:00", "1953-09-01T00:00:00", "1953-10-01T00:00:00", "1953-11-01T00:00:00", "1953-12-01T00:00:00", "1954-01-01T00:00:00", "1954-02-01T00:00:00", "1954-03-01T00:00:00", "1954-04-01T00:00:00", "1954-05-01T00:00:00", "1954-06-01T00:00:00", "1954-07-01T00:00:00", "1954-08-01T00:00:00", "1954-09-01T00:00:00", "1954-10-01T00:00:00", "1954-11-01T00:00:00", "1954-12-01T00:00:00", "1955-01-01T00:00:00", "1955-02-01T00:00:00", "1955-03-01T00:00:00", "1955-04-01T00:00:00", "1955-05-01T00:00:00", "1955-06-01T00:00:00", "1955-07-01T00:00:00", "1955-08-01T00:00:00", "1955-09-01T00:00:00", "1955-10-01T00:00:00", "1955-11-01T00:00:00", "1955-12-01T00:00:00", "1956-01-01T00:00:00", "1956-02-01T00:00:00", "1956-03-01T00:00:00", "1956-04-01T00:00:00", "1956-05-01T00:00:00", "1956-06-01T00:00:00", "1956-07-01T00:00:00", "1956-08-01T00:00:00", "1956-09-01T00:00:00", "1956-10-01T00:00:00", "1956-11-01T00:00:00", "1956-12-01T00:00:00", "1957-01-01T00:00:00", "1957-02-01T00:00:00", "1957-03-01T00:00:00", "1957-04-01T00:00:00", "1957-05-01T00:00:00", "1957-06-01T00:00:00", "1957-07-01T00:00:00", "1957-08-01T00:00:00", "1957-09-01T00:00:00", "1957-10-01T00:00:00", "1957-11-01T00:00:00", "1957-12-01T00:00:00", "1958-01-01T00:00:00", "1958-02-01T00:00:00", "1958-03-01T00:00:00", "1958-04-01T00:00:00", "1958-05-01T00:00:00", "1958-06-01T00:00:00", "1958-07-01T00:00:00", "1958-08-01T00:00:00" ], "y": [ 112, 118, 132, 129, 121, 135, 148, 148, 136, 119, 104, 118, 115, 126, 141, 135, 125, 149, 170, 170, 158, 133, 114, 140, 145, 150, 178, 163, 172, 178, 199, 199, 184, 162, 146, 166, 171, 180, 193, 181, 183, 218, 230, 242, 209, 191, 172, 194, 196, 196, 236, 235, 229, 243, 264, 272, 237, 211, 180, 201, 204, 188, 235, 227, 234, 264, 302, 293, 259, 229, 203, 229, 242, 233, 267, 269, 270, 315, 364, 347, 312, 274, 237, 278, 284, 277, 317, 313, 318, 374, 413, 405, 355, 306, 271, 306, 315, 301, 356, 348, 355, 422, 465, 467, 404, 347, 305, 336, 340, 318, 362, 348, 363, 435, 491, 505 ] }, { "name": "Test", "type": "scatter", "x": [ "1958-09-01T00:00:00", "1958-10-01T00:00:00", "1958-11-01T00:00:00", "1958-12-01T00:00:00", "1959-01-01T00:00:00", "1959-02-01T00:00:00", "1959-03-01T00:00:00", "1959-04-01T00:00:00", "1959-05-01T00:00:00", "1959-06-01T00:00:00", "1959-07-01T00:00:00", "1959-08-01T00:00:00", "1959-09-01T00:00:00", "1959-10-01T00:00:00", "1959-11-01T00:00:00", "1959-12-01T00:00:00", "1960-01-01T00:00:00", "1960-02-01T00:00:00", "1960-03-01T00:00:00", "1960-04-01T00:00:00", "1960-05-01T00:00:00", "1960-06-01T00:00:00", "1960-07-01T00:00:00", "1960-08-01T00:00:00", "1960-09-01T00:00:00", "1960-10-01T00:00:00", "1960-11-01T00:00:00", "1960-12-01T00:00:00" ], "y": [ 404, 359, 310, 337, 360, 342, 406, 396, 420, 472, 548, 559, 463, 407, 362, 405, 417, 391, 419, 461, 472, 535, 622, 606, 508, 461, 390, 432 ] }, { "name": "Forecast", "type": "scatter", "x": [ "1958-09-01T00:00:00", "1958-10-01T00:00:00", "1958-11-01T00:00:00", "1958-12-01T00:00:00", "1959-01-01T00:00:00", "1959-02-01T00:00:00", "1959-03-01T00:00:00", "1959-04-01T00:00:00", "1959-05-01T00:00:00", "1959-06-01T00:00:00", "1959-07-01T00:00:00", "1959-08-01T00:00:00", "1959-09-01T00:00:00", "1959-10-01T00:00:00", "1959-11-01T00:00:00", "1959-12-01T00:00:00", "1960-01-01T00:00:00", "1960-02-01T00:00:00", "1960-03-01T00:00:00", "1960-04-01T00:00:00", "1960-05-01T00:00:00", "1960-06-01T00:00:00", "1960-07-01T00:00:00", "1960-08-01T00:00:00", "1960-09-01T00:00:00", "1960-10-01T00:00:00", "1960-11-01T00:00:00", "1960-12-01T00:00:00" ], "y": [ 421.34491174994423, 362.11613305869326, 318.90377321002904, 356.258190007722, 366.2812497027325, 349.72720536821623, 408.31011882844285, 402.05481024174316, 422.53309317530835, 506.6044129226578, 566.7617466950583, 553.3970624385711, 476.5244631477535, 409.53905242682004, 360.66757918958575, 402.91395007084134, 414.24963493867546, 395.52766424567, 461.7826268850033, 454.7081197936026, 477.8682494379266, 572.9495934663657, 640.9851633305773, 625.870232989989, 538.9303576377762, 463.1725022742153, 407.90079518063607, 455.67977302688723 ] } ], "layout": { "font": { "size": 18 }, "height": 400, "template": { "data": { "bar": [ { "error_x": { "color": "rgb(36,36,36)" }, "error_y": { "color": "rgb(36,36,36)" }, "marker": { "line": { "color": "white", "width": 0.5 }, "pattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 } }, "type": "bar" } ], "barpolar": [ { "marker": { "line": { "color": "white", "width": 0.5 }, "pattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 } }, "type": "barpolar" } ], "carpet": [ { "aaxis": { "endlinecolor": "rgb(36,36,36)", "gridcolor": "white", "linecolor": "white", "minorgridcolor": "white", "startlinecolor": "rgb(36,36,36)" }, "baxis": { "endlinecolor": "rgb(36,36,36)", "gridcolor": "white", "linecolor": "white", "minorgridcolor": "white", "startlinecolor": "rgb(36,36,36)" }, "type": "carpet" } ], "choropleth": [ { "colorbar": { "outlinewidth": 1, "tickcolor": "rgb(36,36,36)", "ticks": "outside" }, "type": "choropleth" } ], "contour": [ { "colorbar": { "outlinewidth": 1, "tickcolor": "rgb(36,36,36)", "ticks": "outside" }, "colorscale": [ [ 0, "#440154" ], [ 0.1111111111111111, "#482878" ], [ 0.2222222222222222, "#3e4989" ], [ 0.3333333333333333, "#31688e" ], [ 0.4444444444444444, "#26828e" ], [ 0.5555555555555556, "#1f9e89" ], [ 0.6666666666666666, "#35b779" ], [ 0.7777777777777778, "#6ece58" ], [ 0.8888888888888888, "#b5de2b" ], [ 1, "#fde725" ] ], "type": "contour" } ], "contourcarpet": [ { "colorbar": { "outlinewidth": 1, "tickcolor": "rgb(36,36,36)", "ticks": "outside" }, "type": "contourcarpet" } ], "heatmap": [ { "colorbar": { "outlinewidth": 1, "tickcolor": "rgb(36,36,36)", "ticks": "outside" }, "colorscale": [ [ 0, "#440154" ], [ 0.1111111111111111, "#482878" ], [ 0.2222222222222222, "#3e4989" ], [ 0.3333333333333333, "#31688e" ], [ 0.4444444444444444, "#26828e" ], [ 0.5555555555555556, "#1f9e89" ], [ 0.6666666666666666, "#35b779" ], [ 0.7777777777777778, "#6ece58" ], [ 0.8888888888888888, "#b5de2b" ], [ 1, "#fde725" ] ], "type": "heatmap" } ], "heatmapgl": [ { "colorbar": { "outlinewidth": 1, "tickcolor": "rgb(36,36,36)", "ticks": "outside" }, "colorscale": [ [ 0, "#440154" ], [ 0.1111111111111111, "#482878" ], [ 0.2222222222222222, "#3e4989" ], [ 0.3333333333333333, "#31688e" ], [ 0.4444444444444444, "#26828e" ], [ 0.5555555555555556, "#1f9e89" ], [ 0.6666666666666666, "#35b779" ], [ 0.7777777777777778, "#6ece58" ], [ 0.8888888888888888, "#b5de2b" ], [ 1, "#fde725" ] ], "type": "heatmapgl" } ], "histogram": [ { "marker": { "line": { "color": "white", "width": 0.6 } }, "type": "histogram" } ], "histogram2d": [ { "colorbar": { "outlinewidth": 1, "tickcolor": "rgb(36,36,36)", "ticks": "outside" }, "colorscale": [ [ 0, "#440154" ], [ 0.1111111111111111, "#482878" ], [ 0.2222222222222222, "#3e4989" ], [ 0.3333333333333333, "#31688e" ], [ 0.4444444444444444, "#26828e" ], [ 0.5555555555555556, "#1f9e89" ], [ 0.6666666666666666, "#35b779" ], [ 0.7777777777777778, "#6ece58" ], [ 0.8888888888888888, "#b5de2b" ], [ 1, "#fde725" ] ], "type": "histogram2d" } ], "histogram2dcontour": [ { "colorbar": { "outlinewidth": 1, "tickcolor": "rgb(36,36,36)", "ticks": "outside" }, "colorscale": [ [ 0, "#440154" ], [ 0.1111111111111111, "#482878" ], [ 0.2222222222222222, "#3e4989" ], [ 0.3333333333333333, "#31688e" ], [ 0.4444444444444444, "#26828e" ], [ 0.5555555555555556, "#1f9e89" ], [ 0.6666666666666666, "#35b779" ], [ 0.7777777777777778, "#6ece58" ], [ 0.8888888888888888, "#b5de2b" ], [ 1, "#fde725" ] ], "type": "histogram2dcontour" } ], "mesh3d": [ { "colorbar": { "outlinewidth": 1, "tickcolor": "rgb(36,36,36)", "ticks": "outside" }, "type": "mesh3d" } ], "parcoords": [ { "line": { "colorbar": { "outlinewidth": 1, "tickcolor": "rgb(36,36,36)", "ticks": "outside" } }, "type": "parcoords" } ], "pie": [ { "automargin": true, "type": "pie" } ], "scatter": [ { "fillpattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 }, "type": "scatter" } ], "scatter3d": [ { "line": { "colorbar": { "outlinewidth": 1, "tickcolor": "rgb(36,36,36)", "ticks": "outside" } }, "marker": { "colorbar": { "outlinewidth": 1, "tickcolor": "rgb(36,36,36)", "ticks": "outside" } }, "type": "scatter3d" } ], "scattercarpet": [ { "marker": { "colorbar": { "outlinewidth": 1, "tickcolor": "rgb(36,36,36)", "ticks": "outside" } }, "type": "scattercarpet" } ], "scattergeo": [ { "marker": { "colorbar": { "outlinewidth": 1, "tickcolor": "rgb(36,36,36)", "ticks": "outside" } }, "type": "scattergeo" } ], "scattergl": [ { "marker": { "colorbar": { "outlinewidth": 1, "tickcolor": "rgb(36,36,36)", "ticks": "outside" } }, "type": "scattergl" } ], "scattermapbox": [ { "marker": { "colorbar": { "outlinewidth": 1, "tickcolor": "rgb(36,36,36)", "ticks": "outside" } }, "type": "scattermapbox" } ], "scatterpolar": [ { "marker": { "colorbar": { "outlinewidth": 1, "tickcolor": "rgb(36,36,36)", "ticks": "outside" } }, "type": "scatterpolar" } ], "scatterpolargl": [ { "marker": { "colorbar": { "outlinewidth": 1, "tickcolor": "rgb(36,36,36)", "ticks": "outside" } }, "type": "scatterpolargl" } ], "scatterternary": [ { "marker": { "colorbar": { "outlinewidth": 1, "tickcolor": "rgb(36,36,36)", "ticks": "outside" } }, "type": "scatterternary" } ], "surface": [ { "colorbar": { "outlinewidth": 1, "tickcolor": "rgb(36,36,36)", "ticks": "outside" }, "colorscale": [ [ 0, "#440154" ], [ 0.1111111111111111, "#482878" ], [ 0.2222222222222222, "#3e4989" ], [ 0.3333333333333333, "#31688e" ], [ 0.4444444444444444, "#26828e" ], [ 0.5555555555555556, "#1f9e89" ], [ 0.6666666666666666, "#35b779" ], [ 0.7777777777777778, "#6ece58" ], [ 0.8888888888888888, "#b5de2b" ], [ 1, "#fde725" ] ], "type": "surface" } ], "table": [ { "cells": { "fill": { "color": "rgb(237,237,237)" }, "line": { "color": "white" } }, "header": { "fill": { "color": "rgb(217,217,217)" }, "line": { "color": "white" } }, "type": "table" } ] }, "layout": { "annotationdefaults": { "arrowhead": 0, "arrowwidth": 1 }, "autotypenumbers": "strict", "coloraxis": { "colorbar": { "outlinewidth": 1, "tickcolor": "rgb(36,36,36)", "ticks": "outside" } }, "colorscale": { "diverging": [ [ 0, "rgb(103,0,31)" ], [ 0.1, "rgb(178,24,43)" ], [ 0.2, "rgb(214,96,77)" ], [ 0.3, "rgb(244,165,130)" ], [ 0.4, "rgb(253,219,199)" ], [ 0.5, "rgb(247,247,247)" ], [ 0.6, "rgb(209,229,240)" ], [ 0.7, "rgb(146,197,222)" ], [ 0.8, "rgb(67,147,195)" ], [ 0.9, "rgb(33,102,172)" ], [ 1, "rgb(5,48,97)" ] ], "sequential": [ [ 0, "#440154" ], [ 0.1111111111111111, "#482878" ], [ 0.2222222222222222, "#3e4989" ], [ 0.3333333333333333, "#31688e" ], [ 0.4444444444444444, "#26828e" ], [ 0.5555555555555556, "#1f9e89" ], [ 0.6666666666666666, "#35b779" ], [ 0.7777777777777778, "#6ece58" ], [ 0.8888888888888888, "#b5de2b" ], [ 1, "#fde725" ] ], "sequentialminus": [ [ 0, "#440154" ], [ 0.1111111111111111, "#482878" ], [ 0.2222222222222222, "#3e4989" ], [ 0.3333333333333333, "#31688e" ], [ 0.4444444444444444, "#26828e" ], [ 0.5555555555555556, "#1f9e89" ], [ 0.6666666666666666, "#35b779" ], [ 0.7777777777777778, "#6ece58" ], [ 0.8888888888888888, "#b5de2b" ], [ 1, "#fde725" ] ] }, "colorway": [ "#1F77B4", "#FF7F0E", "#2CA02C", "#D62728", "#9467BD", "#8C564B", "#E377C2", "#7F7F7F", "#BCBD22", "#17BECF" ], "font": { "color": "rgb(36,36,36)" }, "geo": { "bgcolor": "white", "lakecolor": "white", "landcolor": "white", "showlakes": true, "showland": true, "subunitcolor": "white" }, "hoverlabel": { "align": "left" }, "hovermode": "closest", "mapbox": { "style": "light" }, "paper_bgcolor": "white", "plot_bgcolor": "white", "polar": { "angularaxis": { "gridcolor": "rgb(232,232,232)", "linecolor": "rgb(36,36,36)", "showgrid": false, "showline": true, "ticks": "outside" }, "bgcolor": "white", "radialaxis": { "gridcolor": "rgb(232,232,232)", "linecolor": "rgb(36,36,36)", "showgrid": false, "showline": true, "ticks": "outside" } }, "scene": { "xaxis": { "backgroundcolor": "white", "gridcolor": "rgb(232,232,232)", "gridwidth": 2, "linecolor": "rgb(36,36,36)", "showbackground": true, "showgrid": false, "showline": true, "ticks": "outside", "zeroline": false, "zerolinecolor": "rgb(36,36,36)" }, "yaxis": { "backgroundcolor": "white", "gridcolor": "rgb(232,232,232)", "gridwidth": 2, "linecolor": "rgb(36,36,36)", "showbackground": true, "showgrid": false, "showline": true, "ticks": "outside", "zeroline": false, "zerolinecolor": "rgb(36,36,36)" }, "zaxis": { "backgroundcolor": "white", "gridcolor": "rgb(232,232,232)", "gridwidth": 2, "linecolor": "rgb(36,36,36)", "showbackground": true, "showgrid": false, "showline": true, "ticks": "outside", "zeroline": false, "zerolinecolor": "rgb(36,36,36)" } }, "shapedefaults": { "fillcolor": "black", "line": { "width": 0 }, "opacity": 0.3 }, "ternary": { "aaxis": { "gridcolor": "rgb(232,232,232)", "linecolor": "rgb(36,36,36)", "showgrid": false, "showline": true, "ticks": "outside" }, "baxis": { "gridcolor": "rgb(232,232,232)", "linecolor": "rgb(36,36,36)", "showgrid": false, "showline": true, "ticks": "outside" }, "bgcolor": "white", "caxis": { "gridcolor": "rgb(232,232,232)", "linecolor": "rgb(36,36,36)", "showgrid": false, "showline": true, "ticks": "outside" } }, "title": { "x": 0.05 }, "xaxis": { "automargin": true, "gridcolor": "rgb(232,232,232)", "linecolor": "rgb(36,36,36)", "showgrid": false, "showline": true, "ticks": "outside", "title": { "standoff": 15 }, "zeroline": false, "zerolinecolor": "rgb(36,36,36)" }, "yaxis": { "automargin": true, "gridcolor": "rgb(232,232,232)", "linecolor": "rgb(36,36,36)", "showgrid": false, "showline": true, "ticks": "outside", "title": { "standoff": 15 }, "zeroline": false, "zerolinecolor": "rgb(36,36,36)" } } }, "title": { "text": "Holt Winters Forecast", "x": 0.5 }, "width": 700, "xaxis": { "title": { "text": "Date" } }, "yaxis": { "title": { "text": "Passenger Volume" } } } } }, "metadata": {}, "output_type": "display_data" } ], "source": [ "# Plot the forecasts\n", "plot_func(forecasts, \"Holt Winters Forecast\")" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ " Month #Passengers fittedvalues residuals\n", "0 1949-01-01 112 111.997011 0.002989\n", "1 1949-02-01 118 119.397772 -1.397772\n", "2 1949-03-01 132 132.485694 -0.485694\n", "3 1949-04-01 129 126.790028 2.209972\n", "4 1949-05-01 121 118.553190 2.446810\n", ".. ... ... ... ...\n", "111 1958-04-01 348 370.894734 -22.894734\n", "112 1958-05-01 363 370.984509 -7.984509\n", "113 1958-06-01 435 435.713085 -0.713085\n", "114 1958-07-01 491 479.724073 11.275927\n", "115 1958-08-01 505 479.483081 25.516919\n", "\n", "[116 rows x 4 columns]\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "/tmp/ipykernel_68203/2996281503.py:2: SettingWithCopyWarning:\n", "\n", "\n", "A value is trying to be set on a copy of a slice from a DataFrame.\n", "Try using .loc[row_indexer,col_indexer] = value instead\n", "\n", "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", "\n", "/tmp/ipykernel_68203/2996281503.py:3: SettingWithCopyWarning:\n", "\n", "\n", "A value is trying to be set on a copy of a slice from a DataFrame.\n", "Try using .loc[row_indexer,col_indexer] = value instead\n", "\n", "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", "\n" ] } ], "source": [ "# Appending residuals and fitted values to the train dataframe\n", "train[\"fittedvalues\"] = model.fittedvalues\n", "train[\"residuals\"] = model.resid\n", "print(train)" ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [ { "data": { "image/png": "iVBORw0KGgoAAAANSUhEUgAAAw0AAAEiCAYAAAC7hD4qAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjguMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8g+/7EAAAACXBIWXMAAA9hAAAPYQGoP6dpAABFpUlEQVR4nO3dd3wUZf4H8M8mJJsCCYF0CCkoRLoGwdASJBCQYpBqORJEEASVogie0vQuZ8OCIHJ3EO5nlA4iItJRIUePCEIOQugptBRSIfv8/gi7ZJPNZDfZ3ZlNPu/XK6/szszOPDOzO9/n+8zMMyohhAAREREREVEV7OQuABERERERKRuTBiIiIiIiksSkgYiIiIiIJDFpICIiIiIiSUwaiIiIiIhIEpMGIiIiIiKSxKSBiIiIiIgkMWkgIiIiIiJJTBqIiIiIiEgSkwYihdu7dy9UKhX27t1r1vmqVCrMmzfPrPMkIqqtefPmQaVS1eizkZGRiIyMNG+ByCBLbOva7HuyPCYNZFVLliyBSqVC165dazWfrVu3ssJrBG4nIjJFQkICVCqV7s/JyQmtWrXClClTkJmZabblFBQUYN68eWZvDDFVaWkp/P39oVKp8NNPP9VqXkpZJ6XjdrJdTBrIqhITExEUFIRDhw7h3LlzNZ7P1q1bMX/+fDOWrG6S2k6FhYV45513rFwiIrIFCxYswP/93//hyy+/RLdu3fDVV18hPDwcBQUFZpl/QUEB5s+fb7Di+M4776CwsNAsy6nO7t27kZ6ejqCgICQmJtZqXlLrRA8oZd+T6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dcEBAIKDg/Hjjz9i2rRp+Pzzz9G8eXP861//QnR0tCWLCQAIbPqgtWh631ZwcVTUlVtERHUOYwQRke2w6FEvMjISUo+BMPQkz8jISBw/ftyCpSIiIiVgjCAish2KuqeBiIiIiIiUh0kDERERERFJYtJARERERESSmDQQEREREZEkJg1ERERERCSJSQMREREREUli0kBERERERJKYNBARERERkSQmDUREREREJIlJAxERERERSWLSQEREREREkpg0EBERERGRJCYNREREREQkiUkDERERERFJYtJARERERESSmDQQEREREZEkJg1ERERERCSJSQMREREREUli0kBERERERJKYNBARERERkSQmDUREREREJIlJAxERERERSWLSQEREREREkpg0EBERERGRJCYNREREREQkiUkDERERERFJYtJARERERESSmDQQEREREZEkJg1ERERERCSJSQMREREREUli0kBERERERJKYNBARERERkSQmDUREREREJIlJAxERERERSWLSQEREREREkpg0EBERERGRJCYNREREREQkiUkDERERERFJYtJARERERESSmDQQEREREZEkqyQNixcvRlBQEJycnNC1a1ccOnSoymkTEhKgUqn0/pycnKxRTCIisjLGByIi22DxpGH16tWYPn065s6di2PHjqFjx46Ijo5GVlZWlZ9xc3NDenq67u/ixYuWLiYREVkZ4wMRke2weNKwcOFCjB8/HmPHjkWbNm2wdOlSuLi4YPny5VV+RqVSwdfXV/fn4+Nj6WISEZGVMT4QEdkOiyYNJSUlOHr0KKKioh4s0M4OUVFRSEpKqvJzd+7cQWBgIAICAvD000/j1KlTVU5bXFyM3NxcvT8iIlI2a8QHgDGCiMhcLJo03LhxA6WlpZVagnx8fJCRkWHwM61bt8by5cvx/fff45tvvoFGo0G3bt1w5coVg9PHx8fD3d1d9xcQEGD29SAiIvOyRnwAGCOIiMxFcb0nhYeHY8yYMejUqRMiIiKwYcMGeHl54euvvzY4/ezZs5GTk6P7u3z5spVLTERE1mBqfAAYI4iIzKWBJWfu6ekJe3t7ZGZm6g3PzMyEr6+vUfNwcHDAo48+inPnzhkcr1aroVara11WIiKyHmvEB4AxgojIXCx6psHR0RFhYWHYtWuXbphGo8GuXbsQHh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ElFTkSuQmCC", "text/plain": [ "
" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "# Import packages\n", "from statsmodels.tsa.holtwinters import ExponentialSmoothing\n", "from statsmodels.graphics.tsaplots import plot_pacf, plot_acf\n", "import matplotlib.pyplot as plt\n", "\n", "# Plot ACF and PACF\n", "fig, ax = plt.subplots(1, 2, figsize=(8, 3))\n", "plot_acf(train[\"residuals\"], lags=30, ax=ax[0])\n", "ax[0].set_xlabel(\"Lags\")\n", "plot_pacf(train[\"residuals\"], lags=30, ax=ax[1])\n", "ax[1].set_xlabel(\"Lags\")\n", "plt.tight_layout()\n", "plt.show()" ] }, { "cell_type": "code", "execution_count": 5, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ " lb_stat lb_pvalue\n", "1 13.917146 0.000191\n", "2 16.931975 0.000211\n", "3 18.861072 0.000292\n", "4 22.061208 0.000195\n", "5 23.398389 0.000283\n", "6 24.627916 0.000400\n", "7 27.059270 0.000325\n", "8 29.031125 0.000313\n", "9 29.344194 0.000567\n", "10 30.414797 0.000733\n" ] } ], "source": [ "# Import packages\n", "from statsmodels.stats.diagnostic import acorr_ljungbox\n", "\n", "# Carry out Ljung-Box test\n", "print(acorr_ljungbox(train[\"residuals\"], return_df=True))" ] }, { "cell_type": "code", "execution_count": 6, "metadata": {}, "outputs": [ { "data": { "application/vnd.plotly.v1+json": { "config": { "plotlyServerURL": "https://plot.ly" }, "data": [ { "alignmentgroup": "True", "bingroup": "x", "hovertemplate": "residuals=%{x}
count=%{y}", "legendgroup": "", "marker": { "color": "#636efa", "pattern": { "shape": "" } }, "name": "", "offsetgroup": "", "orientation": "v", "showlegend": false, "type": "histogram", "x": [ 0.0029885509041491787, -1.3977715272270643, -0.48569421554674364, 2.2099717953831686, 2.446809977007419, 2.3144994254786297, 0.28556472864667626, 0.40306903295868324, 0.18403920366532134, -0.04208236753810013, -2.5501023923200705, -6.29759906988788, -10.229186708520444, -2.368196190757004, -1.774909044075656, -2.944427246017426, -2.3164716464191315, 8.894391720365405, 12.773425732045155, 8.021542496626495, 6.3938451376440355, -1.8295756887681591, -4.325666783707902, 4.933776860742455, 7.027712806164146, -4.986483130472379, 5.896239262631809, -5.3526516357399885, 16.945257143276194, -10.16330949640988, -4.944998899610738, 0.9205502968079884, 2.5492987644452683, 7.6812334267379185, 9.22451433413886, -3.939135589356937, -0.12621848703417982, 0.8607821050434552, -17.2004360249843, -7.725564224913484, -5.516814147104384, 21.364441470705543, -1.0625794875336965, 11.790871781967894, -6.8978711263413, 6.695076515136606, 7.765379650379913, 2.3199950587865033, -2.40502910993294, -11.48877789361913, 10.79669447458474, 16.736190534408593, -0.7404245436632664, -19.962443055120275, -5.122304781654179, -3.807795791922274, -2.801989236121443, -4.161863475942425, -8.911321173661918, -7.131878723540041, -4.474931923945718, -23.413031761022665, -4.2149616939771875, -2.9716710867565155, 11.026545675063062, 15.254104664253504, 23.7142825013604, -4.70522614277229, 0.01958530302596273, -3.3207064444839034, 2.1613915180581387, 0.8472323030811424, 8.21777781178784, 4.181389874460734, -22.0839071802676, -3.3693400826678612, -4.3450525751828195, 14.386970324000288, 24.657192016498527, 6.996032443646584, 9.094338914261755, 1.567450154167318, -4.031945907366662, 8.242082877409644, -0.6529483997401258, 5.145992785955741, -6.772498617345718, -11.644406877619758, -5.328418703681336, 5.798031620809638, -3.670207724448119, 12.670803302810725, 1.899004592682786, -3.9885106693641887, 2.4537054522558037, -6.480207447525345, -1.885911533008482, -5.1585668701517875, 5.069210384357689, -5.389074626082618, -4.115533130982101, 4.048543178694501, 0.18305617021218268, 16.622084122662272, 4.530722394100678, -0.5708764645976885, -1.5357322325141922, -12.269306120989484, -14.424515668193578, -17.55959645806837, -24.711198636612266, -22.894734481480498, -7.984509158554715, -0.7130852089628092, 11.27592737559496, 25.516918733725618 ], "xaxis": "x", "yaxis": "y" } ], "layout": { "barmode": "relative", "font": { "size": 18 }, "height": 400, "legend": { "tracegroupgap": 0 }, "margin": { "t": 60 }, "template": { "data": { "bar": [ { "error_x": { "color": "rgb(36,36,36)" }, "error_y": { "color": "rgb(36,36,36)" }, "marker": { "line": { "color": "white", "width": 0.5 }, "pattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 } }, "type": "bar" } ], "barpolar": [ { "marker": { "line": { "color": "white", "width": 0.5 }, "pattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 } }, "type": "barpolar" } ], "carpet": [ { "aaxis": { "endlinecolor": "rgb(36,36,36)", "gridcolor": "white", "linecolor": "white", "minorgridcolor": "white", "startlinecolor": "rgb(36,36,36)" }, "baxis": { "endlinecolor": "rgb(36,36,36)", "gridcolor": "white", "linecolor": "white", "minorgridcolor": "white", "startlinecolor": "rgb(36,36,36)" }, "type": "carpet" } ], "choropleth": [ { "colorbar": { "outlinewidth": 1, "tickcolor": "rgb(36,36,36)", "ticks": "outside" }, "type": "choropleth" } ], "contour": [ { "colorbar": { "outlinewidth": 1, "tickcolor": "rgb(36,36,36)", "ticks": "outside" }, "colorscale": [ [ 0, "#440154" ], [ 0.1111111111111111, "#482878" ], [ 0.2222222222222222, "#3e4989" ], [ 0.3333333333333333, "#31688e" ], [ 0.4444444444444444, "#26828e" ], [ 0.5555555555555556, "#1f9e89" ], [ 0.6666666666666666, "#35b779" ], [ 0.7777777777777778, "#6ece58" ], [ 0.8888888888888888, "#b5de2b" ], [ 1, "#fde725" ] ], "type": "contour" } ], "contourcarpet": [ { "colorbar": { "outlinewidth": 1, "tickcolor": "rgb(36,36,36)", "ticks": "outside" }, "type": "contourcarpet" } ], "heatmap": [ { "colorbar": { "outlinewidth": 1, "tickcolor": "rgb(36,36,36)", "ticks": "outside" }, "colorscale": [ [ 0, "#440154" ], [ 0.1111111111111111, "#482878" ], [ 0.2222222222222222, "#3e4989" ], [ 0.3333333333333333, "#31688e" ], [ 0.4444444444444444, "#26828e" ], [ 0.5555555555555556, "#1f9e89" ], [ 0.6666666666666666, "#35b779" ], [ 0.7777777777777778, "#6ece58" ], [ 0.8888888888888888, "#b5de2b" ], [ 1, "#fde725" ] ], "type": "heatmap" } ], "heatmapgl": [ { "colorbar": { "outlinewidth": 1, "tickcolor": "rgb(36,36,36)", "ticks": "outside" }, "colorscale": [ [ 0, "#440154" ], [ 0.1111111111111111, "#482878" ], [ 0.2222222222222222, "#3e4989" ], [ 0.3333333333333333, "#31688e" ], [ 0.4444444444444444, "#26828e" ], [ 0.5555555555555556, "#1f9e89" ], [ 0.6666666666666666, "#35b779" ], [ 0.7777777777777778, "#6ece58" ], [ 0.8888888888888888, "#b5de2b" ], [ 1, "#fde725" ] ], "type": "heatmapgl" } ], "histogram": [ { "marker": { "line": { "color": "white", "width": 0.6 } }, "type": "histogram" } ], "histogram2d": [ { "colorbar": { "outlinewidth": 1, "tickcolor": "rgb(36,36,36)", "ticks": "outside" }, "colorscale": [ [ 0, "#440154" ], [ 0.1111111111111111, "#482878" ], [ 0.2222222222222222, "#3e4989" ], [ 0.3333333333333333, "#31688e" ], [ 0.4444444444444444, "#26828e" ], [ 0.5555555555555556, "#1f9e89" ], [ 0.6666666666666666, "#35b779" ], [ 0.7777777777777778, "#6ece58" ], [ 0.8888888888888888, "#b5de2b" ], [ 1, "#fde725" ] ], "type": "histogram2d" } ], "histogram2dcontour": [ { "colorbar": { "outlinewidth": 1, "tickcolor": "rgb(36,36,36)", "ticks": "outside" }, "colorscale": [ [ 0, "#440154" ], [ 0.1111111111111111, "#482878" ], [ 0.2222222222222222, "#3e4989" ], [ 0.3333333333333333, "#31688e" ], [ 0.4444444444444444, "#26828e" ], [ 0.5555555555555556, "#1f9e89" ], [ 0.6666666666666666, "#35b779" ], [ 0.7777777777777778, "#6ece58" ], [ 0.8888888888888888, "#b5de2b" ], [ 1, "#fde725" ] ], "type": "histogram2dcontour" } ], "mesh3d": [ { "colorbar": { "outlinewidth": 1, "tickcolor": "rgb(36,36,36)", "ticks": "outside" }, "type": "mesh3d" } ], "parcoords": [ { "line": { "colorbar": { "outlinewidth": 1, "tickcolor": "rgb(36,36,36)", "ticks": "outside" } }, "type": "parcoords" } ], "pie": [ { "automargin": true, "type": "pie" } ], "scatter": [ { "fillpattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 }, "type": "scatter" } ], "scatter3d": [ { "line": { "colorbar": { "outlinewidth": 1, "tickcolor": "rgb(36,36,36)", "ticks": "outside" } }, "marker": { "colorbar": { "outlinewidth": 1, "tickcolor": "rgb(36,36,36)", "ticks": "outside" } }, "type": "scatter3d" } ], "scattercarpet": [ { "marker": { "colorbar": { "outlinewidth": 1, "tickcolor": "rgb(36,36,36)", "ticks": "outside" } }, "type": "scattercarpet" } ], "scattergeo": [ { "marker": { "colorbar": { "outlinewidth": 1, "tickcolor": "rgb(36,36,36)", "ticks": "outside" } }, "type": "scattergeo" } ], "scattergl": [ { "marker": { "colorbar": { "outlinewidth": 1, "tickcolor": "rgb(36,36,36)", "ticks": "outside" } }, "type": "scattergl" } ], "scattermapbox": [ { "marker": { "colorbar": { "outlinewidth": 1, "tickcolor": "rgb(36,36,36)", "ticks": "outside" } }, "type": "scattermapbox" } ], "scatterpolar": [ { "marker": { "colorbar": { "outlinewidth": 1, "tickcolor": "rgb(36,36,36)", "ticks": "outside" } }, "type": "scatterpolar" } ], "scatterpolargl": [ { "marker": { "colorbar": { "outlinewidth": 1, "tickcolor": "rgb(36,36,36)", "ticks": "outside" } }, "type": "scatterpolargl" } ], "scatterternary": [ { "marker": { "colorbar": { "outlinewidth": 1, "tickcolor": "rgb(36,36,36)", "ticks": "outside" } }, "type": "scatterternary" } ], "surface": [ { "colorbar": { "outlinewidth": 1, "tickcolor": "rgb(36,36,36)", "ticks": "outside" }, "colorscale": [ [ 0, "#440154" ], [ 0.1111111111111111, "#482878" ], [ 0.2222222222222222, "#3e4989" ], [ 0.3333333333333333, "#31688e" ], [ 0.4444444444444444, "#26828e" ], [ 0.5555555555555556, "#1f9e89" ], [ 0.6666666666666666, "#35b779" ], [ 0.7777777777777778, "#6ece58" ], [ 0.8888888888888888, "#b5de2b" ], [ 1, "#fde725" ] ], "type": "surface" } ], "table": [ { "cells": { "fill": { "color": "rgb(237,237,237)" }, "line": { "color": "white" } }, "header": { "fill": { "color": "rgb(217,217,217)" }, "line": { "color": "white" } }, "type": "table" } ] }, "layout": { "annotationdefaults": { "arrowhead": 0, "arrowwidth": 1 }, "autotypenumbers": "strict", "coloraxis": { "colorbar": { "outlinewidth": 1, "tickcolor": "rgb(36,36,36)", "ticks": "outside" } }, "colorscale": { "diverging": [ [ 0, "rgb(103,0,31)" ], [ 0.1, "rgb(178,24,43)" ], [ 0.2, "rgb(214,96,77)" ], [ 0.3, "rgb(244,165,130)" ], [ 0.4, "rgb(253,219,199)" ], [ 0.5, "rgb(247,247,247)" ], [ 0.6, "rgb(209,229,240)" ], [ 0.7, "rgb(146,197,222)" ], [ 0.8, "rgb(67,147,195)" ], [ 0.9, "rgb(33,102,172)" ], [ 1, "rgb(5,48,97)" ] ], "sequential": [ [ 0, "#440154" ], [ 0.1111111111111111, "#482878" ], [ 0.2222222222222222, "#3e4989" ], [ 0.3333333333333333, "#31688e" ], [ 0.4444444444444444, "#26828e" ], [ 0.5555555555555556, "#1f9e89" ], [ 0.6666666666666666, "#35b779" ], [ 0.7777777777777778, "#6ece58" ], [ 0.8888888888888888, "#b5de2b" ], [ 1, "#fde725" ] ], "sequentialminus": [ [ 0, "#440154" ], [ 0.1111111111111111, "#482878" ], [ 0.2222222222222222, "#3e4989" ], [ 0.3333333333333333, "#31688e" ], [ 0.4444444444444444, "#26828e" ], [ 0.5555555555555556, "#1f9e89" ], [ 0.6666666666666666, "#35b779" ], [ 0.7777777777777778, "#6ece58" ], [ 0.8888888888888888, "#b5de2b" ], [ 1, "#fde725" ] ] }, "colorway": [ "#1F77B4", "#FF7F0E", "#2CA02C", "#D62728", "#9467BD", "#8C564B", "#E377C2", "#7F7F7F", "#BCBD22", "#17BECF" ], "font": { "color": "rgb(36,36,36)" }, "geo": { "bgcolor": "white", "lakecolor": "white", "landcolor": "white", "showlakes": true, "showland": true, "subunitcolor": "white" }, "hoverlabel": { "align": "left" }, "hovermode": "closest", "mapbox": { "style": "light" }, "paper_bgcolor": "white", "plot_bgcolor": "white", "polar": { "angularaxis": { "gridcolor": "rgb(232,232,232)", "linecolor": "rgb(36,36,36)", "showgrid": false, "showline": true, "ticks": "outside" }, "bgcolor": "white", "radialaxis": { "gridcolor": "rgb(232,232,232)", "linecolor": "rgb(36,36,36)", "showgrid": false, "showline": true, "ticks": "outside" } }, "scene": { "xaxis": { "backgroundcolor": "white", "gridcolor": "rgb(232,232,232)", "gridwidth": 2, "linecolor": "rgb(36,36,36)", "showbackground": true, "showgrid": false, "showline": true, "ticks": "outside", "zeroline": false, "zerolinecolor": "rgb(36,36,36)" }, "yaxis": { "backgroundcolor": "white", "gridcolor": "rgb(232,232,232)", "gridwidth": 2, "linecolor": "rgb(36,36,36)", "showbackground": true, "showgrid": false, "showline": true, "ticks": "outside", "zeroline": false, "zerolinecolor": "rgb(36,36,36)" }, "zaxis": { "backgroundcolor": "white", "gridcolor": "rgb(232,232,232)", "gridwidth": 2, "linecolor": "rgb(36,36,36)", "showbackground": true, "showgrid": false, "showline": true, "ticks": "outside", "zeroline": false, "zerolinecolor": "rgb(36,36,36)" } }, "shapedefaults": { "fillcolor": "black", "line": { "width": 0 }, "opacity": 0.3 }, "ternary": { "aaxis": { "gridcolor": "rgb(232,232,232)", "linecolor": "rgb(36,36,36)", "showgrid": false, "showline": true, "ticks": "outside" }, "baxis": { "gridcolor": "rgb(232,232,232)", "linecolor": "rgb(36,36,36)", "showgrid": false, "showline": true, "ticks": "outside" }, "bgcolor": "white", "caxis": { "gridcolor": "rgb(232,232,232)", "linecolor": "rgb(36,36,36)", "showgrid": false, "showline": true, "ticks": "outside" } }, "title": { "x": 0.05 }, "xaxis": { "automargin": true, "gridcolor": "rgb(232,232,232)", "linecolor": "rgb(36,36,36)", "showgrid": false, "showline": true, "ticks": "outside", "title": { "standoff": 15 }, "zeroline": false, "zerolinecolor": "rgb(36,36,36)" }, "yaxis": { "automargin": true, "gridcolor": "rgb(232,232,232)", "linecolor": "rgb(36,36,36)", "showgrid": false, "showline": true, "ticks": "outside", "title": { "standoff": 15 }, "zeroline": false, "zerolinecolor": "rgb(36,36,36)" } } }, "title": { "text": "Distribution of Residuals", "x": 0.5 }, "width": 700, "xaxis": { "anchor": "y", "domain": [ 0, 1 ], "title": { "text": "Residuals" } }, "yaxis": { "anchor": "x", "domain": [ 0, 1 ], "title": { "text": "Count" } } } } }, "metadata": {}, "output_type": "display_data" }, { "name": "stdout", "output_type": "stream", "text": [ "-0.023048689329401923\n" ] } ], "source": [ "# Import plotly\n", "import plotly.graph_objects as go\n", "\n", "# Plot histogram of the residuals\n", "fig = px.histogram(train, x=\"residuals\")\n", "fig.update_layout(\n", " template=\"simple_white\",\n", " font=dict(size=18),\n", " title_text=\"Distribution of Residuals\",\n", " width=700,\n", " title_x=0.5,\n", " height=400,\n", " xaxis_title=\"Residuals\",\n", " yaxis_title=\"Count\",\n", ")\n", "fig.show()\n", "\n", "# Mean of residuals\n", "print(train[\"residuals\"].mean())" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "py311-kfp240-airflow251", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.11.5" } }, "nbformat": 4, "nbformat_minor": 2 }