pyFTS/GOOGLE COLAB Cheng - TrendWeightedFTS.ipynb

837 lines
713 KiB
Plaintext
Raw Normal View History

{
"nbformat": 4,
"nbformat_minor": 0,
"metadata": {
"colab": {
"name": "Cheng%20-%20TrendWeightedFTS.ipynb",
"version": "0.3.2",
"provenance": []
},
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
}
},
"cells": [
{
"cell_type": "markdown",
"metadata": {
"id": "view-in-github",
"colab_type": "text"
},
"source": [
"[View in Colaboratory](https://colab.research.google.com/github/petroniocandido/pyFTS/blob/master/GOOGLE%20COLAB%20Cheng%20-%20TrendWeightedFTS.ipynb)"
]
},
{
"metadata": {
"id": "fv3g4xdNiPhV",
"colab_type": "text"
},
"cell_type": "markdown",
"source": [
"# Trend Weighted Fuzzy Time Series by Cheng, Chen and Wu (2009)\n",
"\n",
"C.-H. Cheng, Y.-S. Chen, and Y.-L. Wu, “Forecasting innovation diffusion of products using trend-weighted fuzzy time-series model,” \n",
"Expert Syst. Appl., vol. 36, no. 2, pp. 18261832, 2009."
]
},
{
"metadata": {
"id": "IAiBsikgiPhY",
"colab_type": "text"
},
"cell_type": "markdown",
"source": [
"## Environment Setup"
]
},
{
"metadata": {
"id": "VugE64AIiPhd",
"colab_type": "text"
},
"cell_type": "markdown",
"source": [
"### Library install/update"
]
},
{
"metadata": {
"id": "B_YO5b1yiPhg",
"colab_type": "code",
"colab": {}
},
"cell_type": "code",
"source": [
"!pip3 install -U git+https://github.com/petroniocandido/pyFTS\n",
"!pip3 install dill"
],
"execution_count": 0,
"outputs": []
},
{
"metadata": {
"id": "q3hDVCskiPhp",
"colab_type": "text"
},
"cell_type": "markdown",
"source": [
"### External libraries import"
]
},
{
"metadata": {
"id": "TuawpGrtiPhr",
"colab_type": "code",
"colab": {},
"outputId": "2c24d40d-4622-4dbc-8a08-e39bb1b3aefb"
},
"cell_type": "code",
"source": [
"import warnings\n",
"warnings.filterwarnings('ignore')\n",
"\n",
"import numpy as np\n",
"import pandas as pd\n",
"import matplotlib.pylab as plt\n",
"import seaborn as sns\n",
"\n",
"%pylab inline"
],
"execution_count": 0,
"outputs": [
{
"output_type": "stream",
"text": [
"Populating the interactive namespace from numpy and matplotlib\n"
],
"name": "stdout"
}
]
},
{
"metadata": {
"id": "SYy_OZUwiPh1",
"colab_type": "text"
},
"cell_type": "markdown",
"source": [
"### Common pyFTS imports "
]
},
{
"metadata": {
"id": "KXUdwKyfiPh3",
"colab_type": "code",
"colab": {}
},
"cell_type": "code",
"source": [
"from pyFTS.common import Util as cUtil\n",
"from pyFTS.benchmarks import benchmarks as bchmk, Util as bUtil\n",
"from pyFTS.partitioners import Util as pUtil\n",
"\n",
"from pyFTS.models import cheng\n"
],
"execution_count": 0,
"outputs": []
},
{
"metadata": {
"id": "l5M4ousciPh-",
"colab_type": "text"
},
"cell_type": "markdown",
"source": [
"## Common data transformations"
]
},
{
"metadata": {
"id": "iTpP26KjiPh_",
"colab_type": "code",
"colab": {}
},
"cell_type": "code",
"source": [
"from pyFTS.common import Transformations\n",
"\n",
"tdiff = Transformations.Differential(1)\n",
"\n",
"boxcox = Transformations.BoxCox(0)"
],
"execution_count": 0,
"outputs": []
},
{
"metadata": {
"id": "L9AMR7d1iPiG",
"colab_type": "text"
},
"cell_type": "markdown",
"source": [
"## Datasets"
]
},
{
"metadata": {
"id": "sreJLRRgiPiJ",
"colab_type": "text"
},
"cell_type": "markdown",
"source": [
"### Data Loading"
]
},
{
"metadata": {
"id": "3e-A5rN9iPiK",
"colab_type": "code",
"colab": {}
},
"cell_type": "code",
"source": [
"from pyFTS.data import TAIEX, NASDAQ, SP500\n",
"\n",
"dataset_names = [\"TAIEX\", \"SP500\",\"NASDAQ\"]\n",
"\n",
"def get_dataset(name):\n",
" if dataset_name == \"TAIEX\":\n",
" return TAIEX.get_data()\n",
" elif dataset_name == \"SP500\":\n",
" return SP500.get_data()[11500:16000]\n",
" elif dataset_name == \"NASDAQ\":\n",
" return NASDAQ.get_data()\n",
"\n",
"\n",
"train_split = 2000\n",
"test_length = 200"
],
"execution_count": 0,
"outputs": []
},
{
"metadata": {
"id": "nMeCAWv5iPiT",
"colab_type": "text"
},
"cell_type": "markdown",
"source": [
"### Visualization"
]
},
{
"metadata": {
"id": "lZOWiOloiPiV",
"colab_type": "code",
"colab": {},
"outputId": "2a0505b6-0055-4109-d2f3-1d6aa0e98544"
},
"cell_type": "code",
"source": [
"fig, ax = plt.subplots(nrows=2, ncols=3, figsize=[10,5])\n",
"\n",
"for count,dataset_name in enumerate(dataset_names):\n",
" dataset = get_dataset(dataset_name)\n",
" dataset_diff = tdiff.apply(dataset)\n",
"\n",
" ax[0][count].plot(dataset)\n",
" ax[1][count].plot(dataset_diff)\n",
" ax[0][count].set_title(dataset_name)"
],
"execution_count": 0,
"outputs": [
{
"output_type": "display_data",
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAmoAAAE/CAYAAAD2ee+mAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMS4yLCBo\ndHRwOi8vbWF0cGxvdGxpYi5vcmcvNQv5yAAAIABJREFUeJzsnXd4FOX2x79n0yD0EjoYCAEEpIug\nFBGkesUuVvSiXK+9XQV7F7tiwWvB8ruKoGIF6V167yWE0EsIEEhC6p7fH/PO7ruzs32TnV3ez/Pk\nYeadsrMhM3PeU76HmBkKhUKhUCgUCuthi/QFKBQKhUKhUCjMUYaaQqFQKBQKhUVRhppCoVAoFAqF\nRVGGmkKhUCgUCoVFUYaaQqFQKBQKhUVRhppCoVAoFAqFRVGGmkKhUCgUCoVFUYZalEJEedKPnYjO\nSuu3SPvdQURMRDcajr+UiA5I6wuIqNBw3j/Etn8Q0REiqi3tP5yIDhJRjYr4vgqFPxBRLyJaSkS5\nRHSCiP4mogvFfVAm/q5PE9F6IrpCHJMq7hH5b/9Z6ZxJRDRRHHeEiB41fGZ/ItpORAVENJ+Izqv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gsKwZJbwG30rnshxxtuCdfXbpP9JyLkOFQqHwA2bGij3a66Bzs5p+HSM6cmwSHThWi7Gw\nRWUUivJg7raj+EZyqmw+mIu/M3IAAJe/t8hl31MFmnd5YNv65XItweao1RdJzwBwBIB+dY0B7Jf2\n0zWgvI0HpBlFRKuJaHV2dvDerWAJwU6DbHCr+ai1eX36NkxcsifSl6FQWI4pq/djxGfLAQA3Xdgs\nkEP7iTB/N7Eez
"text/plain": [
"<matplotlib.figure.Figure at 0x7fdb3b6d4eb8>"
]
},
"metadata": {
"tags": []
}
}
]
},
{
"metadata": {
"id": "J7Rb2JlWiPif",
"colab_type": "text"
},
"cell_type": "markdown",
"source": [
"### Statistics"
]
},
{
"metadata": {
"id": "QO7RegoZiPii",
"colab_type": "code",
"colab": {},
"outputId": "3d8330e7-5d83-41f1-90c9-8627faa16177"
},
"cell_type": "code",
"source": [
"from statsmodels.tsa.stattools import adfuller\n",
"\n",
"rows =[]\n",
"\n",
"for count,dataset_name in enumerate(dataset_names):\n",
" row = [dataset_name]\n",
" dataset = get_dataset(dataset_name)\n",
" result = adfuller(dataset)\n",
" row.extend([result[0],result[1]])\n",
" row.extend([value for key, value in result[4].items()])\n",
" rows.append(row)\n",
" \n",
"pd.DataFrame(rows,columns=['Dataset','ADF Statistic','p-value','Cr. Val. 1%','Cr. Val. 5%','Cr. Val. 10%'])\n"
],
"execution_count": 0,
"outputs": [
{
"output_type": "execute_result",
"data": {
"text/html": [
"<div>\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: right;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>Dataset</th>\n",
" <th>ADF Statistic</th>\n",
" <th>p-value</th>\n",
" <th>Cr. Val. 1%</th>\n",
" <th>Cr. Val. 5%</th>\n",
" <th>Cr. Val. 10%</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>0</th>\n",
" <td>TAIEX</td>\n",
" <td>-2.656728</td>\n",
" <td>0.081830</td>\n",
" <td>-3.431601</td>\n",
" <td>-2.862093</td>\n",
" <td>-2.567064</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1</th>\n",
" <td>SP500</td>\n",
" <td>-1.747171</td>\n",
" <td>0.406987</td>\n",
" <td>-3.431811</td>\n",
" <td>-2.862186</td>\n",
" <td>-2.567114</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2</th>\n",
" <td>NASDAQ</td>\n",
" <td>0.476224</td>\n",
" <td>0.984132</td>\n",
" <td>-3.432022</td>\n",
" <td>-2.862279</td>\n",
" <td>-2.567163</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"text/plain": [
" Dataset ADF Statistic p-value Cr. Val. 1% Cr. Val. 5% Cr. Val. 10%\n",
"0 TAIEX -2.656728 0.081830 -3.431601 -2.862093 -2.567064\n",
"1 SP500 -1.747171 0.406987 -3.431811 -2.862186 -2.567114\n",
"2 NASDAQ 0.476224 0.984132 -3.432022 -2.862279 -2.567163"
]
},
"metadata": {
"tags": []
},
"execution_count": 6
}
]
},
{
"metadata": {
"id": "8RNhM8gsiPit",
"colab_type": "text"
},
"cell_type": "markdown",
"source": [
"## Partitioning\n",
"\n",
"The best number of partitions of the Universe of Discourse is an optimization problem. The know more about partitioning schemes please look on the Partitioners notebook. To know more about benchmarking look on the Benchmarks notebook."
]
},
{
"metadata": {
"id": "1UyPiXLEiPiv",
"colab_type": "code",
"colab": {}
},
"cell_type": "code",
"source": [
"from pyFTS.partitioners import Grid, Util as pUtil\n",
"from pyFTS.benchmarks import benchmarks as bchmk\n",
"from pyFTS.models import chen\n",
"\n",
"tag = 'partitioning'\n",
"_type = 'point'\n",
"\n",
"for dataset_name in dataset_names:\n",
" dataset = get_dataset(dataset_name)\n",
"\n",
" bchmk.sliding_window_benchmarks(dataset, 1000, train=0.8, inc=0.2,\n",
" methods=[cheng.TrendWeightedFTS],\n",
" benchmark_models=False,\n",
" transformations=[None],\n",
" partitions=np.arange(10,100,2), \n",
" progress=False, type=_type,\n",
" file=\"benchmarks.db\", dataset=dataset_name, tag=tag)\n",
"\n",
" bchmk.sliding_window_benchmarks(dataset, 1000, train=0.8, inc=0.2,\n",
" methods=[cheng.TrendWeightedFTS],\n",
" benchmark_models=False,\n",
" transformations=[tdiff],\n",
" partitions=np.arange(3,30,1), \n",
" progress=False, type=_type,\n",
" file=\"benchmarks.db\", dataset=dataset_name, tag=tag)\n"
],
"execution_count": 0,
"outputs": []
},
{
"metadata": {
"id": "NH2uIY6ciPiz",
"colab_type": "code",
"colab": {}
},
"cell_type": "code",
"source": [
"from pyFTS.benchmarks import Util as bUtil\n",
"\n",
"df1 = bUtil.get_dataframe_from_bd(\"benchmarks.db\",\n",
" \"tag = 'partitioning' and measure = 'rmse'and transformation is null\")\n",
"\n",
"df2 = bUtil.get_dataframe_from_bd(\"benchmarks.db\",\n",
" \"tag = 'partitioning' and measure = 'rmse' and transformation is not null\")\n",
"\n",
"fig, ax = plt.subplots(nrows=2, ncols=1, figsize=[15,7])\n",
"\n",
"g1 = sns.boxplot(x='Partitions', y='Value', hue='Dataset', data=df1, showfliers=False, ax=ax[0], \n",
" palette=\"Set3\")\n",
"box = g1.get_position()\n",
"g1.set_position([box.x0, box.y0, box.width * 0.85, box.height]) \n",
"g1.legend(loc='right', bbox_to_anchor=(1.15, 0.5), ncol=1)\n",
"ax[0].set_title(\"Original data\")\n",
"ax[0].set_ylabel(\"RMSE\")\n",
"ax[0].set_xlabel(\"\")\n",
"\n",
"g2 = sns.boxplot(x='Partitions', y='Value', hue='Dataset', data=df2, showfliers=False, ax=ax[1], \n",
" palette=\"Set3\")\n",
"box = g2.get_position()\n",
"g2.set_position([box.x0, box.y0, box.width * 0.85, box.height]) \n",
"g2.legend(loc='right', bbox_to_anchor=(1.15, 0.5), ncol=1)\n",
"ax[1].set_title(\"Differentiated data\")\n",
"ax[1].set_ylabel(\"RMSE\")\n",
"ax[1].set_xlabel(\"Number of partitions of the UoD\")"
],
"execution_count": 0,
"outputs": []
},
{
"metadata": {
"id": "T14H7dPliPi-",
"colab_type": "text"
},
"cell_type": "markdown",
"source": [
"### Comparing the partitioning schemas"
]
},
{
"metadata": {
"id": "IC8s1rM_iPi_",
"colab_type": "code",
"colab": {},
"outputId": "0b792e48-7037-4809-8176-c96cd2a7f494"
},
"cell_type": "code",
"source": [
"from pyFTS.partitioners import Grid, Util as pUtil\n",
"\n",
"fig, ax = plt.subplots(nrows=2, ncols=3, figsize=[20,5])\n",
"\n",
"\n",
"partitioners = {}\n",
"partitioners_diff = {}\n",
"\n",
"for count,dataset_name in enumerate(dataset_names):\n",
" dataset = get_dataset(dataset_name)\n",
"\n",
" partitioner = Grid.GridPartitioner(data=dataset, npart=30)\n",
" partitioners[dataset_name] = partitioner\n",
" partitioner_diff = Grid.GridPartitioner(data=dataset, npart=10, transformation=tdiff)\n",
" partitioners_diff[dataset_name] = partitioner_diff\n",
"\n",
" pUtil.plot_sets(dataset, [partitioner.sets], titles=[dataset_name], axis=ax[0][count])\n",
" pUtil.plot_sets(dataset, [partitioner_diff.sets], titles=[''], axis=ax[1][count])"
],
"execution_count": 0,
"outputs": [
{
"output_type": "display_data",
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAABIQAAAFKCAYAAABsCIRVAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMS4yLCBo\ndHRwOi8vbWF0cGxvdGxpYi5vcmcvNQv5yAAAIABJREFUeJzsvXm8ZMlV3/mLzLw317dlvqrqXa3e\nJJYZYRAgf8wYDDYIjIxtwIOwR2Is4MN4WGZAH7wAkllsJLCFEYNhBAIhkFiEkI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5eXl5eXl5eX\nl9dVJp8Q8vLy8vLy8vLy8vLy8vLy8rrK5BNCXl5eXl5eXl5eXl5eXl5eXleZrAkhQsivEEKeIIR8\nTPM6IYS8mhByPyHkbwkhX3jyX9PLy8vL67TK+wkvLy8vL5O8n/Dy8vI6nXLpEHodgOcbXv9aALfn\n/74TwC889a/l5eXl5XUF6XXwfsLLy8vLS6/XwfsJLy8vr1Mna0KIUnongInhkG8A8HrK9AEA24SQ\na0/qCz4ZUUoRp5n9wCQCKDUekmYp0iy1fh6NY+vHpYn9O2VZiszl8xx+X5IkDp+XgFLze1FKEWdm\nOwFA5PD7kCZAZj4uoxnizG5PGkXWY7I0A7V8d5plyFKzzQGAOvy+NE2RWX4fpRmyzP63iSzvAwBJ\nmiGz/W2yjNndojh1sHkcg9p+X0aROZyfaeLweWkGarlGsyxD6vD3yzL7+RJn1Pp5aUaRuIwvV5Gu\nRD8BOI5ZrtdPFlvPHcBx3Mqo/boGu4Zsn+nqL1zGLvbdHL4/pUgcvn/scH0DYL7aIhdfDTD7u9gs\ndbBZlqbW8RBw8
"text/plain": [
"<matplotlib.figure.Figure at 0x7fdb3aac56d8>"
]
},
"metadata": {
"tags": []
}
}
]
},
{
"metadata": {
"id": "vSrtkXZCiPjG",
"colab_type": "text"
},
"cell_type": "markdown",
"source": [
"## Fitting models"
]
},
{
"metadata": {
"id": "fNFi9mNTiPjG",
"colab_type": "text"
},
"cell_type": "markdown",
"source": [
"### With original data"
]
},
{
"metadata": {
"id": "PLt_m6tdiPjH",
"colab_type": "code",
"colab": {}
},
"cell_type": "code",
"source": [
"for count,dataset_name in enumerate(dataset_names):\n",
" dataset = get_dataset(dataset_name)\n",
"\n",
" model1 = cheng.TrendWeightedFTS(partitioner=partitioners[dataset_name])\n",
" model1.name=dataset_name\n",
" model1.fit(dataset[:train_split], save_model=True, file_path='model1'+dataset_name, order=1)\n"
],
"execution_count": 0,
"outputs": []
},
{
"metadata": {
"id": "wB851cwviPjL",
"colab_type": "text"
},
"cell_type": "markdown",
"source": [
"### With transformed data"
]
},
{
"metadata": {
"id": "ibGfjsHNiPjN",
"colab_type": "code",
"colab": {}
},
"cell_type": "code",
"source": [
"for count,dataset_name in enumerate(dataset_names):\n",
" dataset = get_dataset(dataset_name)\n",
"\n",
" model2 = cheng.TrendWeightedFTS(partitioner=partitioners_diff[dataset_name])\n",
" model2.name=dataset_name\n",
" model2.append_transformation(tdiff)\n",
" model2.fit(dataset[:train_split], save_model=True, file_path='model2'+dataset_name, order=1)\n"
],
"execution_count": 0,
"outputs": []
},
{
"metadata": {
"id": "ahzbYUH4iPjc",
"colab_type": "text"
},
"cell_type": "markdown",
"source": [
"## Predicting with the models"
]
},
{
"metadata": {
"id": "N4k1lA5giPji",
"colab_type": "code",
"colab": {},
"outputId": "bdc64748-ee9a-4794-ed84-0c83491293bc"
},
"cell_type": "code",
"source": [
"fig, ax = plt.subplots(nrows=3, ncols=1, figsize=[20,10])\n",
"\n",
"\n",
"for count,dataset_name in enumerate(dataset_names):\n",
" dataset = get_dataset(dataset_name)\n",
" \n",
" ax[count].plot(dataset[train_split:train_split+200])\n",
"\n",
" model1 = cUtil.load_obj('model1'+dataset_name)\n",
"\n",
" forecasts = model1.predict(dataset[train_split:train_split+200])\n",
" \n",
" ax[count].plot(forecasts)\n",
" \n",
" ax[count].set_title(dataset_name)\n",
" \n",
"plt.tight_layout()"
],
"execution_count": 0,
"outputs": [
{
"output_type": "display_data",
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAABZgAAALICAYAAADyhJW9AAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMS4yLCBo\ndHRwOi8vbWF0cGxvdGxpYi5vcmcvNQv5yAAAIABJREFUeJzs3Xd8VfX9x/HXN3snELIZYYQNYYQh\noIAoggvrwC2iaFv1Z9VWrdW2Vltra7Vq66gTseKoioKi4gIBWSEJK2wIg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o00bQqunBLOIiIiIiIiIiIgcK38rpqKQ9yuHc+HVv8ajR6RbdhsG5Gel\ncP+mPM6+bhyBvodTlIs25/H3fcv52xX98BjS0S3HOxlvYMpZzuflVdUUlFSyv6SS/SUV7C+uwNGy\niz+0CEowi4iIiIiIiIiIyDEcWSl4ADZ6AGO6R7h131NHduaz1Tl8lLKLm86K/2n5S/O3EhXiy2UD\n49x6vLrw9fIkMsSTyBC/U37s1syjuQMQERERERERERGRlmfPxqWUWW9GjRiJMe6tVTGoYxiJ7UOZ\nvjgDh2ua8KqdB/hx6z5uHdUZXy9Ptx5Pmo4SzCIiIiIiIiIiInKM0h0rWU9nzu/b3u37NsYwdWRn\ntu0tZsGmPABeXrCVED8vrh3a9KUxxH2UYBYREREREREREZEjlFdUEFW8gcK2fY+okexOF/aLITLY\nlzcWb2dbXhFfr
"text/plain": [
"<matplotlib.figure.Figure at 0x7fdafe599438>"
]
},
"metadata": {
"tags": []
}
}
]
},
{
"metadata": {
"id": "gliWqlZwiPjr",
"colab_type": "code",
"colab": {}
},
"cell_type": "code",
"source": [
"from pyFTS.benchmarks import Measures\n",
"\n",
"rows = []\n",
"\n",
"for count,dataset_name in enumerate(dataset_names):\n",
" row = [dataset_name]\n",
" \n",
" dataset = get_dataset(dataset_name)\n",
" \n",
" test = dataset[train_split:train_split+200]\n",
"\n",
" model1 = cUtil.load_obj('model1'+dataset_name)\n",
" \n",
" row.extend(Measures.get_point_statistics(test, model1))\n",
" \n",
" rows.append(row)\n",
" \n",
" \n",
"pd.DataFrame(rows,columns=[\"Dataset\",\"RMSE\",\"SMAPE\",\"Theil's U\"])\n"
],
"execution_count": 0,
"outputs": []
},
{
"metadata": {
"id": "v2PGRzkZiPjy",
"colab_type": "code",
"colab": {},
"outputId": "914bc04d-497f-4a82-a7e6-0f8bdeaa61a6"
},
"cell_type": "code",
"source": [
"fig, ax = plt.subplots(nrows=3, ncols=1, figsize=[20,10])\n",
"\n",
"\n",
"for count,dataset_name in enumerate(dataset_names):\n",
" dataset = get_dataset(dataset_name)\n",
" \n",
" ax[count].plot(dataset[train_split:train_split+200])\n",
"\n",
" model1 = cUtil.load_obj('model2'+dataset_name)\n",
"\n",
" forecasts = model1.predict(dataset[train_split:train_split+200])\n",
" \n",
" ax[count].plot(forecasts)\n",
" \n",
" ax[count].set_title(dataset_name)\n",
" \n",
"plt.tight_layout()"
],
"execution_count": 0,
"outputs": [
{
"output_type": "display_data",
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAABZgAAALICAYAAADyhJW9AAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMS4yLCBo\ndHRwOi8vbWF0cGxvdGxpYi5vcmcvNQv5yAAAIABJREFUeJzs3Xd4lMXexvHvbHohCQmEmhB6LyKC\nNOkdBEVRLKAgcMDusXuOnmJ7sYHlKCgoKohIV6kC0pSS0KV3EgglIYH0ZHfeP8jxoIKEFDaB+3Nd\ne7E7zzwz94MJJr99dsZYaxERERERERERERERuVwOdwcQERERERERERERkZJJBWYRERERERERERER\nyRcVmEVEREREREREREQkX1RgFhEREREREREREZF8UYFZRERERERERERERPJFBWYRERERERERERER\nyRcVmEVEREREREREREQkX1RgFhERERH5HWNMynkPlzEm/bzXd5/X7z5jjDXG3PG789sbY2LPe/2j\nMSbjd+N+m3usjzEm3hgTel7/vsaYOGNM8JW4XhERERGR/FKBWURERETkd6y1gf99AIeBPue1TT6v\n62AgERiUh2EfOn9ca22f3Lm+BZYC7wAYY0KAD4GR1trkwrwuEREREZHC5unuACIiIiIiJZExpgrQ\nDrgd+NoYU95aG5/P4R4BthtjugF3AsuttXMLKaqIiIiISJFRgVlEREREJH8GAdHW2hnGmB3A3cBb\n+RnIWnvKGPMoMBmwQL3CiykiIiIiUnS0RIaIiIiISP4MAqbkPp/CpZfJeNcYk3Te49+/O74GCAYW\nWWtPFnJWEREREZEioQKziIiIiMhlM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GWKdHsRZiF+VteYqdc94iMmUzMyo9TdRTK+jauQsOh8lP9F+1rVuZ5Q1fwzM7\nlVOTh4LLVaDxRAVmERERERERERERyYOPFsRws1lJVt3+EBB22ed3aN6UZY4bCds1FTJT/rSvKyOF\niN2fstazGbc+8DwhAb75jf0H9/frzif+QykTv5KzKz8otHGvVSowi4iIiIiIiIiIyJ/ac/wsXlsn\n428yCWw7Kl9jeHs6SGo0lACbyonVn/1p393z3yfYniWz1RMYU7C7ln/P18uDroNfYKmrKT7L/omN\n31ao419rVGAWERERERERERGRPzV6/nYGeywmu/KNUKFRvsfp2Lk3W201zNpxF12ewmanE751HDGO\nBrRq1yPfc/2ZWuWDONXxTZKtP0lfDobs9CKZ51pw6ZW4RURERERERERE5Jq1/mAidvdCKnufgJZv\nFGissFK+LIq4i4axL5OyfQGBDXr+oc/BHz6mqiuRmGav4+lRdPfH3t6uKe9sf4YnTjxPzmtR5PiG\nYH1DwT8Uz8AwPAPLYIIqwk1PFlmGq4EKzCIiIiIiIiIiInJB1lpem7eDZ3wW4wqsiKNO7wKP2aT7\n/Rz/+H0yl777xwKzM5vA6A/YSk3adu1f4Ln+jDGGQYMe4NkxSVTL+IXSWWcJOZtCaXOC0uyjtDlL\nukcglVRg/lMqMIuIiIiIiIiIiMgFLdp+nDNHttHCZws0fxE8Cl5OrFu5DNOCbmZA4ufkHN+JZ7k6\nvx47uuoLKjrjWVv/aRp6F33pskygD/945lmOJqVzOi2bpLQsDqZlsykti8TULDwNPFHkKUo2FZhF\nRERERERERETkgt5buoeHA5dhXT6YpvcV2rjh7f9C5twpxC8YQ5XBH51rdLlwrH6HXTaStj3vLbS5\nLsXXy4NqZQOv2HxXG23yJyIiIiIiIiIiIn+w+/hZDscdo6dzGabh7RAQVmhjt72uHj943kS5AzMh\n/TQAJ9dPp3zWY
"text/plain": [
"<matplotlib.figure.Figure at 0x7fdafea31da0>"
]
},
"metadata": {
"tags": []
}
}
]
},
{
"metadata": {
"id": "vFgL2O3KiPj7",
"colab_type": "code",
"colab": {}
},
"cell_type": "code",
"source": [
"from pyFTS.benchmarks import Measures\n",
"\n",
"rows = []\n",
"\n",
"for count,dataset_name in enumerate(dataset_names):\n",
" row = [dataset_name]\n",
" \n",
" dataset = get_dataset(dataset_name)\n",
" \n",
" test = dataset[train_split:train_split+200]\n",
"\n",
" model1 = cUtil.load_obj('model2'+dataset_name)\n",
" \n",
" row.extend(Measures.get_point_statistics(test, model1))\n",
" \n",
" rows.append(row)\n",
" \n",
" \n",
"pd.DataFrame(rows,columns=[\"Dataset\",\"RMSE\",\"SMAPE\",\"Theil's U\"])\n",
" \n",
" \n",
" "
],
"execution_count": 0,
"outputs": []
},
{
"metadata": {
"id": "77ttQ0YviPkA",
"colab_type": "text"
},
"cell_type": "markdown",
"source": [
"## Residual Analysis"
]
},
{
"metadata": {
"id": "VN0y9mo2iPkC",
"colab_type": "code",
"colab": {},
"outputId": "d993c80f-fad7-4f49-9db3-bca7eebf6605"
},
"cell_type": "code",
"source": [
"from pyFTS.benchmarks import ResidualAnalysis as ra\n",
"\n",
"for count,dataset_name in enumerate(dataset_names):\n",
" dataset = get_dataset(dataset_name)\n",
" \n",
" model1 = cUtil.load_obj('model1'+dataset_name)\n",
" model1 = cUtil.load_obj('model2'+dataset_name)\n",
"\n",
" ra.plot_residuals(dataset, [model1, model2])"
],
"execution_count": 0,
"outputs": [
{
"output_type": "display_data",
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAjkAAAI4CAYAAACIt/jIAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMS4yLCBo\ndHRwOi8vbWF0cGxvdGxpYi5vcmcvNQv5yAAAIABJREFUeJzs3XmcXFWd///Xp7uzJ2QnQEJIgLAE\nEISwiSLKFhaBmVEEFwKi0d+govJVwQ0HRHHGEddRUVBwASMuRGUxQgBRAiTsIUBCSCD7vq/d/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l5GNHw3Xqi4ap5tA8N1gQNV4mISEmZ2clEuS23u/vhoey/iabj32jR9Oyh\n7v55MzubKO/jbKI8pe+6+/EhMXc2MIko6XYOcIy7r6/CW5I6pZ4cEREpKXd/hCipNe584LZwfBvt\nq+OeTxQMubvPIlo3Zm+ixRpnuPu6ENjMIFqpWaRgPXrjuBEjRvi4ceOq3QwpsTlz5qxx95H5a/Yc\nute7rzq630e5+/JwvIL2hRBHk75g3JJQlq08J93r3Vdn7vUeHeSMGzeO2bNnV7sZUmJmVvAKpD2F\n7vXuqx7vd3d3MytZroSZTSXaXoGxY8fqXu+mOnOva7hKREQqYWUYhiL8uyqULyV9pdwxoSxbeQfu\nfrO7T3L3SSNH1kOnllSKghwREamE6bQv5DiFaDPMVPklYZbVCcDGMKx1P3BGWFl4KNHKuPdXutFS\n33r0cJWIiJSemd1BtEHmCDNbQrR+yo3ANDO7nGjF4AtD9XuIZlYtINr36TIAd19nZtcDT4Z617l7\nZjKzSE4KckREp
"text/plain": [
"<matplotlib.figure.Figure at 0x7fdafeb6ff98>"
]
},
"metadata": {
"tags": []
}
},
{
"output_type": "display_data",
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAjgAAAI4CAYAAABndZP2AAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMS4yLCBo\ndHRwOi8vbWF0cGxvdGxpYi5vcmcvNQv5yAAAIABJREFUeJzs3XecXHW9//HXO9tSSUghkARIIAEM\nIAiR5k9aKAGRcBW5YIuIxAJY8F4NNuyici+iIoiCwFWBXESNEkUI7aIESOgJJSGU9EJ6z+5+fn+c\n7+yenZ3ZndmdmTMz+3k+HvvYc77nzMxnZs/sfOZbZWY455xzzlWTXkkH4JxzzjlXaJ7gOOecc67q\neILjnHPOuarjCY5zzjnnqo4nOM4555yrOp7gOOecc67qeIJT4STNk3RilmMnSlpSoMd5SNInCn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8C3zOxwoum0fxTKzyCaOnsc0XL01wPE1u84GjgKuFLS7kWP3DnnnHMVpyQJjpk9QrT2RZti\nYLewPZDW1X0nA7dZZDbRkvJ7AacD95nZWjNbR7QgX3rS5JxzzjmX6CiqzwP3SrqaKNE6LpSPBBbH\nzlsSyrKVtyNpKlHtD/vsk76ivXPOOeeqXZKdjD8NfMHM9ga+ANxUqDs2sxvNbIKZTRg2rMdNDeEq\nRKa+aWnHs/ZHc84517EkE5wpwN1h+3+J+tUALAX2jp03KpRlK3euUt1Cx82sGfujOeec61ySCc4y\n4ISwfTKwIGzPAD4avr0eA2wws+XAvcBpknYPnYtPC2Wuh7p//kpOvvohFq/dmnQoXZKlb1pctv5o\nzjnnOlGSPjiSb
"text/plain": [
"<matplotlib.figure.Figure at 0x7fdafcbf46d8>"
]
},
"metadata": {
"tags": []
}
},
{
"output_type": "display_data",
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAjgAAAI4CAYAAABndZP2AAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMS4yLCBo\ndHRwOi8vbWF0cGxvdGxpYi5vcmcvNQv5yAAAIABJREFUeJzs3Xl8XFX9//HXp0mT7hstpXQhQAtY\nRaBWli8KZSulIOWriOACIl/7VUHZXIp+Bb8oin75sbmAKCgosohblQqUpSwKhRbKUgptWgrd931J\nmuTz++OeSSaTmWSyzP5+Ph7zyL3n3rnzuZM7mU/OOfccc3dEREREikm3XAcgIiIi0tWU4IiIiEjR\nUYIjIiIiRUcJjoiIiBQdJTgiIiJSdJTgiIiISNFRglOgzGy+mU1IsW2CmS3voteZZWb/1RXHkvyg\nayc/mFmVmbmZlXfw+d82s193dVzSUqF/ZsxslJltN7Oyrj52PlOCkwVmttTMdoULbLWZ/dbM+nTm\nmO7+fnef1UUhSh7KxHUDhXHtmFmfcN7/bOfzuuzLJp8kOy93/6G7K4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Lyjc/wvmH9+OelH22x7fIH5rF6627WbKth+ICeOYguZ4YDy+LWl4eyVfE7mdlUohoe\nRo0albXg2mPChAkAzJo1q83yfN5XBKBq2sNp77v0+tMzGIkkoxocyTsLVm1NWj60fw8A+vZQXp6M\nu9/h7uPdffyQIS2naZkwYULjF3ZrZe0tb+8xikFn34eu2FdEWqcER/KGu7e6/dVlmwHo16N7NsLJ\nJyuAkXHrI0KZi
"text/plain": [
"<matplotlib.figure.Figure at 0x7fdafcc343c8>"
]
},
"metadata": {
"tags": []
}
}
]
},
{
"metadata": {
"id": "fYFPL3EHiPkS",
"colab_type": "code",
"colab": {}
},
"cell_type": "code",
"source": [
""
],
"execution_count": 0,
"outputs": []
},
{
"metadata": {
"id": "WBlAz7l0iPkW",
"colab_type": "code",
"colab": {}
},
"cell_type": "code",
"source": [
""
],
"execution_count": 0,
"outputs": []
}
]
}