{ "cells": [ { "cell_type": "markdown", "metadata": { "id": "fv9OoQsMFk5A" }, "source": [] }, { "cell_type": "markdown", "metadata": {}, "source": [ "In diesem Notebook zeigen wir, wie man:\n", "\n", "- 2D-Zeitreihendaten für das Training eines SVM-Regressormodells vorbereitet \n", "- SVR mit einem RBF-Kernel implementiert \n", "- das Modell mithilfe von Diagrammen und MAPE bewertet \n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Module importieren\n" ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [], "source": [ "import sys\n", "sys.path.append('../../')" ] }, { "cell_type": "code", "execution_count": 2, "metadata": { "id": "M687KNlQFp0-" }, "outputs": [], "source": [ "import os\n", "import warnings\n", "import matplotlib.pyplot as plt\n", "import numpy as np\n", "import pandas as pd\n", "import datetime as dt\n", "import math\n", "\n", "from sklearn.svm import SVR\n", "from sklearn.preprocessing import MinMaxScaler\n", "from common.utils import load_data, mape" ] }, { "cell_type": "markdown", "metadata": { "id": "Cj-kfVdMGjWP" }, "source": [ "## Daten vorbereiten\n" ] }, { "cell_type": "markdown", "metadata": { "id": "8fywSjC6GsRz" }, "source": [ "### Daten laden\n" ] }, { "cell_type": "code", "execution_count": 3, "metadata": { "colab": { "base_uri": "https://localhost:8080/", "height": 363 }, "id": "aBDkEB11Fumg", "outputId": "99cf7987-0509-4b73-8cc2-75d7da0d2740" }, "outputs": [ { "data": { "text/html": [ "
\n", " | load | \n", "
---|---|
2012-01-01 00:00:00 | \n", "2698.0 | \n", "
2012-01-01 01:00:00 | \n", "2558.0 | \n", "
2012-01-01 02:00:00 | \n", "2444.0 | \n", "
2012-01-01 03:00:00 | \n", "2402.0 | \n", "
2012-01-01 04:00:00 | \n", "2403.0 | \n", "