Skip to content

Instantly share code, notes, and snippets.

@ngupta23
Last active March 21, 2022 19:22
Show Gist options
  • Save ngupta23/f94b2f3ce22b7a0203446b77f2972ffa to your computer and use it in GitHub Desktop.
Save ngupta23/f94b2f3ce22b7a0203446b77f2972ffa to your computer and use it in GitHub Desktop.
pycaret_ts_compare_models.ipynb
Display the source blob
Display the rendered blob
Raw
{
"nbformat": 4,
"nbformat_minor": 0,
"metadata": {
"colab": {
"name": "pycaret_ts_compare_models.ipynb",
"provenance": [],
"toc_visible": true,
"authorship_tag": "ABX9TyO0nqZJ3I9lYpyNJORxNPkt",
"include_colab_link": true
},
"kernelspec": {
"name": "python3",
"display_name": "Python 3"
},
"language_info": {
"name": "python"
},
"widgets": {
"application/vnd.jupyter.widget-state+json": {
"62f2610cf5714f20a6e34720d1a2beac": {
"model_module": "@jupyter-widgets/controls",
"model_name": "IntProgressModel",
"model_module_version": "1.5.0",
"state": {
"_view_name": "ProgressView",
"style": "IPY_MODEL_da3f721c98ec4e4b9667f9a4d699672b",
"_dom_classes": [],
"description": "Processing: ",
"_model_name": "IntProgressModel",
"bar_style": "",
"max": 3,
"_view_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"value": 3,
"_view_count": null,
"_view_module_version": "1.5.0",
"orientation": "horizontal",
"min": 0,
"description_tooltip": null,
"_model_module": "@jupyter-widgets/controls",
"layout": "IPY_MODEL_d6da67a582cd4cf1913db62cdde39080"
}
},
"da3f721c98ec4e4b9667f9a4d699672b": {
"model_module": "@jupyter-widgets/controls",
"model_name": "ProgressStyleModel",
"model_module_version": "1.5.0",
"state": {
"_view_name": "StyleView",
"_model_name": "ProgressStyleModel",
"description_width": "",
"_view_module": "@jupyter-widgets/base",
"_model_module_version": "1.5.0",
"_view_count": null,
"_view_module_version": "1.2.0",
"bar_color": null,
"_model_module": "@jupyter-widgets/controls"
}
},
"d6da67a582cd4cf1913db62cdde39080": {
"model_module": "@jupyter-widgets/base",
"model_name": "LayoutModel",
"model_module_version": "1.2.0",
"state": {
"_view_name": "LayoutView",
"grid_template_rows": null,
"right": null,
"justify_content": null,
"_view_module": "@jupyter-widgets/base",
"overflow": null,
"_model_module_version": "1.2.0",
"_view_count": null,
"flex_flow": null,
"width": null,
"min_width": null,
"border": null,
"align_items": null,
"bottom": null,
"_model_module": "@jupyter-widgets/base",
"top": null,
"grid_column": null,
"overflow_y": null,
"overflow_x": null,
"grid_auto_flow": null,
"grid_area": null,
"grid_template_columns": null,
"flex": null,
"_model_name": "LayoutModel",
"justify_items": null,
"grid_row": null,
"max_height": null,
"align_content": null,
"visibility": null,
"align_self": null,
"height": null,
"min_height": null,
"padding": null,
"grid_auto_rows": null,
"grid_gap": null,
"max_width": null,
"order": null,
"_view_module_version": "1.2.0",
"grid_template_areas": null,
"object_position": null,
"object_fit": null,
"grid_auto_columns": null,
"margin": null,
"display": null,
"left": null
}
},
"17a8d2dc2a384df894af1a544d36e207": {
"model_module": "@jupyter-widgets/controls",
"model_name": "IntProgressModel",
"model_module_version": "1.5.0",
"state": {
"_view_name": "ProgressView",
"style": "IPY_MODEL_97071b6ff1f84366bcb16d3d20a8c3dd",
"_dom_classes": [],
"description": "Processing: ",
"_model_name": "IntProgressModel",
"bar_style": "",
"max": 4,
"_view_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"value": 4,
"_view_count": null,
"_view_module_version": "1.5.0",
"orientation": "horizontal",
"min": 0,
"description_tooltip": null,
"_model_module": "@jupyter-widgets/controls",
"layout": "IPY_MODEL_6c1579206380405f827794720233e3f0"
}
},
"97071b6ff1f84366bcb16d3d20a8c3dd": {
"model_module": "@jupyter-widgets/controls",
"model_name": "ProgressStyleModel",
"model_module_version": "1.5.0",
"state": {
"_view_name": "StyleView",
"_model_name": "ProgressStyleModel",
"description_width": "",
"_view_module": "@jupyter-widgets/base",
"_model_module_version": "1.5.0",
"_view_count": null,
"_view_module_version": "1.2.0",
"bar_color": null,
"_model_module": "@jupyter-widgets/controls"
}
},
"6c1579206380405f827794720233e3f0": {
"model_module": "@jupyter-widgets/base",
"model_name": "LayoutModel",
"model_module_version": "1.2.0",
"state": {
"_view_name": "LayoutView",
"grid_template_rows": null,
"right": null,
"justify_content": null,
"_view_module": "@jupyter-widgets/base",
"overflow": null,
"_model_module_version": "1.2.0",
"_view_count": null,
"flex_flow": null,
"width": null,
"min_width": null,
"border": null,
"align_items": null,
"bottom": null,
"_model_module": "@jupyter-widgets/base",
"top": null,
"grid_column": null,
"overflow_y": null,
"overflow_x": null,
"grid_auto_flow": null,
"grid_area": null,
"grid_template_columns": null,
"flex": null,
"_model_name": "LayoutModel",
"justify_items": null,
"grid_row": null,
"max_height": null,
"align_content": null,
"visibility": null,
"align_self": null,
"height": null,
"min_height": null,
"padding": null,
"grid_auto_rows": null,
"grid_gap": null,
"max_width": null,
"order": null,
"_view_module_version": "1.2.0",
"grid_template_areas": null,
"object_position": null,
"object_fit": null,
"grid_auto_columns": null,
"margin": null,
"display": null,
"left": null
}
},
"ef752d6a71cd4bd8ba0950e770bf5723": {
"model_module": "@jupyter-widgets/controls",
"model_name": "IntProgressModel",
"model_module_version": "1.5.0",
"state": {
"_view_name": "ProgressView",
"style": "IPY_MODEL_67caf2b8a57c43ad8575deb8b4698bc2",
"_dom_classes": [],
"description": "Processing: ",
"_model_name": "IntProgressModel",
"bar_style": "",
"max": 4,
"_view_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"value": 4,
"_view_count": null,
"_view_module_version": "1.5.0",
"orientation": "horizontal",
"min": 0,
"description_tooltip": null,
"_model_module": "@jupyter-widgets/controls",
"layout": "IPY_MODEL_aa0c449e15c74a21a95e3eb746ddf245"
}
},
"c01ad049d702434e8570f1a462ec4488": {
"model_module": "@jupyter-widgets/controls",
"model_name": "IntProgressModel",
"model_module_version": "1.5.0",
"state": {
"_view_name": "ProgressView",
"style": "IPY_MODEL_1e18f7b1179a4ddb8489f6a335fbba4e",
"_dom_classes": [],
"description": "Processing: ",
"_model_name": "IntProgressModel",
"bar_style": "",
"max": 4,
"_view_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"value": 4,
"_view_count": null,
"_view_module_version": "1.5.0",
"orientation": "horizontal",
"min": 0,
"description_tooltip": null,
"_model_module": "@jupyter-widgets/controls",
"layout": "IPY_MODEL_4ca3159c343c4fd29af435dcac3c23d4"
}
},
"1e18f7b1179a4ddb8489f6a335fbba4e": {
"model_module": "@jupyter-widgets/controls",
"model_name": "ProgressStyleModel",
"model_module_version": "1.5.0",
"state": {
"_view_name": "StyleView",
"_model_name": "ProgressStyleModel",
"description_width": "",
"_view_module": "@jupyter-widgets/base",
"_model_module_version": "1.5.0",
"_view_count": null,
"_view_module_version": "1.2.0",
"bar_color": null,
"_model_module": "@jupyter-widgets/controls"
}
},
"4ca3159c343c4fd29af435dcac3c23d4": {
"model_module": "@jupyter-widgets/base",
"model_name": "LayoutModel",
"model_module_version": "1.2.0",
"state": {
"_view_name": "LayoutView",
"grid_template_rows": null,
"right": null,
"justify_content": null,
"_view_module": "@jupyter-widgets/base",
"overflow": null,
"_model_module_version": "1.2.0",
"_view_count": null,
"flex_flow": null,
"width": null,
"min_width": null,
"border": null,
"align_items": null,
"bottom": null,
"_model_module": "@jupyter-widgets/base",
"top": null,
"grid_column": null,
"overflow_y": null,
"overflow_x": null,
"grid_auto_flow": null,
"grid_area": null,
"grid_template_columns": null,
"flex": null,
"_model_name": "LayoutModel",
"justify_items": null,
"grid_row": null,
"max_height": null,
"align_content": null,
"visibility": null,
"align_self": null,
"height": null,
"min_height": null,
"padding": null,
"grid_auto_rows": null,
"grid_gap": null,
"max_width": null,
"order": null,
"_view_module_version": "1.2.0",
"grid_template_areas": null,
"object_position": null,
"object_fit": null,
"grid_auto_columns": null,
"margin": null,
"display": null,
"left": null
}
},
"54a60843685342d78de6ac6204aec7d7": {
"model_module": "@jupyter-widgets/controls",
"model_name": "IntProgressModel",
"model_module_version": "1.5.0",
"state": {
"_view_name": "ProgressView",
"style": "IPY_MODEL_3347de0612a24f288bf881da13b1ae70",
"_dom_classes": [],
"description": "Processing: ",
"_model_name": "IntProgressModel",
"bar_style": "",
"max": 134,
"_view_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"value": 129,
"_view_count": null,
"_view_module_version": "1.5.0",
"orientation": "horizontal",
"min": 0,
"description_tooltip": null,
"_model_module": "@jupyter-widgets/controls",
"layout": "IPY_MODEL_d807dfcb81ba4f6d8beeb70b2a0f12ea"
}
},
"3347de0612a24f288bf881da13b1ae70": {
"model_module": "@jupyter-widgets/controls",
"model_name": "ProgressStyleModel",
"model_module_version": "1.5.0",
"state": {
"_view_name": "StyleView",
"_model_name": "ProgressStyleModel",
"description_width": "",
"_view_module": "@jupyter-widgets/base",
"_model_module_version": "1.5.0",
"_view_count": null,
"_view_module_version": "1.2.0",
"bar_color": null,
"_model_module": "@jupyter-widgets/controls"
}
},
"d807dfcb81ba4f6d8beeb70b2a0f12ea": {
"model_module": "@jupyter-widgets/base",
"model_name": "LayoutModel",
"model_module_version": "1.2.0",
"state": {
"_view_name": "LayoutView",
"grid_template_rows": null,
"right": null,
"justify_content": null,
"_view_module": "@jupyter-widgets/base",
"overflow": null,
"_model_module_version": "1.2.0",
"_view_count": null,
"flex_flow": null,
"width": null,
"min_width": null,
"border": null,
"align_items": null,
"bottom": null,
"_model_module": "@jupyter-widgets/base",
"top": null,
"grid_column": null,
"overflow_y": null,
"overflow_x": null,
"grid_auto_flow": null,
"grid_area": null,
"grid_template_columns": null,
"flex": null,
"_model_name": "LayoutModel",
"justify_items": null,
"grid_row": null,
"max_height": null,
"align_content": null,
"visibility": null,
"align_self": null,
"height": null,
"min_height": null,
"padding": null,
"grid_auto_rows": null,
"grid_gap": null,
"max_width": null,
"order": null,
"_view_module_version": "1.2.0",
"grid_template_areas": null,
"object_position": null,
"object_fit": null,
"grid_auto_columns": null,
"margin": null,
"display": null,
"left": null
}
},
"adea4e783f744bdc9c36eb13ec1346e7": {
"model_module": "@jupyter-widgets/controls",
"model_name": "IntProgressModel",
"model_module_version": "1.5.0",
"state": {
"_view_name": "ProgressView",
"style": "IPY_MODEL_00086a38361442d386a0ba757c6d8c3d",
"_dom_classes": [],
"description": "Processing: ",
"_model_name": "IntProgressModel",
"bar_style": "",
"max": 134,
"_view_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"value": 129,
"_view_count": null,
"_view_module_version": "1.5.0",
"orientation": "horizontal",
"min": 0,
"description_tooltip": null,
"_model_module": "@jupyter-widgets/controls",
"layout": "IPY_MODEL_7182039c4b034039bf891f00aeed048b"
}
},
"00086a38361442d386a0ba757c6d8c3d": {
"model_module": "@jupyter-widgets/controls",
"model_name": "ProgressStyleModel",
"model_module_version": "1.5.0",
"state": {
"_view_name": "StyleView",
"_model_name": "ProgressStyleModel",
"description_width": "",
"_view_module": "@jupyter-widgets/base",
"_model_module_version": "1.5.0",
"_view_count": null,
"_view_module_version": "1.2.0",
"bar_color": null,
"_model_module": "@jupyter-widgets/controls"
}
},
"7182039c4b034039bf891f00aeed048b": {
"model_module": "@jupyter-widgets/base",
"model_name": "LayoutModel",
"model_module_version": "1.2.0",
"state": {
"_view_name": "LayoutView",
"grid_template_rows": null,
"right": null,
"justify_content": null,
"_view_module": "@jupyter-widgets/base",
"overflow": null,
"_model_module_version": "1.2.0",
"_view_count": null,
"flex_flow": null,
"width": null,
"min_width": null,
"border": null,
"align_items": null,
"bottom": null,
"_model_module": "@jupyter-widgets/base",
"top": null,
"grid_column": null,
"overflow_y": null,
"overflow_x": null,
"grid_auto_flow": null,
"grid_area": null,
"grid_template_columns": null,
"flex": null,
"_model_name": "LayoutModel",
"justify_items": null,
"grid_row": null,
"max_height": null,
"align_content": null,
"visibility": null,
"align_self": null,
"height": null,
"min_height": null,
"padding": null,
"grid_auto_rows": null,
"grid_gap": null,
"max_width": null,
"order": null,
"_view_module_version": "1.2.0",
"grid_template_areas": null,
"object_position": null,
"object_fit": null,
"grid_auto_columns": null,
"margin": null,
"display": null,
"left": null
}
},
"9ef9c4e16aad4c70ab47dee085ef62a0": {
"model_module": "@jupyter-widgets/controls",
"model_name": "IntProgressModel",
"model_module_version": "1.5.0",
"state": {
"_view_name": "ProgressView",
"style": "IPY_MODEL_9c112b82a124419c8409bbd04156006c",
"_dom_classes": [],
"description": "Processing: ",
"_model_name": "IntProgressModel",
"bar_style": "",
"max": 149,
"_view_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"value": 144,
"_view_count": null,
"_view_module_version": "1.5.0",
"orientation": "horizontal",
"min": 0,
"description_tooltip": null,
"_model_module": "@jupyter-widgets/controls",
"layout": "IPY_MODEL_bcf5ad1c82a34d9b82d2959775df4d42"
}
},
"9c112b82a124419c8409bbd04156006c": {
"model_module": "@jupyter-widgets/controls",
"model_name": "ProgressStyleModel",
"model_module_version": "1.5.0",
"state": {
"_view_name": "StyleView",
"_model_name": "ProgressStyleModel",
"description_width": "",
"_view_module": "@jupyter-widgets/base",
"_model_module_version": "1.5.0",
"_view_count": null,
"_view_module_version": "1.2.0",
"bar_color": null,
"_model_module": "@jupyter-widgets/controls"
}
},
"bcf5ad1c82a34d9b82d2959775df4d42": {
"model_module": "@jupyter-widgets/base",
"model_name": "LayoutModel",
"model_module_version": "1.2.0",
"state": {
"_view_name": "LayoutView",
"grid_template_rows": null,
"right": null,
"justify_content": null,
"_view_module": "@jupyter-widgets/base",
"overflow": null,
"_model_module_version": "1.2.0",
"_view_count": null,
"flex_flow": null,
"width": null,
"min_width": null,
"border": null,
"align_items": null,
"bottom": null,
"_model_module": "@jupyter-widgets/base",
"top": null,
"grid_column": null,
"overflow_y": null,
"overflow_x": null,
"grid_auto_flow": null,
"grid_area": null,
"grid_template_columns": null,
"flex": null,
"_model_name": "LayoutModel",
"justify_items": null,
"grid_row": null,
"max_height": null,
"align_content": null,
"visibility": null,
"align_self": null,
"height": null,
"min_height": null,
"padding": null,
"grid_auto_rows": null,
"grid_gap": null,
"max_width": null,
"order": null,
"_view_module_version": "1.2.0",
"grid_template_areas": null,
"object_position": null,
"object_fit": null,
"grid_auto_columns": null,
"margin": null,
"display": null,
"left": null
}
},
"c59627b19ec34adfb96686cb917f6a45": {
"model_module": "@jupyter-widgets/controls",
"model_name": "IntProgressModel",
"model_module_version": "1.5.0",
"state": {
"_view_name": "ProgressView",
"style": "IPY_MODEL_d317616e7315492a811c5cc070a1d11b",
"_dom_classes": [],
"description": "Processing: ",
"_model_name": "IntProgressModel",
"bar_style": "",
"max": 149,
"_view_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"value": 29,
"_view_count": null,
"_view_module_version": "1.5.0",
"orientation": "horizontal",
"min": 0,
"description_tooltip": null,
"_model_module": "@jupyter-widgets/controls",
"layout": "IPY_MODEL_2907e39d613b4a718e05feeb4bc293a4"
}
},
"d317616e7315492a811c5cc070a1d11b": {
"model_module": "@jupyter-widgets/controls",
"model_name": "ProgressStyleModel",
"model_module_version": "1.5.0",
"state": {
"_view_name": "StyleView",
"_model_name": "ProgressStyleModel",
"description_width": "",
"_view_module": "@jupyter-widgets/base",
"_model_module_version": "1.5.0",
"_view_count": null,
"_view_module_version": "1.2.0",
"bar_color": null,
"_model_module": "@jupyter-widgets/controls"
}
},
"2907e39d613b4a718e05feeb4bc293a4": {
"model_module": "@jupyter-widgets/base",
"model_name": "LayoutModel",
"model_module_version": "1.2.0",
"state": {
"_view_name": "LayoutView",
"grid_template_rows": null,
"right": null,
"justify_content": null,
"_view_module": "@jupyter-widgets/base",
"overflow": null,
"_model_module_version": "1.2.0",
"_view_count": null,
"flex_flow": null,
"width": null,
"min_width": null,
"border": null,
"align_items": null,
"bottom": null,
"_model_module": "@jupyter-widgets/base",
"top": null,
"grid_column": null,
"overflow_y": null,
"overflow_x": null,
"grid_auto_flow": null,
"grid_area": null,
"grid_template_columns": null,
"flex": null,
"_model_name": "LayoutModel",
"justify_items": null,
"grid_row": null,
"max_height": null,
"align_content": null,
"visibility": null,
"align_self": null,
"height": null,
"min_height": null,
"padding": null,
"grid_auto_rows": null,
"grid_gap": null,
"max_width": null,
"order": null,
"_view_module_version": "1.2.0",
"grid_template_areas": null,
"object_position": null,
"object_fit": null,
"grid_auto_columns": null,
"margin": null,
"display": null,
"left": null
}
},
"aa261a1a1718436eb0bc7ce4554b4d51": {
"model_module": "@jupyter-widgets/controls",
"model_name": "IntProgressModel",
"model_module_version": "1.5.0",
"state": {
"_view_name": "ProgressView",
"style": "IPY_MODEL_e1e2fe4e74b940bfa2c3ca6ae5d6dcc9",
"_dom_classes": [],
"description": "Processing: ",
"_model_name": "IntProgressModel",
"bar_style": "",
"max": 139,
"_view_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"value": 134,
"_view_count": null,
"_view_module_version": "1.5.0",
"orientation": "horizontal",
"min": 0,
"description_tooltip": null,
"_model_module": "@jupyter-widgets/controls",
"layout": "IPY_MODEL_9668b468585140beb06f4186c95b1d16"
}
},
"e1e2fe4e74b940bfa2c3ca6ae5d6dcc9": {
"model_module": "@jupyter-widgets/controls",
"model_name": "ProgressStyleModel",
"model_module_version": "1.5.0",
"state": {
"_view_name": "StyleView",
"_model_name": "ProgressStyleModel",
"description_width": "",
"_view_module": "@jupyter-widgets/base",
"_model_module_version": "1.5.0",
"_view_count": null,
"_view_module_version": "1.2.0",
"bar_color": null,
"_model_module": "@jupyter-widgets/controls"
}
},
"9668b468585140beb06f4186c95b1d16": {
"model_module": "@jupyter-widgets/base",
"model_name": "LayoutModel",
"model_module_version": "1.2.0",
"state": {
"_view_name": "LayoutView",
"grid_template_rows": null,
"right": null,
"justify_content": null,
"_view_module": "@jupyter-widgets/base",
"overflow": null,
"_model_module_version": "1.2.0",
"_view_count": null,
"flex_flow": null,
"width": null,
"min_width": null,
"border": null,
"align_items": null,
"bottom": null,
"_model_module": "@jupyter-widgets/base",
"top": null,
"grid_column": null,
"overflow_y": null,
"overflow_x": null,
"grid_auto_flow": null,
"grid_area": null,
"grid_template_columns": null,
"flex": null,
"_model_name": "LayoutModel",
"justify_items": null,
"grid_row": null,
"max_height": null,
"align_content": null,
"visibility": null,
"align_self": null,
"height": null,
"min_height": null,
"padding": null,
"grid_auto_rows": null,
"grid_gap": null,
"max_width": null,
"order": null,
"_view_module_version": "1.2.0",
"grid_template_areas": null,
"object_position": null,
"object_fit": null,
"grid_auto_columns": null,
"margin": null,
"display": null,
"left": null
}
}
}
}
},
"cells": [
{
"cell_type": "markdown",
"metadata": {
"id": "view-in-github",
"colab_type": "text"
},
"source": [
"<a href=\"https://colab.research.google.com/gist/ngupta23/f94b2f3ce22b7a0203446b77f2972ffa/pycaret_ts_compare_models.ipynb\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a>"
]
},
{
"cell_type": "code",
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "UthgOegeztkM",
"outputId": "bc752c92-7c9e-4a00-efc9-7618f8e63feb"
},
"source": [
"!pip install pycaret-ts-alpha -U\n",
"!pip install prophet"
],
"execution_count": 1,
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"Requirement already satisfied: pycaret-ts-alpha in /usr/local/lib/python3.7/dist-packages (3.0.0.dev1635609350)\n",
"Requirement already satisfied: wordcloud in /usr/local/lib/python3.7/dist-packages (from pycaret-ts-alpha) (1.5.0)\n",
"Requirement already satisfied: textblob in /usr/local/lib/python3.7/dist-packages (from pycaret-ts-alpha) (0.15.3)\n",
"Requirement already satisfied: scikit-learn~=0.24.2 in /usr/local/lib/python3.7/dist-packages (from pycaret-ts-alpha) (0.24.2)\n",
"Requirement already satisfied: numpy==1.19.5 in /usr/local/lib/python3.7/dist-packages (from pycaret-ts-alpha) (1.19.5)\n",
"Requirement already satisfied: tbats>=1.1.0 in /usr/local/lib/python3.7/dist-packages (from pycaret-ts-alpha) (1.1.0)\n",
"Requirement already satisfied: pyod in /usr/local/lib/python3.7/dist-packages (from pycaret-ts-alpha) (0.9.5)\n",
"Requirement already satisfied: matplotlib in /usr/local/lib/python3.7/dist-packages (from pycaret-ts-alpha) (3.2.2)\n",
"Requirement already satisfied: mlflow in /usr/local/lib/python3.7/dist-packages (from pycaret-ts-alpha) (1.21.0)\n",
"Requirement already satisfied: cufflinks>=0.17.0 in /usr/local/lib/python3.7/dist-packages (from pycaret-ts-alpha) (0.17.3)\n",
"Requirement already satisfied: lightgbm>=2.3.1 in /usr/local/lib/python3.7/dist-packages (from pycaret-ts-alpha) (3.3.1)\n",
"Requirement already satisfied: ipywidgets in /usr/local/lib/python3.7/dist-packages (from pycaret-ts-alpha) (7.6.5)\n",
"Requirement already satisfied: pyLDAvis in /usr/local/lib/python3.7/dist-packages (from pycaret-ts-alpha) (3.2.2)\n",
"Requirement already satisfied: scipy<=1.5.4 in /usr/local/lib/python3.7/dist-packages (from pycaret-ts-alpha) (1.5.4)\n",
"Requirement already satisfied: imbalanced-learn==0.7.0 in /usr/local/lib/python3.7/dist-packages (from pycaret-ts-alpha) (0.7.0)\n",
"Requirement already satisfied: pandas in /usr/local/lib/python3.7/dist-packages (from pycaret-ts-alpha) (1.1.5)\n",
"Requirement already satisfied: scikit-plot in /usr/local/lib/python3.7/dist-packages (from pycaret-ts-alpha) (0.3.7)\n",
"Requirement already satisfied: spacy<2.4.0 in /usr/local/lib/python3.7/dist-packages (from pycaret-ts-alpha) (2.2.4)\n",
"Requirement already satisfied: sktime>=0.8.0 in /usr/local/lib/python3.7/dist-packages (from pycaret-ts-alpha) (0.8.1)\n",
"Requirement already satisfied: yellowbrick>=1.0.1 in /usr/local/lib/python3.7/dist-packages (from pycaret-ts-alpha) (1.3.post1)\n",
"Requirement already satisfied: pmdarima>=1.8.0 in /usr/local/lib/python3.7/dist-packages (from pycaret-ts-alpha) (1.8.4)\n",
"Requirement already satisfied: umap-learn in /usr/local/lib/python3.7/dist-packages (from pycaret-ts-alpha) (0.5.2)\n",
"Requirement already satisfied: joblib in /usr/local/lib/python3.7/dist-packages (from pycaret-ts-alpha) (1.0.1)\n",
"Requirement already satisfied: seaborn in /usr/local/lib/python3.7/dist-packages (from pycaret-ts-alpha) (0.11.2)\n",
"Requirement already satisfied: nltk in /usr/local/lib/python3.7/dist-packages (from pycaret-ts-alpha) (3.2.5)\n",
"Requirement already satisfied: numba in /usr/local/lib/python3.7/dist-packages (from pycaret-ts-alpha) (0.54.1)\n",
"Requirement already satisfied: statsmodels~=0.12.1 in /usr/local/lib/python3.7/dist-packages (from pycaret-ts-alpha) (0.12.1)\n",
"Requirement already satisfied: mlxtend>=0.17.0 in /usr/local/lib/python3.7/dist-packages (from pycaret-ts-alpha) (0.19.0)\n",
"Requirement already satisfied: kmodes>=0.10.1 in /usr/local/lib/python3.7/dist-packages (from pycaret-ts-alpha) (0.11.1)\n",
"Requirement already satisfied: pyyaml<6.0.0 in /usr/local/lib/python3.7/dist-packages (from pycaret-ts-alpha) (5.4.1)\n",
"Requirement already satisfied: IPython in /usr/local/lib/python3.7/dist-packages (from pycaret-ts-alpha) (5.5.0)\n",
"Requirement already satisfied: gensim<4.0.0 in /usr/local/lib/python3.7/dist-packages (from pycaret-ts-alpha) (3.6.0)\n",
"Requirement already satisfied: pandas-profiling>=2.8.0 in /usr/local/lib/python3.7/dist-packages (from pycaret-ts-alpha) (3.1.0)\n",
"Requirement already satisfied: Boruta in /usr/local/lib/python3.7/dist-packages (from pycaret-ts-alpha) (0.3)\n",
"Requirement already satisfied: plotly>=5.0.0 in /usr/local/lib/python3.7/dist-packages (from pycaret-ts-alpha) (5.3.1)\n",
"Requirement already satisfied: six>=1.9.0 in /usr/local/lib/python3.7/dist-packages (from cufflinks>=0.17.0->pycaret-ts-alpha) (1.15.0)\n",
"Requirement already satisfied: setuptools>=34.4.1 in /usr/local/lib/python3.7/dist-packages (from cufflinks>=0.17.0->pycaret-ts-alpha) (57.4.0)\n",
"Requirement already satisfied: colorlover>=0.2.1 in /usr/local/lib/python3.7/dist-packages (from cufflinks>=0.17.0->pycaret-ts-alpha) (0.3.0)\n",
"Requirement already satisfied: smart-open>=1.2.1 in /usr/local/lib/python3.7/dist-packages (from gensim<4.0.0->pycaret-ts-alpha) (5.2.1)\n",
"Requirement already satisfied: prompt-toolkit<2.0.0,>=1.0.4 in /usr/local/lib/python3.7/dist-packages (from IPython->pycaret-ts-alpha) (1.0.18)\n",
"Requirement already satisfied: pickleshare in /usr/local/lib/python3.7/dist-packages (from IPython->pycaret-ts-alpha) (0.7.5)\n",
"Requirement already satisfied: pexpect in /usr/local/lib/python3.7/dist-packages (from IPython->pycaret-ts-alpha) (4.8.0)\n",
"Requirement already satisfied: traitlets>=4.2 in /usr/local/lib/python3.7/dist-packages (from IPython->pycaret-ts-alpha) (5.1.0)\n",
"Requirement already satisfied: pygments in /usr/local/lib/python3.7/dist-packages (from IPython->pycaret-ts-alpha) (2.6.1)\n",
"Requirement already satisfied: simplegeneric>0.8 in /usr/local/lib/python3.7/dist-packages (from IPython->pycaret-ts-alpha) (0.8.1)\n",
"Requirement already satisfied: decorator in /usr/local/lib/python3.7/dist-packages (from IPython->pycaret-ts-alpha) (4.4.2)\n",
"Requirement already satisfied: widgetsnbextension~=3.5.0 in /usr/local/lib/python3.7/dist-packages (from ipywidgets->pycaret-ts-alpha) (3.5.1)\n",
"Requirement already satisfied: nbformat>=4.2.0 in /usr/local/lib/python3.7/dist-packages (from ipywidgets->pycaret-ts-alpha) (5.1.3)\n",
"Requirement already satisfied: ipython-genutils~=0.2.0 in /usr/local/lib/python3.7/dist-packages (from ipywidgets->pycaret-ts-alpha) (0.2.0)\n",
"Requirement already satisfied: ipykernel>=4.5.1 in /usr/local/lib/python3.7/dist-packages (from ipywidgets->pycaret-ts-alpha) (4.10.1)\n",
"Requirement already satisfied: jupyterlab-widgets>=1.0.0 in /usr/local/lib/python3.7/dist-packages (from ipywidgets->pycaret-ts-alpha) (1.0.2)\n",
"Requirement already satisfied: jupyter-client in /usr/local/lib/python3.7/dist-packages (from ipykernel>=4.5.1->ipywidgets->pycaret-ts-alpha) (5.3.5)\n",
"Requirement already satisfied: tornado>=4.0 in /usr/local/lib/python3.7/dist-packages (from ipykernel>=4.5.1->ipywidgets->pycaret-ts-alpha) (5.1.1)\n",
"Requirement already satisfied: wheel in /usr/local/lib/python3.7/dist-packages (from lightgbm>=2.3.1->pycaret-ts-alpha) (0.37.0)\n",
"Requirement already satisfied: pyparsing!=2.0.4,!=2.1.2,!=2.1.6,>=2.0.1 in /usr/local/lib/python3.7/dist-packages (from matplotlib->pycaret-ts-alpha) (2.4.7)\n",
"Requirement already satisfied: cycler>=0.10 in /usr/local/lib/python3.7/dist-packages (from matplotlib->pycaret-ts-alpha) (0.10.0)\n",
"Requirement already satisfied: python-dateutil>=2.1 in /usr/local/lib/python3.7/dist-packages (from matplotlib->pycaret-ts-alpha) (2.8.2)\n",
"Requirement already satisfied: kiwisolver>=1.0.1 in /usr/local/lib/python3.7/dist-packages (from matplotlib->pycaret-ts-alpha) (1.3.2)\n",
"Requirement already satisfied: jsonschema!=2.5.0,>=2.4 in /usr/local/lib/python3.7/dist-packages (from nbformat>=4.2.0->ipywidgets->pycaret-ts-alpha) (2.6.0)\n",
"Requirement already satisfied: jupyter-core in /usr/local/lib/python3.7/dist-packages (from nbformat>=4.2.0->ipywidgets->pycaret-ts-alpha) (4.8.1)\n",
"Requirement already satisfied: pytz>=2017.2 in /usr/local/lib/python3.7/dist-packages (from pandas->pycaret-ts-alpha) (2018.9)\n",
"Requirement already satisfied: phik>=0.11.1 in /usr/local/lib/python3.7/dist-packages (from pandas-profiling>=2.8.0->pycaret-ts-alpha) (0.12.0)\n",
"Requirement already satisfied: htmlmin>=0.1.12 in /usr/local/lib/python3.7/dist-packages (from pandas-profiling>=2.8.0->pycaret-ts-alpha) (0.1.12)\n",
"Requirement already satisfied: markupsafe~=2.0.1 in /usr/local/lib/python3.7/dist-packages (from pandas-profiling>=2.8.0->pycaret-ts-alpha) (2.0.1)\n",
"Requirement already satisfied: tqdm>=4.48.2 in /usr/local/lib/python3.7/dist-packages (from pandas-profiling>=2.8.0->pycaret-ts-alpha) (4.62.3)\n",
"Requirement already satisfied: missingno>=0.4.2 in /usr/local/lib/python3.7/dist-packages (from pandas-profiling>=2.8.0->pycaret-ts-alpha) (0.5.0)\n",
"Requirement already satisfied: jinja2>=2.11.1 in /usr/local/lib/python3.7/dist-packages (from pandas-profiling>=2.8.0->pycaret-ts-alpha) (2.11.3)\n",
"Requirement already satisfied: visions[type_image_path]==0.7.4 in /usr/local/lib/python3.7/dist-packages (from pandas-profiling>=2.8.0->pycaret-ts-alpha) (0.7.4)\n",
"Requirement already satisfied: tangled-up-in-unicode==0.1.0 in /usr/local/lib/python3.7/dist-packages (from pandas-profiling>=2.8.0->pycaret-ts-alpha) (0.1.0)\n",
"Requirement already satisfied: multimethod>=1.4 in /usr/local/lib/python3.7/dist-packages (from pandas-profiling>=2.8.0->pycaret-ts-alpha) (1.6)\n",
"Requirement already satisfied: requests>=2.24.0 in /usr/local/lib/python3.7/dist-packages (from pandas-profiling>=2.8.0->pycaret-ts-alpha) (2.26.0)\n",
"Requirement already satisfied: pydantic>=1.8.1 in /usr/local/lib/python3.7/dist-packages (from pandas-profiling>=2.8.0->pycaret-ts-alpha) (1.8.2)\n",
"Requirement already satisfied: attrs>=19.3.0 in /usr/local/lib/python3.7/dist-packages (from visions[type_image_path]==0.7.4->pandas-profiling>=2.8.0->pycaret-ts-alpha) (21.2.0)\n",
"Requirement already satisfied: networkx>=2.4 in /usr/local/lib/python3.7/dist-packages (from visions[type_image_path]==0.7.4->pandas-profiling>=2.8.0->pycaret-ts-alpha) (2.6.3)\n",
"Requirement already satisfied: Pillow in /usr/local/lib/python3.7/dist-packages (from visions[type_image_path]==0.7.4->pandas-profiling>=2.8.0->pycaret-ts-alpha) (7.1.2)\n",
"Requirement already satisfied: imagehash in /usr/local/lib/python3.7/dist-packages (from visions[type_image_path]==0.7.4->pandas-profiling>=2.8.0->pycaret-ts-alpha) (4.2.1)\n",
"Requirement already satisfied: tenacity>=6.2.0 in /usr/local/lib/python3.7/dist-packages (from plotly>=5.0.0->pycaret-ts-alpha) (8.0.1)\n",
"Requirement already satisfied: urllib3 in /usr/local/lib/python3.7/dist-packages (from pmdarima>=1.8.0->pycaret-ts-alpha) (1.24.3)\n",
"Requirement already satisfied: Cython!=0.29.18,>=0.29 in /usr/local/lib/python3.7/dist-packages (from pmdarima>=1.8.0->pycaret-ts-alpha) (0.29.24)\n",
"Requirement already satisfied: wcwidth in /usr/local/lib/python3.7/dist-packages (from prompt-toolkit<2.0.0,>=1.0.4->IPython->pycaret-ts-alpha) (0.2.5)\n",
"Requirement already satisfied: typing-extensions>=3.7.4.3 in /usr/local/lib/python3.7/dist-packages (from pydantic>=1.8.1->pandas-profiling>=2.8.0->pycaret-ts-alpha) (3.7.4.3)\n",
"Requirement already satisfied: idna<4,>=2.5 in /usr/local/lib/python3.7/dist-packages (from requests>=2.24.0->pandas-profiling>=2.8.0->pycaret-ts-alpha) (2.10)\n",
"Requirement already satisfied: charset-normalizer~=2.0.0 in /usr/local/lib/python3.7/dist-packages (from requests>=2.24.0->pandas-profiling>=2.8.0->pycaret-ts-alpha) (2.0.7)\n",
"Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.7/dist-packages (from requests>=2.24.0->pandas-profiling>=2.8.0->pycaret-ts-alpha) (2021.5.30)\n",
"Requirement already satisfied: threadpoolctl>=2.0.0 in /usr/local/lib/python3.7/dist-packages (from scikit-learn~=0.24.2->pycaret-ts-alpha) (3.0.0)\n",
"Requirement already satisfied: llvmlite<0.38,>=0.37.0rc1 in /usr/local/lib/python3.7/dist-packages (from numba->pycaret-ts-alpha) (0.37.0)\n",
"Requirement already satisfied: catalogue<1.1.0,>=0.0.7 in /usr/local/lib/python3.7/dist-packages (from spacy<2.4.0->pycaret-ts-alpha) (1.0.0)\n",
"Requirement already satisfied: preshed<3.1.0,>=3.0.2 in /usr/local/lib/python3.7/dist-packages (from spacy<2.4.0->pycaret-ts-alpha) (3.0.5)\n",
"Requirement already satisfied: wasabi<1.1.0,>=0.4.0 in /usr/local/lib/python3.7/dist-packages (from spacy<2.4.0->pycaret-ts-alpha) (0.8.2)\n",
"Requirement already satisfied: plac<1.2.0,>=0.9.6 in /usr/local/lib/python3.7/dist-packages (from spacy<2.4.0->pycaret-ts-alpha) (1.1.3)\n",
"Requirement already satisfied: blis<0.5.0,>=0.4.0 in /usr/local/lib/python3.7/dist-packages (from spacy<2.4.0->pycaret-ts-alpha) (0.4.1)\n",
"Requirement already satisfied: cymem<2.1.0,>=2.0.2 in /usr/local/lib/python3.7/dist-packages (from spacy<2.4.0->pycaret-ts-alpha) (2.0.5)\n",
"Requirement already satisfied: thinc==7.4.0 in /usr/local/lib/python3.7/dist-packages (from spacy<2.4.0->pycaret-ts-alpha) (7.4.0)\n",
"Requirement already satisfied: srsly<1.1.0,>=1.0.2 in /usr/local/lib/python3.7/dist-packages (from spacy<2.4.0->pycaret-ts-alpha) (1.0.5)\n",
"Requirement already satisfied: murmurhash<1.1.0,>=0.28.0 in /usr/local/lib/python3.7/dist-packages (from spacy<2.4.0->pycaret-ts-alpha) (1.0.5)\n",
"Requirement already satisfied: importlib-metadata>=0.20 in /usr/local/lib/python3.7/dist-packages (from catalogue<1.1.0,>=0.0.7->spacy<2.4.0->pycaret-ts-alpha) (4.8.1)\n",
"Requirement already satisfied: zipp>=0.5 in /usr/local/lib/python3.7/dist-packages (from importlib-metadata>=0.20->catalogue<1.1.0,>=0.0.7->spacy<2.4.0->pycaret-ts-alpha) (3.6.0)\n",
"Requirement already satisfied: patsy>=0.5 in /usr/local/lib/python3.7/dist-packages (from statsmodels~=0.12.1->pycaret-ts-alpha) (0.5.2)\n",
"Requirement already satisfied: notebook>=4.4.1 in /usr/local/lib/python3.7/dist-packages (from widgetsnbextension~=3.5.0->ipywidgets->pycaret-ts-alpha) (5.3.1)\n",
"Requirement already satisfied: terminado>=0.8.1 in /usr/local/lib/python3.7/dist-packages (from notebook>=4.4.1->widgetsnbextension~=3.5.0->ipywidgets->pycaret-ts-alpha) (0.12.1)\n",
"Requirement already satisfied: Send2Trash in /usr/local/lib/python3.7/dist-packages (from notebook>=4.4.1->widgetsnbextension~=3.5.0->ipywidgets->pycaret-ts-alpha) (1.8.0)\n",
"Requirement already satisfied: nbconvert in /usr/local/lib/python3.7/dist-packages (from notebook>=4.4.1->widgetsnbextension~=3.5.0->ipywidgets->pycaret-ts-alpha) (5.6.1)\n",
"Requirement already satisfied: pyzmq>=13 in /usr/local/lib/python3.7/dist-packages (from jupyter-client->ipykernel>=4.5.1->ipywidgets->pycaret-ts-alpha) (22.3.0)\n",
"Requirement already satisfied: ptyprocess in /usr/local/lib/python3.7/dist-packages (from terminado>=0.8.1->notebook>=4.4.1->widgetsnbextension~=3.5.0->ipywidgets->pycaret-ts-alpha) (0.7.0)\n",
"Requirement already satisfied: PyWavelets in /usr/local/lib/python3.7/dist-packages (from imagehash->visions[type_image_path]==0.7.4->pandas-profiling>=2.8.0->pycaret-ts-alpha) (1.1.1)\n",
"Requirement already satisfied: querystring-parser in /usr/local/lib/python3.7/dist-packages (from mlflow->pycaret-ts-alpha) (1.2.4)\n",
"Requirement already satisfied: docker>=4.0.0 in /usr/local/lib/python3.7/dist-packages (from mlflow->pycaret-ts-alpha) (5.0.3)\n",
"Requirement already satisfied: click>=7.0 in /usr/local/lib/python3.7/dist-packages (from mlflow->pycaret-ts-alpha) (7.1.2)\n",
"Requirement already satisfied: prometheus-flask-exporter in /usr/local/lib/python3.7/dist-packages (from mlflow->pycaret-ts-alpha) (0.18.5)\n",
"Requirement already satisfied: entrypoints in /usr/local/lib/python3.7/dist-packages (from mlflow->pycaret-ts-alpha) (0.3)\n",
"Requirement already satisfied: protobuf>=3.7.0 in /usr/local/lib/python3.7/dist-packages (from mlflow->pycaret-ts-alpha) (3.17.3)\n",
"Requirement already satisfied: cloudpickle in /usr/local/lib/python3.7/dist-packages (from mlflow->pycaret-ts-alpha) (1.3.0)\n",
"Requirement already satisfied: Flask in /usr/local/lib/python3.7/dist-packages (from mlflow->pycaret-ts-alpha) (1.1.4)\n",
"Requirement already satisfied: gitpython>=2.1.0 in /usr/local/lib/python3.7/dist-packages (from mlflow->pycaret-ts-alpha) (3.1.24)\n",
"Requirement already satisfied: packaging in /usr/local/lib/python3.7/dist-packages (from mlflow->pycaret-ts-alpha) (21.0)\n",
"Requirement already satisfied: sqlparse>=0.3.1 in /usr/local/lib/python3.7/dist-packages (from mlflow->pycaret-ts-alpha) (0.4.2)\n",
"Requirement already satisfied: alembic<=1.4.1 in /usr/local/lib/python3.7/dist-packages (from mlflow->pycaret-ts-alpha) (1.4.1)\n",
"Requirement already satisfied: sqlalchemy in /usr/local/lib/python3.7/dist-packages (from mlflow->pycaret-ts-alpha) (1.4.25)\n",
"Requirement already satisfied: databricks-cli>=0.8.7 in /usr/local/lib/python3.7/dist-packages (from mlflow->pycaret-ts-alpha) (0.16.2)\n",
"Requirement already satisfied: gunicorn in /usr/local/lib/python3.7/dist-packages (from mlflow->pycaret-ts-alpha) (20.1.0)\n",
"Requirement already satisfied: Mako in /usr/local/lib/python3.7/dist-packages (from alembic<=1.4.1->mlflow->pycaret-ts-alpha) (1.1.5)\n",
"Requirement already satisfied: python-editor>=0.3 in /usr/local/lib/python3.7/dist-packages (from alembic<=1.4.1->mlflow->pycaret-ts-alpha) (1.0.4)\n",
"Requirement already satisfied: tabulate>=0.7.7 in /usr/local/lib/python3.7/dist-packages (from databricks-cli>=0.8.7->mlflow->pycaret-ts-alpha) (0.8.9)\n",
"Requirement already satisfied: websocket-client>=0.32.0 in /usr/local/lib/python3.7/dist-packages (from docker>=4.0.0->mlflow->pycaret-ts-alpha) (1.2.1)\n",
"Requirement already satisfied: gitdb<5,>=4.0.1 in /usr/local/lib/python3.7/dist-packages (from gitpython>=2.1.0->mlflow->pycaret-ts-alpha) (4.0.9)\n",
"Requirement already satisfied: smmap<6,>=3.0.1 in /usr/local/lib/python3.7/dist-packages (from gitdb<5,>=4.0.1->gitpython>=2.1.0->mlflow->pycaret-ts-alpha) (5.0.0)\n",
"Requirement already satisfied: greenlet!=0.4.17 in /usr/local/lib/python3.7/dist-packages (from sqlalchemy->mlflow->pycaret-ts-alpha) (1.1.2)\n",
"Requirement already satisfied: Werkzeug<2.0,>=0.15 in /usr/local/lib/python3.7/dist-packages (from Flask->mlflow->pycaret-ts-alpha) (1.0.1)\n",
"Requirement already satisfied: itsdangerous<2.0,>=0.24 in /usr/local/lib/python3.7/dist-packages (from Flask->mlflow->pycaret-ts-alpha) (1.1.0)\n",
"Requirement already satisfied: pandocfilters>=1.4.1 in /usr/local/lib/python3.7/dist-packages (from nbconvert->notebook>=4.4.1->widgetsnbextension~=3.5.0->ipywidgets->pycaret-ts-alpha) (1.5.0)\n",
"Requirement already satisfied: mistune<2,>=0.8.1 in /usr/local/lib/python3.7/dist-packages (from nbconvert->notebook>=4.4.1->widgetsnbextension~=3.5.0->ipywidgets->pycaret-ts-alpha) (0.8.4)\n",
"Requirement already satisfied: testpath in /usr/local/lib/python3.7/dist-packages (from nbconvert->notebook>=4.4.1->widgetsnbextension~=3.5.0->ipywidgets->pycaret-ts-alpha) (0.5.0)\n",
"Requirement already satisfied: defusedxml in /usr/local/lib/python3.7/dist-packages (from nbconvert->notebook>=4.4.1->widgetsnbextension~=3.5.0->ipywidgets->pycaret-ts-alpha) (0.7.1)\n",
"Requirement already satisfied: bleach in /usr/local/lib/python3.7/dist-packages (from nbconvert->notebook>=4.4.1->widgetsnbextension~=3.5.0->ipywidgets->pycaret-ts-alpha) (4.1.0)\n",
"Requirement already satisfied: webencodings in /usr/local/lib/python3.7/dist-packages (from bleach->nbconvert->notebook>=4.4.1->widgetsnbextension~=3.5.0->ipywidgets->pycaret-ts-alpha) (0.5.1)\n",
"Requirement already satisfied: prometheus-client in /usr/local/lib/python3.7/dist-packages (from prometheus-flask-exporter->mlflow->pycaret-ts-alpha) (0.12.0)\n",
"Requirement already satisfied: future in /usr/local/lib/python3.7/dist-packages (from pyLDAvis->pycaret-ts-alpha) (0.16.0)\n",
"Requirement already satisfied: funcy in /usr/local/lib/python3.7/dist-packages (from pyLDAvis->pycaret-ts-alpha) (1.16)\n",
"Requirement already satisfied: numexpr in /usr/local/lib/python3.7/dist-packages (from pyLDAvis->pycaret-ts-alpha) (2.7.3)\n",
"Requirement already satisfied: pynndescent>=0.5 in /usr/local/lib/python3.7/dist-packages (from umap-learn->pycaret-ts-alpha) (0.5.5)\n",
"Requirement already satisfied: prophet in /usr/local/lib/python3.7/dist-packages (1.0.1)\n",
"Requirement already satisfied: Cython>=0.22 in /usr/local/lib/python3.7/dist-packages (from prophet) (0.29.24)\n",
"Requirement already satisfied: numpy>=1.15.4 in /usr/local/lib/python3.7/dist-packages (from prophet) (1.19.5)\n",
"Requirement already satisfied: convertdate>=2.1.2 in /usr/local/lib/python3.7/dist-packages (from prophet) (2.3.2)\n",
"Requirement already satisfied: pandas>=1.0.4 in /usr/local/lib/python3.7/dist-packages (from prophet) (1.1.5)\n",
"Requirement already satisfied: holidays>=0.10.2 in /usr/local/lib/python3.7/dist-packages (from prophet) (0.10.5.2)\n",
"Requirement already satisfied: tqdm>=4.36.1 in /usr/local/lib/python3.7/dist-packages (from prophet) (4.62.3)\n",
"Requirement already satisfied: cmdstanpy==0.9.68 in /usr/local/lib/python3.7/dist-packages (from prophet) (0.9.68)\n",
"Requirement already satisfied: LunarCalendar>=0.0.9 in /usr/local/lib/python3.7/dist-packages (from prophet) (0.0.9)\n",
"Requirement already satisfied: setuptools-git>=1.2 in /usr/local/lib/python3.7/dist-packages (from prophet) (1.2)\n",
"Requirement already satisfied: pystan~=2.19.1.1 in /usr/local/lib/python3.7/dist-packages (from prophet) (2.19.1.1)\n",
"Requirement already satisfied: matplotlib>=2.0.0 in /usr/local/lib/python3.7/dist-packages (from prophet) (3.2.2)\n",
"Requirement already satisfied: python-dateutil>=2.8.0 in /usr/local/lib/python3.7/dist-packages (from prophet) (2.8.2)\n",
"Requirement already satisfied: ujson in /usr/local/lib/python3.7/dist-packages (from cmdstanpy==0.9.68->prophet) (4.2.0)\n",
"Requirement already satisfied: pytz>=2014.10 in /usr/local/lib/python3.7/dist-packages (from convertdate>=2.1.2->prophet) (2018.9)\n",
"Requirement already satisfied: pymeeus<=1,>=0.3.13 in /usr/local/lib/python3.7/dist-packages (from convertdate>=2.1.2->prophet) (0.5.11)\n",
"Requirement already satisfied: korean-lunar-calendar in /usr/local/lib/python3.7/dist-packages (from holidays>=0.10.2->prophet) (0.2.1)\n",
"Requirement already satisfied: hijri-converter in /usr/local/lib/python3.7/dist-packages (from holidays>=0.10.2->prophet) (2.2.2)\n",
"Requirement already satisfied: six in /usr/local/lib/python3.7/dist-packages (from holidays>=0.10.2->prophet) (1.15.0)\n",
"Requirement already satisfied: ephem>=3.7.5.3 in /usr/local/lib/python3.7/dist-packages (from LunarCalendar>=0.0.9->prophet) (4.1)\n",
"Requirement already satisfied: kiwisolver>=1.0.1 in /usr/local/lib/python3.7/dist-packages (from matplotlib>=2.0.0->prophet) (1.3.2)\n",
"Requirement already satisfied: pyparsing!=2.0.4,!=2.1.2,!=2.1.6,>=2.0.1 in /usr/local/lib/python3.7/dist-packages (from matplotlib>=2.0.0->prophet) (2.4.7)\n",
"Requirement already satisfied: cycler>=0.10 in /usr/local/lib/python3.7/dist-packages (from matplotlib>=2.0.0->prophet) (0.10.0)\n"
]
}
]
},
{
"cell_type": "code",
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/",
"height": 146
},
"id": "HgFuWQ5v0KWk",
"outputId": "311d1634-9306-4f08-90ea-47aa8259d1df"
},
"source": [
"#### Load data ----\n",
"from pycaret.datasets import get_data\n",
"y = get_data(\"airline\")"
],
"execution_count": 2,
"outputs": [
{
"output_type": "display_data",
"data": {
"text/plain": [
"Period\n",
"1949-01 112.0\n",
"1949-02 118.0\n",
"1949-03 132.0\n",
"1949-04 129.0\n",
"1949-05 121.0\n",
"Freq: M, Name: Number of airline passengers, dtype: float64"
]
},
"metadata": {}
}
]
},
{
"cell_type": "code",
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/",
"height": 695,
"referenced_widgets": [
"62f2610cf5714f20a6e34720d1a2beac",
"da3f721c98ec4e4b9667f9a4d699672b",
"d6da67a582cd4cf1913db62cdde39080"
]
},
"id": "_YraLh_21Ev0",
"outputId": "e512e86b-d3a5-43f6-a40a-8b43907bf200"
},
"source": [
"#### Setup experiment ----\n",
"from pycaret.internal.pycaret_experiment.time_series_experiment import TimeSeriesExperiment\n",
"exp = TimeSeriesExperiment()\n",
"\n",
"exp.setup(data=y, fh=12, session_id=42)"
],
"execution_count": 3,
"outputs": [
{
"output_type": "display_data",
"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>Description</th>\n",
" <th>Value</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>0</th>\n",
" <td>session_id</td>\n",
" <td>42</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1</th>\n",
" <td>Original Data</td>\n",
" <td>(144, 1)</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2</th>\n",
" <td>Missing Values</td>\n",
" <td>False</td>\n",
" </tr>\n",
" <tr>\n",
" <th>3</th>\n",
" <td>Transformed Train Set</td>\n",
" <td>(132,)</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4</th>\n",
" <td>Transformed Test Set</td>\n",
" <td>(12,)</td>\n",
" </tr>\n",
" <tr>\n",
" <th>5</th>\n",
" <td>Fold Generator</td>\n",
" <td>ExpandingWindowSplitter</td>\n",
" </tr>\n",
" <tr>\n",
" <th>6</th>\n",
" <td>Fold Number</td>\n",
" <td>3</td>\n",
" </tr>\n",
" <tr>\n",
" <th>7</th>\n",
" <td>Enforce Prediction Interval</td>\n",
" <td>False</td>\n",
" </tr>\n",
" <tr>\n",
" <th>8</th>\n",
" <td>Seasonal Period Tested</td>\n",
" <td>12</td>\n",
" </tr>\n",
" <tr>\n",
" <th>9</th>\n",
" <td>Seasonality Detected</td>\n",
" <td>True</td>\n",
" </tr>\n",
" <tr>\n",
" <th>10</th>\n",
" <td>Target Strictly Positive</td>\n",
" <td>True</td>\n",
" </tr>\n",
" <tr>\n",
" <th>11</th>\n",
" <td>Target White Noise</td>\n",
" <td>No</td>\n",
" </tr>\n",
" <tr>\n",
" <th>12</th>\n",
" <td>Recommended d</td>\n",
" <td>1</td>\n",
" </tr>\n",
" <tr>\n",
" <th>13</th>\n",
" <td>Recommended Seasonal D</td>\n",
" <td>1</td>\n",
" </tr>\n",
" <tr>\n",
" <th>14</th>\n",
" <td>CPU Jobs</td>\n",
" <td>-1</td>\n",
" </tr>\n",
" <tr>\n",
" <th>15</th>\n",
" <td>Use GPU</td>\n",
" <td>False</td>\n",
" </tr>\n",
" <tr>\n",
" <th>16</th>\n",
" <td>Log Experiment</td>\n",
" <td>False</td>\n",
" </tr>\n",
" <tr>\n",
" <th>17</th>\n",
" <td>Experiment Name</td>\n",
" <td>ts-default-name</td>\n",
" </tr>\n",
" <tr>\n",
" <th>18</th>\n",
" <td>USI</td>\n",
" <td>0099</td>\n",
" </tr>\n",
" <tr>\n",
" <th>19</th>\n",
" <td>Imputation Type</td>\n",
" <td>simple</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"text/plain": [
" Description Value\n",
"0 session_id 42\n",
"1 Original Data (144, 1)\n",
"2 Missing Values False\n",
"3 Transformed Train Set (132,)\n",
"4 Transformed Test Set (12,)\n",
"5 Fold Generator ExpandingWindowSplitter\n",
"6 Fold Number 3\n",
"7 Enforce Prediction Interval False\n",
"8 Seasonal Period Tested 12\n",
"9 Seasonality Detected True\n",
"10 Target Strictly Positive True\n",
"11 Target White Noise No\n",
"12 Recommended d 1\n",
"13 Recommended Seasonal D 1\n",
"14 CPU Jobs -1\n",
"15 Use GPU False\n",
"16 Log Experiment False\n",
"17 Experiment Name ts-default-name\n",
"18 USI 0099\n",
"19 Imputation Type simple"
]
},
"metadata": {}
},
{
"output_type": "execute_result",
"data": {
"text/plain": [
"<pycaret.internal.pycaret_experiment.time_series_experiment.TimeSeriesExperiment at 0x7f65c096a790>"
]
},
"metadata": {},
"execution_count": 3
}
]
},
{
"cell_type": "code",
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/",
"height": 959
},
"id": "rd2THcDQ0_XK",
"outputId": "e9424792-e35a-4ded-d523-d004af1acd5b"
},
"source": [
"#### Available Models\n",
"exp.models()"
],
"execution_count": 4,
"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>Name</th>\n",
" <th>Reference</th>\n",
" <th>Turbo</th>\n",
" </tr>\n",
" <tr>\n",
" <th>ID</th>\n",
" <th></th>\n",
" <th></th>\n",
" <th></th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>naive</th>\n",
" <td>Naive Forecaster</td>\n",
" <td>sktime.forecasting.naive.NaiveForecaster</td>\n",
" <td>True</td>\n",
" </tr>\n",
" <tr>\n",
" <th>snaive</th>\n",
" <td>Seasonal Naive Forecaster</td>\n",
" <td>sktime.forecasting.naive.NaiveForecaster</td>\n",
" <td>True</td>\n",
" </tr>\n",
" <tr>\n",
" <th>polytrend</th>\n",
" <td>Polynomial Trend Forecaster</td>\n",
" <td>sktime.forecasting.trend.PolynomialTrendForeca...</td>\n",
" <td>True</td>\n",
" </tr>\n",
" <tr>\n",
" <th>arima</th>\n",
" <td>ARIMA</td>\n",
" <td>sktime.forecasting.arima.ARIMA</td>\n",
" <td>True</td>\n",
" </tr>\n",
" <tr>\n",
" <th>auto_arima</th>\n",
" <td>Auto ARIMA</td>\n",
" <td>sktime.forecasting.arima.AutoARIMA</td>\n",
" <td>True</td>\n",
" </tr>\n",
" <tr>\n",
" <th>exp_smooth</th>\n",
" <td>Exponential Smoothing</td>\n",
" <td>sktime.forecasting.exp_smoothing.ExponentialSm...</td>\n",
" <td>True</td>\n",
" </tr>\n",
" <tr>\n",
" <th>ets</th>\n",
" <td>ETS</td>\n",
" <td>sktime.forecasting.ets.AutoETS</td>\n",
" <td>True</td>\n",
" </tr>\n",
" <tr>\n",
" <th>theta</th>\n",
" <td>Theta Forecaster</td>\n",
" <td>sktime.forecasting.theta.ThetaForecaster</td>\n",
" <td>True</td>\n",
" </tr>\n",
" <tr>\n",
" <th>tbats</th>\n",
" <td>TBATS</td>\n",
" <td>sktime.forecasting.tbats.TBATS</td>\n",
" <td>False</td>\n",
" </tr>\n",
" <tr>\n",
" <th>bats</th>\n",
" <td>BATS</td>\n",
" <td>sktime.forecasting.bats.BATS</td>\n",
" <td>False</td>\n",
" </tr>\n",
" <tr>\n",
" <th>prophet</th>\n",
" <td>Prophet</td>\n",
" <td>pycaret.containers.models.time_series.ProphetP...</td>\n",
" <td>False</td>\n",
" </tr>\n",
" <tr>\n",
" <th>lr_cds_dt</th>\n",
" <td>Linear w/ Cond. Deseasonalize &amp; Detrending</td>\n",
" <td>pycaret.containers.models.time_series.BaseCdsD...</td>\n",
" <td>True</td>\n",
" </tr>\n",
" <tr>\n",
" <th>en_cds_dt</th>\n",
" <td>Elastic Net w/ Cond. Deseasonalize &amp; Detrending</td>\n",
" <td>pycaret.containers.models.time_series.BaseCdsD...</td>\n",
" <td>True</td>\n",
" </tr>\n",
" <tr>\n",
" <th>ridge_cds_dt</th>\n",
" <td>Ridge w/ Cond. Deseasonalize &amp; Detrending</td>\n",
" <td>pycaret.containers.models.time_series.BaseCdsD...</td>\n",
" <td>True</td>\n",
" </tr>\n",
" <tr>\n",
" <th>lasso_cds_dt</th>\n",
" <td>Lasso w/ Cond. Deseasonalize &amp; Detrending</td>\n",
" <td>pycaret.containers.models.time_series.BaseCdsD...</td>\n",
" <td>True</td>\n",
" </tr>\n",
" <tr>\n",
" <th>lar_cds_dt</th>\n",
" <td>Least Angular Regressor w/ Cond. Deseasonalize...</td>\n",
" <td>pycaret.containers.models.time_series.BaseCdsD...</td>\n",
" <td>True</td>\n",
" </tr>\n",
" <tr>\n",
" <th>llar_cds_dt</th>\n",
" <td>Lasso Least Angular Regressor w/ Cond. Deseaso...</td>\n",
" <td>pycaret.containers.models.time_series.BaseCdsD...</td>\n",
" <td>True</td>\n",
" </tr>\n",
" <tr>\n",
" <th>br_cds_dt</th>\n",
" <td>Bayesian Ridge w/ Cond. Deseasonalize &amp; Detren...</td>\n",
" <td>pycaret.containers.models.time_series.BaseCdsD...</td>\n",
" <td>True</td>\n",
" </tr>\n",
" <tr>\n",
" <th>huber_cds_dt</th>\n",
" <td>Huber w/ Cond. Deseasonalize &amp; Detrending</td>\n",
" <td>pycaret.containers.models.time_series.BaseCdsD...</td>\n",
" <td>True</td>\n",
" </tr>\n",
" <tr>\n",
" <th>par_cds_dt</th>\n",
" <td>Passive Aggressive w/ Cond. Deseasonalize &amp; De...</td>\n",
" <td>pycaret.containers.models.time_series.BaseCdsD...</td>\n",
" <td>True</td>\n",
" </tr>\n",
" <tr>\n",
" <th>omp_cds_dt</th>\n",
" <td>Orthogonal Matching Pursuit w/ Cond. Deseasona...</td>\n",
" <td>pycaret.containers.models.time_series.BaseCdsD...</td>\n",
" <td>True</td>\n",
" </tr>\n",
" <tr>\n",
" <th>knn_cds_dt</th>\n",
" <td>K Neighbors w/ Cond. Deseasonalize &amp; Detrending</td>\n",
" <td>pycaret.containers.models.time_series.BaseCdsD...</td>\n",
" <td>True</td>\n",
" </tr>\n",
" <tr>\n",
" <th>dt_cds_dt</th>\n",
" <td>Decision Tree w/ Cond. Deseasonalize &amp; Detrending</td>\n",
" <td>pycaret.containers.models.time_series.BaseCdsD...</td>\n",
" <td>True</td>\n",
" </tr>\n",
" <tr>\n",
" <th>rf_cds_dt</th>\n",
" <td>Random Forest w/ Cond. Deseasonalize &amp; Detrending</td>\n",
" <td>pycaret.containers.models.time_series.BaseCdsD...</td>\n",
" <td>True</td>\n",
" </tr>\n",
" <tr>\n",
" <th>et_cds_dt</th>\n",
" <td>Extra Trees w/ Cond. Deseasonalize &amp; Detrending</td>\n",
" <td>pycaret.containers.models.time_series.BaseCdsD...</td>\n",
" <td>True</td>\n",
" </tr>\n",
" <tr>\n",
" <th>gbr_cds_dt</th>\n",
" <td>Gradient Boosting w/ Cond. Deseasonalize &amp; Det...</td>\n",
" <td>pycaret.containers.models.time_series.BaseCdsD...</td>\n",
" <td>True</td>\n",
" </tr>\n",
" <tr>\n",
" <th>ada_cds_dt</th>\n",
" <td>AdaBoost w/ Cond. Deseasonalize &amp; Detrending</td>\n",
" <td>pycaret.containers.models.time_series.BaseCdsD...</td>\n",
" <td>True</td>\n",
" </tr>\n",
" <tr>\n",
" <th>lightgbm_cds_dt</th>\n",
" <td>Light Gradient Boosting w/ Cond. Deseasonalize...</td>\n",
" <td>pycaret.containers.models.time_series.BaseCdsD...</td>\n",
" <td>True</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"text/plain": [
" Name ... Turbo\n",
"ID ... \n",
"naive Naive Forecaster ... True\n",
"snaive Seasonal Naive Forecaster ... True\n",
"polytrend Polynomial Trend Forecaster ... True\n",
"arima ARIMA ... True\n",
"auto_arima Auto ARIMA ... True\n",
"exp_smooth Exponential Smoothing ... True\n",
"ets ETS ... True\n",
"theta Theta Forecaster ... True\n",
"tbats TBATS ... False\n",
"bats BATS ... False\n",
"prophet Prophet ... False\n",
"lr_cds_dt Linear w/ Cond. Deseasonalize & Detrending ... True\n",
"en_cds_dt Elastic Net w/ Cond. Deseasonalize & Detrending ... True\n",
"ridge_cds_dt Ridge w/ Cond. Deseasonalize & Detrending ... True\n",
"lasso_cds_dt Lasso w/ Cond. Deseasonalize & Detrending ... True\n",
"lar_cds_dt Least Angular Regressor w/ Cond. Deseasonalize... ... True\n",
"llar_cds_dt Lasso Least Angular Regressor w/ Cond. Deseaso... ... True\n",
"br_cds_dt Bayesian Ridge w/ Cond. Deseasonalize & Detren... ... True\n",
"huber_cds_dt Huber w/ Cond. Deseasonalize & Detrending ... True\n",
"par_cds_dt Passive Aggressive w/ Cond. Deseasonalize & De... ... True\n",
"omp_cds_dt Orthogonal Matching Pursuit w/ Cond. Deseasona... ... True\n",
"knn_cds_dt K Neighbors w/ Cond. Deseasonalize & Detrending ... True\n",
"dt_cds_dt Decision Tree w/ Cond. Deseasonalize & Detrending ... True\n",
"rf_cds_dt Random Forest w/ Cond. Deseasonalize & Detrending ... True\n",
"et_cds_dt Extra Trees w/ Cond. Deseasonalize & Detrending ... True\n",
"gbr_cds_dt Gradient Boosting w/ Cond. Deseasonalize & Det... ... True\n",
"ada_cds_dt AdaBoost w/ Cond. Deseasonalize & Detrending ... True\n",
"lightgbm_cds_dt Light Gradient Boosting w/ Cond. Deseasonalize... ... True\n",
"\n",
"[28 rows x 3 columns]"
]
},
"metadata": {},
"execution_count": 4
}
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "N5_qURrVABwi"
},
"source": [
"## Manually Flow"
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "nZ1TJQPz1OKB"
},
"source": [
"Which ones should you try?\n",
"\n",
"Recommendation: Always start from a simple baseline model ..."
]
},
{
"cell_type": "code",
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/",
"height": 731,
"referenced_widgets": [
"17a8d2dc2a384df894af1a544d36e207",
"97071b6ff1f84366bcb16d3d20a8c3dd",
"6c1579206380405f827794720233e3f0"
]
},
"id": "54DgwWsy1C1x",
"outputId": "1eaef46b-73a8-4c24-ac13-927e4617c5e4"
},
"source": [
"# Seasonal Naive Baseline ----\n",
"baseline = exp.create_model(\"snaive\")\n",
"exp.plot_model(baseline)"
],
"execution_count": 5,
"outputs": [
{
"output_type": "display_data",
"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>cutoff</th>\n",
" <th>MAE</th>\n",
" <th>RMSE</th>\n",
" <th>MAPE</th>\n",
" <th>SMAPE</th>\n",
" <th>R2</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>0</th>\n",
" <td>1956-12</td>\n",
" <td>40.1667</td>\n",
" <td>41.4749</td>\n",
" <td>0.1076</td>\n",
" <td>0.1138</td>\n",
" <td>0.4401</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1</th>\n",
" <td>1957-12</td>\n",
" <td>12.5833</td>\n",
" <td>17.0123</td>\n",
" <td>0.0314</td>\n",
" <td>0.0322</td>\n",
" <td>0.9242</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2</th>\n",
" <td>1958-12</td>\n",
" <td>47.3333</td>\n",
" <td>49.2544</td>\n",
" <td>0.1106</td>\n",
" <td>0.1176</td>\n",
" <td>0.4573</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Mean</th>\n",
" <td>NaN</td>\n",
" <td>33.3611</td>\n",
" <td>35.9139</td>\n",
" <td>0.0832</td>\n",
" <td>0.0879</td>\n",
" <td>0.6072</td>\n",
" </tr>\n",
" <tr>\n",
" <th>SD</th>\n",
" <td>NaN</td>\n",
" <td>14.9806</td>\n",
" <td>13.7376</td>\n",
" <td>0.0367</td>\n",
" <td>0.0394</td>\n",
" <td>0.2243</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"text/plain": [
" cutoff MAE RMSE MAPE SMAPE R2\n",
"0 1956-12 40.1667 41.4749 0.1076 0.1138 0.4401\n",
"1 1957-12 12.5833 17.0123 0.0314 0.0322 0.9242\n",
"2 1958-12 47.3333 49.2544 0.1106 0.1176 0.4573\n",
"Mean NaN 33.3611 35.9139 0.0832 0.0879 0.6072\n",
"SD NaN 14.9806 13.7376 0.0367 0.0394 0.2243"
]
},
"metadata": {}
},
{
"output_type": "display_data",
"data": {
"text/html": [
"<html>\n",
"<head><meta charset=\"utf-8\" /></head>\n",
"<body>\n",
" <div> <script src=\"https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js?config=TeX-AMS-MML_SVG\"></script><script type=\"text/javascript\">if (window.MathJax) {MathJax.Hub.Config({SVG: {font: \"STIX-Web\"}});}</script> <script type=\"text/javascript\">window.PlotlyConfig = {MathJaxConfig: 'local'};</script>\n",
" <script src=\"https://cdn.plot.ly/plotly-2.4.2.min.js\"></script> <div id=\"5f40444d-11e5-4249-a8ea-7188e08bc092\" class=\"plotly-graph-div\" style=\"height:525px; width:100%;\"></div> <script type=\"text/javascript\"> window.PLOTLYENV=window.PLOTLYENV || {}; if (document.getElementById(\"5f40444d-11e5-4249-a8ea-7188e08bc092\")) { Plotly.newPlot( \"5f40444d-11e5-4249-a8ea-7188e08bc092\", [{\"line\":{\"color\":\"#1f77b4\"},\"marker\":{\"size\":5},\"mode\":\"lines+markers\",\"name\":\"Forecast | Naive Forecaster\",\"showlegend\":true,\"type\":\"scatter\",\"x\":[\"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\":[360.0,342.0,406.0,396.0,420.0,472.0,548.0,559.0,463.0,407.0,362.0,405.0]},{\"marker\":{\"color\":\"#3f3f3f\",\"size\":5},\"mode\":\"lines+markers\",\"name\":\"Original\",\"showlegend\":true,\"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\",\"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\":[112.0,118.0,132.0,129.0,121.0,135.0,148.0,148.0,136.0,119.0,104.0,118.0,115.0,126.0,141.0,135.0,125.0,149.0,170.0,170.0,158.0,133.0,114.0,140.0,145.0,150.0,178.0,163.0,172.0,178.0,199.0,199.0,184.0,162.0,146.0,166.0,171.0,180.0,193.0,181.0,183.0,218.0,230.0,242.0,209.0,191.0,172.0,194.0,196.0,196.0,236.0,235.0,229.0,243.0,264.0,272.0,237.0,211.0,180.0,201.0,204.0,188.0,235.0,227.0,234.0,264.0,302.0,293.0,259.0,229.0,203.0,229.0,242.0,233.0,267.0,269.0,270.0,315.0,364.0,347.0,312.0,274.0,237.0,278.0,284.0,277.0,317.0,313.0,318.0,374.0,413.0,405.0,355.0,306.0,271.0,306.0,315.0,301.0,356.0,348.0,355.0,422.0,465.0,467.0,404.0,347.0,305.0,336.0,340.0,318.0,362.0,348.0,363.0,435.0,491.0,505.0,404.0,359.0,310.0,337.0,360.0,342.0,406.0,396.0,420.0,472.0,548.0,559.0,463.0,407.0,362.0,405.0,417.0,391.0,419.0,461.0,472.0,535.0,622.0,606.0,508.0,461.0,390.0,432.0]}], {\"showlegend\":true,\"template\":{\"data\":{\"bar\":[{\"error_x\":{\"color\":\"rgb(51,51,51)\"},\"error_y\":{\"color\":\"rgb(51,51,51)\"},\"marker\":{\"line\":{\"color\":\"rgb(237,237,237)\",\"width\":0.5},\"pattern\":{\"fillmode\":\"overlay\",\"size\":10,\"solidity\":0.2}},\"type\":\"bar\"}],\"barpolar\":[{\"marker\":{\"line\":{\"color\":\"rgb(237,237,237)\",\"width\":0.5},\"pattern\":{\"fillmode\":\"overlay\",\"size\":10,\"solidity\":0.2}},\"type\":\"barpolar\"}],\"carpet\":[{\"aaxis\":{\"endlinecolor\":\"rgb(51,51,51)\",\"gridcolor\":\"white\",\"linecolor\":\"white\",\"minorgridcolor\":\"white\",\"startlinecolor\":\"rgb(51,51,51)\"},\"baxis\":{\"endlinecolor\":\"rgb(51,51,51)\",\"gridcolor\":\"white\",\"linecolor\":\"white\",\"minorgridcolor\":\"white\",\"startlinecolor\":\"rgb(51,51,51)\"},\"type\":\"carpet\"}],\"choropleth\":[{\"colorbar\":{\"outlinewidth\":0,\"tickcolor\":\"rgb(237,237,237)\",\"ticklen\":6,\"ticks\":\"inside\"},\"type\":\"choropleth\"}],\"contour\":[{\"colorbar\":{\"outlinewidth\":0,\"tickcolor\":\"rgb(237,237,237)\",\"ticklen\":6,\"ticks\":\"inside\"},\"colorscale\":[[0,\"rgb(20,44,66)\"],[1,\"rgb(90,179,244)\"]],\"type\":\"contour\"}],\"contourcarpet\":[{\"colorbar\":{\"outlinewidth\":0,\"tickcolor\":\"rgb(237,237,237)\",\"ticklen\":6,\"ticks\":\"inside\"},\"type\":\"contourcarpet\"}],\"heatmap\":[{\"colorbar\":{\"outlinewidth\":0,\"tickcolor\":\"rgb(237,237,237)\",\"ticklen\":6,\"ticks\":\"inside\"},\"colorscale\":[[0,\"rgb(20,44,66)\"],[1,\"rgb(90,179,244)\"]],\"type\":\"heatmap\"}],\"heatmapgl\":[{\"colorbar\":{\"outlinewidth\":0,\"tickcolor\":\"rgb(237,237,237)\",\"ticklen\":6,\"ticks\":\"inside\"},\"colorscale\":[[0,\"rgb(20,44,66)\"],[1,\"rgb(90,179,244)\"]],\"type\":\"heatmapgl\"}],\"histogram\":[{\"marker\":{\"pattern\":{\"fillmode\":\"overlay\",\"size\":10,\"solidity\":0.2}},\"type\":\"histogram\"}],\"histogram2d\":[{\"colorbar\":{\"outlinewidth\":0,\"tickcolor\":\"rgb(237,237,237)\",\"ticklen\":6,\"ticks\":\"inside\"},\"colorscale\":[[0,\"rgb(20,44,66)\"],[1,\"rgb(90,179,244)\"]],\"type\":\"histogram2d\"}],\"histogram2dcontour\":[{\"colorbar\":{\"outlinewidth\":0,\"tickcolor\":\"rgb(237,237,237)\",\"ticklen\":6,\"ticks\":\"inside\"},\"colorscale\":[[0,\"rgb(20,44,66)\"],[1,\"rgb(90,179,244)\"]],\"type\":\"histogram2dcontour\"}],\"mesh3d\":[{\"colorbar\":{\"outlinewidth\":0,\"tickcolor\":\"rgb(237,237,237)\",\"ticklen\":6,\"ticks\":\"inside\"},\"type\":\"mesh3d\"}],\"parcoords\":[{\"line\":{\"colorbar\":{\"outlinewidth\":0,\"tickcolor\":\"rgb(237,237,237)\",\"ticklen\":6,\"ticks\":\"inside\"}},\"type\":\"parcoords\"}],\"pie\":[{\"automargin\":true,\"type\":\"pie\"}],\"scatter\":[{\"marker\":{\"colorbar\":{\"outlinewidth\":0,\"tickcolor\":\"rgb(237,237,237)\",\"ticklen\":6,\"ticks\":\"inside\"}},\"type\":\"scatter\"}],\"scatter3d\":[{\"line\":{\"colorbar\":{\"outlinewidth\":0,\"tickcolor\":\"rgb(237,237,237)\",\"ticklen\":6,\"ticks\":\"inside\"}},\"marker\":{\"colorbar\":{\"outlinewidth\":0,\"tickcolor\":\"rgb(237,237,237)\",\"ticklen\":6,\"ticks\":\"inside\"}},\"type\":\"scatter3d\"}],\"scattercarpet\":[{\"marker\":{\"colorbar\":{\"outlinewidth\":0,\"tickcolor\":\"rgb(237,237,237)\",\"ticklen\":6,\"ticks\":\"inside\"}},\"type\":\"scattercarpet\"}],\"scattergeo\":[{\"marker\":{\"colorbar\":{\"outlinewidth\":0,\"tickcolor\":\"rgb(237,237,237)\",\"ticklen\":6,\"ticks\":\"inside\"}},\"type\":\"scattergeo\"}],\"scattergl\":[{\"marker\":{\"colorbar\":{\"outlinewidth\":0,\"tickcolor\":\"rgb(237,237,237)\",\"ticklen\":6,\"ticks\":\"inside\"}},\"type\":\"scattergl\"}],\"scattermapbox\":[{\"marker\":{\"colorbar\":{\"outlinewidth\":0,\"tickcolor\":\"rgb(237,237,237)\",\"ticklen\":6,\"ticks\":\"inside\"}},\"type\":\"scattermapbox\"}],\"scatterpolar\":[{\"marker\":{\"colorbar\":{\"outlinewidth\":0,\"tickcolor\":\"rgb(237,237,237)\",\"ticklen\":6,\"ticks\":\"inside\"}},\"type\":\"scatterpolar\"}],\"scatterpolargl\":[{\"marker\":{\"colorbar\":{\"outlinewidth\":0,\"tickcolor\":\"rgb(237,237,237)\",\"ticklen\":6,\"ticks\":\"inside\"}},\"type\":\"scatterpolargl\"}],\"scatterternary\":[{\"marker\":{\"colorbar\":{\"outlinewidth\":0,\"tickcolor\":\"rgb(237,237,237)\",\"ticklen\":6,\"ticks\":\"inside\"}},\"type\":\"scatterternary\"}],\"surface\":[{\"colorbar\":{\"outlinewidth\":0,\"tickcolor\":\"rgb(237,237,237)\",\"ticklen\":6,\"ticks\":\"inside\"},\"colorscale\":[[0,\"rgb(20,44,66)\"],[1,\"rgb(90,179,244)\"]],\"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\":0,\"tickcolor\":\"rgb(237,237,237)\",\"ticklen\":6,\"ticks\":\"inside\"}},\"colorscale\":{\"sequential\":[[0,\"rgb(20,44,66)\"],[1,\"rgb(90,179,244)\"]],\"sequentialminus\":[[0,\"rgb(20,44,66)\"],[1,\"rgb(90,179,244)\"]]},\"colorway\":[\"#F8766D\",\"#A3A500\",\"#00BF7D\",\"#00B0F6\",\"#E76BF3\"],\"font\":{\"color\":\"rgb(51,51,51)\"},\"geo\":{\"bgcolor\":\"white\",\"lakecolor\":\"white\",\"landcolor\":\"rgb(237,237,237)\",\"showlakes\":true,\"showland\":true,\"subunitcolor\":\"white\"},\"hoverlabel\":{\"align\":\"left\"},\"hovermode\":\"closest\",\"paper_bgcolor\":\"white\",\"plot_bgcolor\":\"rgb(237,237,237)\",\"polar\":{\"angularaxis\":{\"gridcolor\":\"white\",\"linecolor\":\"white\",\"showgrid\":true,\"tickcolor\":\"rgb(51,51,51)\",\"ticks\":\"outside\"},\"bgcolor\":\"rgb(237,237,237)\",\"radialaxis\":{\"gridcolor\":\"white\",\"linecolor\":\"white\",\"showgrid\":true,\"tickcolor\":\"rgb(51,51,51)\",\"ticks\":\"outside\"}},\"scene\":{\"xaxis\":{\"backgroundcolor\":\"rgb(237,237,237)\",\"gridcolor\":\"white\",\"gridwidth\":2,\"linecolor\":\"white\",\"showbackground\":true,\"showgrid\":true,\"tickcolor\":\"rgb(51,51,51)\",\"ticks\":\"outside\",\"zerolinecolor\":\"white\"},\"yaxis\":{\"backgroundcolor\":\"rgb(237,237,237)\",\"gridcolor\":\"white\",\"gridwidth\":2,\"linecolor\":\"white\",\"showbackground\":true,\"showgrid\":true,\"tickcolor\":\"rgb(51,51,51)\",\"ticks\":\"outside\",\"zerolinecolor\":\"white\"},\"zaxis\":{\"backgroundcolor\":\"rgb(237,237,237)\",\"gridcolor\":\"white\",\"gridwidth\":2,\"linecolor\":\"white\",\"showbackground\":true,\"showgrid\":true,\"tickcolor\":\"rgb(51,51,51)\",\"ticks\":\"outside\",\"zerolinecolor\":\"white\"}},\"shapedefaults\":{\"fillcolor\":\"black\",\"line\":{\"width\":0},\"opacity\":0.3},\"ternary\":{\"aaxis\":{\"gridcolor\":\"white\",\"linecolor\":\"white\",\"showgrid\":true,\"tickcolor\":\"rgb(51,51,51)\",\"ticks\":\"outside\"},\"baxis\":{\"gridcolor\":\"white\",\"linecolor\":\"white\",\"showgrid\":true,\"tickcolor\":\"rgb(51,51,51)\",\"ticks\":\"outside\"},\"bgcolor\":\"rgb(237,237,237)\",\"caxis\":{\"gridcolor\":\"white\",\"linecolor\":\"white\",\"showgrid\":true,\"tickcolor\":\"rgb(51,51,51)\",\"ticks\":\"outside\"}},\"xaxis\":{\"automargin\":true,\"gridcolor\":\"white\",\"linecolor\":\"white\",\"showgrid\":true,\"tickcolor\":\"rgb(51,51,51)\",\"ticks\":\"outside\",\"title\":{\"standoff\":15},\"zerolinecolor\":\"white\"},\"yaxis\":{\"automargin\":true,\"gridcolor\":\"white\",\"linecolor\":\"white\",\"showgrid\":true,\"tickcolor\":\"rgb(51,51,51)\",\"ticks\":\"outside\",\"title\":{\"standoff\":15},\"zerolinecolor\":\"white\"}}},\"title\":{\"text\":\"Actual vs. Forecast | Number of airline passengers\"},\"xaxis\":{\"title\":{\"text\":\"Time\"}},\"yaxis\":{\"title\":{\"text\":\"Values\"}}}, {\"responsive\": true} ).then(function(){\n",
" \n",
"var gd = document.getElementById('5f40444d-11e5-4249-a8ea-7188e08bc092');\n",
"var x = new MutationObserver(function (mutations, observer) {{\n",
" var display = window.getComputedStyle(gd).display;\n",
" if (!display || display === 'none') {{\n",
" console.log([gd, 'removed!']);\n",
" Plotly.purge(gd);\n",
" observer.disconnect();\n",
" }}\n",
"}});\n",
"\n",
"// Listen for the removal of the full notebook cells\n",
"var notebookContainer = gd.closest('#notebook-container');\n",
"if (notebookContainer) {{\n",
" x.observe(notebookContainer, {childList: true});\n",
"}}\n",
"\n",
"// Listen for the clearing of the current output cell\n",
"var outputEl = gd.closest('.output');\n",
"if (outputEl) {{\n",
" x.observe(outputEl, {childList: true});\n",
"}}\n",
"\n",
" }) }; </script> </div>\n",
"</body>\n",
"</html>"
]
},
"metadata": {}
}
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "dG_W70kz1jY3"
},
"source": [
"OK, captures seasonality but can we do better?\n",
"\n",
"Let's try a few more models to see..."
]
},
{
"cell_type": "code",
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/",
"height": 731,
"referenced_widgets": [
"ef752d6a71cd4bd8ba0950e770bf5723"
]
},
"id": "dmiO-rWu1eNk",
"outputId": "3e1273eb-677f-4137-8f4e-b191d9d8c68c"
},
"source": [
"#### Classical Statistical Model: ARIMA\n",
"model1 = exp.create_model(\"arima\")\n",
"exp.plot_model(model1)"
],
"execution_count": 6,
"outputs": [
{
"output_type": "display_data",
"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>cutoff</th>\n",
" <th>MAE</th>\n",
" <th>RMSE</th>\n",
" <th>MAPE</th>\n",
" <th>SMAPE</th>\n",
" <th>R2</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>0</th>\n",
" <td>1956-12</td>\n",
" <td>13.0286</td>\n",
" <td>16.1485</td>\n",
" <td>0.0327</td>\n",
" <td>0.0334</td>\n",
" <td>0.9151</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1</th>\n",
" <td>1957-12</td>\n",
" <td>18.2920</td>\n",
" <td>20.3442</td>\n",
" <td>0.0506</td>\n",
" <td>0.0491</td>\n",
" <td>0.8916</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2</th>\n",
" <td>1958-12</td>\n",
" <td>28.6999</td>\n",
" <td>30.1669</td>\n",
" <td>0.0671</td>\n",
" <td>0.0697</td>\n",
" <td>0.7964</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Mean</th>\n",
" <td>NaN</td>\n",
" <td>20.0069</td>\n",
" <td>22.2199</td>\n",
" <td>0.0501</td>\n",
" <td>0.0507</td>\n",
" <td>0.8677</td>\n",
" </tr>\n",
" <tr>\n",
" <th>SD</th>\n",
" <td>NaN</td>\n",
" <td>6.5117</td>\n",
" <td>5.8746</td>\n",
" <td>0.0141</td>\n",
" <td>0.0148</td>\n",
" <td>0.0513</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"text/plain": [
" cutoff MAE RMSE MAPE SMAPE R2\n",
"0 1956-12 13.0286 16.1485 0.0327 0.0334 0.9151\n",
"1 1957-12 18.2920 20.3442 0.0506 0.0491 0.8916\n",
"2 1958-12 28.6999 30.1669 0.0671 0.0697 0.7964\n",
"Mean NaN 20.0069 22.2199 0.0501 0.0507 0.8677\n",
"SD NaN 6.5117 5.8746 0.0141 0.0148 0.0513"
]
},
"metadata": {}
},
{
"output_type": "display_data",
"data": {
"text/html": [
"<html>\n",
"<head><meta charset=\"utf-8\" /></head>\n",
"<body>\n",
" <div> <script src=\"https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js?config=TeX-AMS-MML_SVG\"></script><script type=\"text/javascript\">if (window.MathJax) {MathJax.Hub.Config({SVG: {font: \"STIX-Web\"}});}</script> <script type=\"text/javascript\">window.PlotlyConfig = {MathJaxConfig: 'local'};</script>\n",
" <script src=\"https://cdn.plot.ly/plotly-2.4.2.min.js\"></script> <div id=\"1e393007-c0d3-4a05-b17c-bea6fa3b177a\" class=\"plotly-graph-div\" style=\"height:525px; width:100%;\"></div> <script type=\"text/javascript\"> window.PLOTLYENV=window.PLOTLYENV || {}; if (document.getElementById(\"1e393007-c0d3-4a05-b17c-bea6fa3b177a\")) { Plotly.newPlot( \"1e393007-c0d3-4a05-b17c-bea6fa3b177a\", [{\"line\":{\"width\":0},\"marker\":{\"color\":\"#68BBE3\"},\"mode\":\"lines\",\"name\":\"Lower Interval\",\"showlegend\":false,\"type\":\"scatter\",\"x\":[\"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\":[400.7032,371.1461,427.2937,411.599,431.3417,480.1001,553.6005,562.6548,465.1292,407.9258,361.9721,404.2133]},{\"fill\":\"tonexty\",\"fillcolor\":\"#68BBE3\",\"line\":{\"color\":\"#1f77b4\"},\"marker\":{\"size\":5},\"mode\":\"lines+markers\",\"name\":\"Forecast | ARIMA\",\"showlegend\":true,\"type\":\"scatter\",\"x\":[\"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\":[420.8767,397.1069,456.4335,442.6482,463.5822,513.0988,587.0872,596.458,499.1383,442.0694,396.2036,438.5023]},{\"fill\":\"tonexty\",\"fillcolor\":\"#68BBE3\",\"line\":{\"width\":0},\"marker\":{\"color\":\"#68BBE3\"},\"mode\":\"lines\",\"name\":\"Prediction Interval | ARIMA\",\"showlegend\":true,\"type\":\"scatter\",\"x\":[\"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\":[441.0501,423.0677,485.5734,473.6974,495.8226,546.0974,620.574,630.2611,533.1474,476.2129,430.4351,472.7914]},{\"marker\":{\"color\":\"#3f3f3f\",\"size\":5},\"mode\":\"lines+markers\",\"name\":\"Original\",\"showlegend\":true,\"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\",\"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\":[112.0,118.0,132.0,129.0,121.0,135.0,148.0,148.0,136.0,119.0,104.0,118.0,115.0,126.0,141.0,135.0,125.0,149.0,170.0,170.0,158.0,133.0,114.0,140.0,145.0,150.0,178.0,163.0,172.0,178.0,199.0,199.0,184.0,162.0,146.0,166.0,171.0,180.0,193.0,181.0,183.0,218.0,230.0,242.0,209.0,191.0,172.0,194.0,196.0,196.0,236.0,235.0,229.0,243.0,264.0,272.0,237.0,211.0,180.0,201.0,204.0,188.0,235.0,227.0,234.0,264.0,302.0,293.0,259.0,229.0,203.0,229.0,242.0,233.0,267.0,269.0,270.0,315.0,364.0,347.0,312.0,274.0,237.0,278.0,284.0,277.0,317.0,313.0,318.0,374.0,413.0,405.0,355.0,306.0,271.0,306.0,315.0,301.0,356.0,348.0,355.0,422.0,465.0,467.0,404.0,347.0,305.0,336.0,340.0,318.0,362.0,348.0,363.0,435.0,491.0,505.0,404.0,359.0,310.0,337.0,360.0,342.0,406.0,396.0,420.0,472.0,548.0,559.0,463.0,407.0,362.0,405.0,417.0,391.0,419.0,461.0,472.0,535.0,622.0,606.0,508.0,461.0,390.0,432.0]}], {\"showlegend\":true,\"template\":{\"data\":{\"bar\":[{\"error_x\":{\"color\":\"rgb(51,51,51)\"},\"error_y\":{\"color\":\"rgb(51,51,51)\"},\"marker\":{\"line\":{\"color\":\"rgb(237,237,237)\",\"width\":0.5},\"pattern\":{\"fillmode\":\"overlay\",\"size\":10,\"solidity\":0.2}},\"type\":\"bar\"}],\"barpolar\":[{\"marker\":{\"line\":{\"color\":\"rgb(237,237,237)\",\"width\":0.5},\"pattern\":{\"fillmode\":\"overlay\",\"size\":10,\"solidity\":0.2}},\"type\":\"barpolar\"}],\"carpet\":[{\"aaxis\":{\"endlinecolor\":\"rgb(51,51,51)\",\"gridcolor\":\"white\",\"linecolor\":\"white\",\"minorgridcolor\":\"white\",\"startlinecolor\":\"rgb(51,51,51)\"},\"baxis\":{\"endlinecolor\":\"rgb(51,51,51)\",\"gridcolor\":\"white\",\"linecolor\":\"white\",\"minorgridcolor\":\"white\",\"startlinecolor\":\"rgb(51,51,51)\"},\"type\":\"carpet\"}],\"choropleth\":[{\"colorbar\":{\"outlinewidth\":0,\"tickcolor\":\"rgb(237,237,237)\",\"ticklen\":6,\"ticks\":\"inside\"},\"type\":\"choropleth\"}],\"contour\":[{\"colorbar\":{\"outlinewidth\":0,\"tickcolor\":\"rgb(237,237,237)\",\"ticklen\":6,\"ticks\":\"inside\"},\"colorscale\":[[0,\"rgb(20,44,66)\"],[1,\"rgb(90,179,244)\"]],\"type\":\"contour\"}],\"contourcarpet\":[{\"colorbar\":{\"outlinewidth\":0,\"tickcolor\":\"rgb(237,237,237)\",\"ticklen\":6,\"ticks\":\"inside\"},\"type\":\"contourcarpet\"}],\"heatmap\":[{\"colorbar\":{\"outlinewidth\":0,\"tickcolor\":\"rgb(237,237,237)\",\"ticklen\":6,\"ticks\":\"inside\"},\"colorscale\":[[0,\"rgb(20,44,66)\"],[1,\"rgb(90,179,244)\"]],\"type\":\"heatmap\"}],\"heatmapgl\":[{\"colorbar\":{\"outlinewidth\":0,\"tickcolor\":\"rgb(237,237,237)\",\"ticklen\":6,\"ticks\":\"inside\"},\"colorscale\":[[0,\"rgb(20,44,66)\"],[1,\"rgb(90,179,244)\"]],\"type\":\"heatmapgl\"}],\"histogram\":[{\"marker\":{\"pattern\":{\"fillmode\":\"overlay\",\"size\":10,\"solidity\":0.2}},\"type\":\"histogram\"}],\"histogram2d\":[{\"colorbar\":{\"outlinewidth\":0,\"tickcolor\":\"rgb(237,237,237)\",\"ticklen\":6,\"ticks\":\"inside\"},\"colorscale\":[[0,\"rgb(20,44,66)\"],[1,\"rgb(90,179,244)\"]],\"type\":\"histogram2d\"}],\"histogram2dcontour\":[{\"colorbar\":{\"outlinewidth\":0,\"tickcolor\":\"rgb(237,237,237)\",\"ticklen\":6,\"ticks\":\"inside\"},\"colorscale\":[[0,\"rgb(20,44,66)\"],[1,\"rgb(90,179,244)\"]],\"type\":\"histogram2dcontour\"}],\"mesh3d\":[{\"colorbar\":{\"outlinewidth\":0,\"tickcolor\":\"rgb(237,237,237)\",\"ticklen\":6,\"ticks\":\"inside\"},\"type\":\"mesh3d\"}],\"parcoords\":[{\"line\":{\"colorbar\":{\"outlinewidth\":0,\"tickcolor\":\"rgb(237,237,237)\",\"ticklen\":6,\"ticks\":\"inside\"}},\"type\":\"parcoords\"}],\"pie\":[{\"automargin\":true,\"type\":\"pie\"}],\"scatter\":[{\"marker\":{\"colorbar\":{\"outlinewidth\":0,\"tickcolor\":\"rgb(237,237,237)\",\"ticklen\":6,\"ticks\":\"inside\"}},\"type\":\"scatter\"}],\"scatter3d\":[{\"line\":{\"colorbar\":{\"outlinewidth\":0,\"tickcolor\":\"rgb(237,237,237)\",\"ticklen\":6,\"ticks\":\"inside\"}},\"marker\":{\"colorbar\":{\"outlinewidth\":0,\"tickcolor\":\"rgb(237,237,237)\",\"ticklen\":6,\"ticks\":\"inside\"}},\"type\":\"scatter3d\"}],\"scattercarpet\":[{\"marker\":{\"colorbar\":{\"outlinewidth\":0,\"tickcolor\":\"rgb(237,237,237)\",\"ticklen\":6,\"ticks\":\"inside\"}},\"type\":\"scattercarpet\"}],\"scattergeo\":[{\"marker\":{\"colorbar\":{\"outlinewidth\":0,\"tickcolor\":\"rgb(237,237,237)\",\"ticklen\":6,\"ticks\":\"inside\"}},\"type\":\"scattergeo\"}],\"scattergl\":[{\"marker\":{\"colorbar\":{\"outlinewidth\":0,\"tickcolor\":\"rgb(237,237,237)\",\"ticklen\":6,\"ticks\":\"inside\"}},\"type\":\"scattergl\"}],\"scattermapbox\":[{\"marker\":{\"colorbar\":{\"outlinewidth\":0,\"tickcolor\":\"rgb(237,237,237)\",\"ticklen\":6,\"ticks\":\"inside\"}},\"type\":\"scattermapbox\"}],\"scatterpolar\":[{\"marker\":{\"colorbar\":{\"outlinewidth\":0,\"tickcolor\":\"rgb(237,237,237)\",\"ticklen\":6,\"ticks\":\"inside\"}},\"type\":\"scatterpolar\"}],\"scatterpolargl\":[{\"marker\":{\"colorbar\":{\"outlinewidth\":0,\"tickcolor\":\"rgb(237,237,237)\",\"ticklen\":6,\"ticks\":\"inside\"}},\"type\":\"scatterpolargl\"}],\"scatterternary\":[{\"marker\":{\"colorbar\":{\"outlinewidth\":0,\"tickcolor\":\"rgb(237,237,237)\",\"ticklen\":6,\"ticks\":\"inside\"}},\"type\":\"scatterternary\"}],\"surface\":[{\"colorbar\":{\"outlinewidth\":0,\"tickcolor\":\"rgb(237,237,237)\",\"ticklen\":6,\"ticks\":\"inside\"},\"colorscale\":[[0,\"rgb(20,44,66)\"],[1,\"rgb(90,179,244)\"]],\"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\":0,\"tickcolor\":\"rgb(237,237,237)\",\"ticklen\":6,\"ticks\":\"inside\"}},\"colorscale\":{\"sequential\":[[0,\"rgb(20,44,66)\"],[1,\"rgb(90,179,244)\"]],\"sequentialminus\":[[0,\"rgb(20,44,66)\"],[1,\"rgb(90,179,244)\"]]},\"colorway\":[\"#F8766D\",\"#A3A500\",\"#00BF7D\",\"#00B0F6\",\"#E76BF3\"],\"font\":{\"color\":\"rgb(51,51,51)\"},\"geo\":{\"bgcolor\":\"white\",\"lakecolor\":\"white\",\"landcolor\":\"rgb(237,237,237)\",\"showlakes\":true,\"showland\":true,\"subunitcolor\":\"white\"},\"hoverlabel\":{\"align\":\"left\"},\"hovermode\":\"closest\",\"paper_bgcolor\":\"white\",\"plot_bgcolor\":\"rgb(237,237,237)\",\"polar\":{\"angularaxis\":{\"gridcolor\":\"white\",\"linecolor\":\"white\",\"showgrid\":true,\"tickcolor\":\"rgb(51,51,51)\",\"ticks\":\"outside\"},\"bgcolor\":\"rgb(237,237,237)\",\"radialaxis\":{\"gridcolor\":\"white\",\"linecolor\":\"white\",\"showgrid\":true,\"tickcolor\":\"rgb(51,51,51)\",\"ticks\":\"outside\"}},\"scene\":{\"xaxis\":{\"backgroundcolor\":\"rgb(237,237,237)\",\"gridcolor\":\"white\",\"gridwidth\":2,\"linecolor\":\"white\",\"showbackground\":true,\"showgrid\":true,\"tickcolor\":\"rgb(51,51,51)\",\"ticks\":\"outside\",\"zerolinecolor\":\"white\"},\"yaxis\":{\"backgroundcolor\":\"rgb(237,237,237)\",\"gridcolor\":\"white\",\"gridwidth\":2,\"linecolor\":\"white\",\"showbackground\":true,\"showgrid\":true,\"tickcolor\":\"rgb(51,51,51)\",\"ticks\":\"outside\",\"zerolinecolor\":\"white\"},\"zaxis\":{\"backgroundcolor\":\"rgb(237,237,237)\",\"gridcolor\":\"white\",\"gridwidth\":2,\"linecolor\":\"white\",\"showbackground\":true,\"showgrid\":true,\"tickcolor\":\"rgb(51,51,51)\",\"ticks\":\"outside\",\"zerolinecolor\":\"white\"}},\"shapedefaults\":{\"fillcolor\":\"black\",\"line\":{\"width\":0},\"opacity\":0.3},\"ternary\":{\"aaxis\":{\"gridcolor\":\"white\",\"linecolor\":\"white\",\"showgrid\":true,\"tickcolor\":\"rgb(51,51,51)\",\"ticks\":\"outside\"},\"baxis\":{\"gridcolor\":\"white\",\"linecolor\":\"white\",\"showgrid\":true,\"tickcolor\":\"rgb(51,51,51)\",\"ticks\":\"outside\"},\"bgcolor\":\"rgb(237,237,237)\",\"caxis\":{\"gridcolor\":\"white\",\"linecolor\":\"white\",\"showgrid\":true,\"tickcolor\":\"rgb(51,51,51)\",\"ticks\":\"outside\"}},\"xaxis\":{\"automargin\":true,\"gridcolor\":\"white\",\"linecolor\":\"white\",\"showgrid\":true,\"tickcolor\":\"rgb(51,51,51)\",\"ticks\":\"outside\",\"title\":{\"standoff\":15},\"zerolinecolor\":\"white\"},\"yaxis\":{\"automargin\":true,\"gridcolor\":\"white\",\"linecolor\":\"white\",\"showgrid\":true,\"tickcolor\":\"rgb(51,51,51)\",\"ticks\":\"outside\",\"title\":{\"standoff\":15},\"zerolinecolor\":\"white\"}}},\"title\":{\"text\":\"Actual vs. Forecast | Number of airline passengers\"},\"xaxis\":{\"title\":{\"text\":\"Time\"}},\"yaxis\":{\"title\":{\"text\":\"Values\"}}}, {\"responsive\": true} ).then(function(){\n",
" \n",
"var gd = document.getElementById('1e393007-c0d3-4a05-b17c-bea6fa3b177a');\n",
"var x = new MutationObserver(function (mutations, observer) {{\n",
" var display = window.getComputedStyle(gd).display;\n",
" if (!display || display === 'none') {{\n",
" console.log([gd, 'removed!']);\n",
" Plotly.purge(gd);\n",
" observer.disconnect();\n",
" }}\n",
"}});\n",
"\n",
"// Listen for the removal of the full notebook cells\n",
"var notebookContainer = gd.closest('#notebook-container');\n",
"if (notebookContainer) {{\n",
" x.observe(notebookContainer, {childList: true});\n",
"}}\n",
"\n",
"// Listen for the clearing of the current output cell\n",
"var outputEl = gd.closest('.output');\n",
"if (outputEl) {{\n",
" x.observe(outputEl, {childList: true});\n",
"}}\n",
"\n",
" }) }; </script> </div>\n",
"</body>\n",
"</html>"
]
},
"metadata": {}
}
]
},
{
"cell_type": "code",
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/",
"height": 731,
"referenced_widgets": [
"c01ad049d702434e8570f1a462ec4488",
"1e18f7b1179a4ddb8489f6a335fbba4e",
"4ca3159c343c4fd29af435dcac3c23d4"
]
},
"id": "ahb0QcUb1z5a",
"outputId": "86172618-4c5c-46e4-d639-4050c8190428"
},
"source": [
"#### Classical Statistical Model: ETS\n",
"model2 = exp.create_model(\"ets\")\n",
"exp.plot_model(model2)"
],
"execution_count": 7,
"outputs": [
{
"output_type": "display_data",
"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>cutoff</th>\n",
" <th>MAE</th>\n",
" <th>RMSE</th>\n",
" <th>MAPE</th>\n",
" <th>SMAPE</th>\n",
" <th>R2</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>0</th>\n",
" <td>1956-12</td>\n",
" <td>14.5727</td>\n",
" <td>18.7858</td>\n",
" <td>0.0367</td>\n",
" <td>0.0377</td>\n",
" <td>0.8851</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1</th>\n",
" <td>1957-12</td>\n",
" <td>16.7941</td>\n",
" <td>19.3204</td>\n",
" <td>0.0458</td>\n",
" <td>0.0446</td>\n",
" <td>0.9022</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2</th>\n",
" <td>1958-12</td>\n",
" <td>20.8905</td>\n",
" <td>23.4314</td>\n",
" <td>0.0495</td>\n",
" <td>0.0512</td>\n",
" <td>0.8772</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Mean</th>\n",
" <td>NaN</td>\n",
" <td>17.4191</td>\n",
" <td>20.5125</td>\n",
" <td>0.0440</td>\n",
" <td>0.0445</td>\n",
" <td>0.8882</td>\n",
" </tr>\n",
" <tr>\n",
" <th>SD</th>\n",
" <td>NaN</td>\n",
" <td>2.6168</td>\n",
" <td>2.0755</td>\n",
" <td>0.0054</td>\n",
" <td>0.0055</td>\n",
" <td>0.0104</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"text/plain": [
" cutoff MAE RMSE MAPE SMAPE R2\n",
"0 1956-12 14.5727 18.7858 0.0367 0.0377 0.8851\n",
"1 1957-12 16.7941 19.3204 0.0458 0.0446 0.9022\n",
"2 1958-12 20.8905 23.4314 0.0495 0.0512 0.8772\n",
"Mean NaN 17.4191 20.5125 0.0440 0.0445 0.8882\n",
"SD NaN 2.6168 2.0755 0.0054 0.0055 0.0104"
]
},
"metadata": {}
},
{
"output_type": "display_data",
"data": {
"text/html": [
"<html>\n",
"<head><meta charset=\"utf-8\" /></head>\n",
"<body>\n",
" <div> <script src=\"https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js?config=TeX-AMS-MML_SVG\"></script><script type=\"text/javascript\">if (window.MathJax) {MathJax.Hub.Config({SVG: {font: \"STIX-Web\"}});}</script> <script type=\"text/javascript\">window.PlotlyConfig = {MathJaxConfig: 'local'};</script>\n",
" <script src=\"https://cdn.plot.ly/plotly-2.4.2.min.js\"></script> <div id=\"7917ba3c-df5c-4bf4-a52b-67526482dd93\" class=\"plotly-graph-div\" style=\"height:525px; width:100%;\"></div> <script type=\"text/javascript\"> window.PLOTLYENV=window.PLOTLYENV || {}; if (document.getElementById(\"7917ba3c-df5c-4bf4-a52b-67526482dd93\")) { Plotly.newPlot( \"7917ba3c-df5c-4bf4-a52b-67526482dd93\", [{\"line\":{\"width\":0},\"marker\":{\"color\":\"#68BBE3\"},\"mode\":\"lines\",\"name\":\"Lower Interval\",\"showlegend\":false,\"type\":\"scatter\",\"x\":[\"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\":[399.1724,374.2371,441.7475,424.885,445.9866,512.4318,593.5584,597.6323,487.5193,423.1288,368.6979,405.3603]},{\"fill\":\"tonexty\",\"fillcolor\":\"#68BBE3\",\"line\":{\"color\":\"#1f77b4\"},\"marker\":{\"size\":5},\"mode\":\"lines+markers\",\"name\":\"Forecast | ETS\",\"showlegend\":true,\"type\":\"scatter\",\"x\":[\"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\":[417.2265,394.0018,462.2049,448.3367,471.6366,539.3359,623.561,630.7469,515.2,449.7405,394.1071,433.6767]},{\"fill\":\"tonexty\",\"fillcolor\":\"#68BBE3\",\"line\":{\"width\":0},\"marker\":{\"color\":\"#68BBE3\"},\"mode\":\"lines\",\"name\":\"Prediction Interval | ETS\",\"showlegend\":true,\"type\":\"scatter\",\"x\":[\"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\":[435.9598,415.3192,484.8106,472.5015,495.2967,565.8552,652.9493,664.4028,545.2246,475.8882,419.5679,461.5141]},{\"marker\":{\"color\":\"#3f3f3f\",\"size\":5},\"mode\":\"lines+markers\",\"name\":\"Original\",\"showlegend\":true,\"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\",\"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\":[112.0,118.0,132.0,129.0,121.0,135.0,148.0,148.0,136.0,119.0,104.0,118.0,115.0,126.0,141.0,135.0,125.0,149.0,170.0,170.0,158.0,133.0,114.0,140.0,145.0,150.0,178.0,163.0,172.0,178.0,199.0,199.0,184.0,162.0,146.0,166.0,171.0,180.0,193.0,181.0,183.0,218.0,230.0,242.0,209.0,191.0,172.0,194.0,196.0,196.0,236.0,235.0,229.0,243.0,264.0,272.0,237.0,211.0,180.0,201.0,204.0,188.0,235.0,227.0,234.0,264.0,302.0,293.0,259.0,229.0,203.0,229.0,242.0,233.0,267.0,269.0,270.0,315.0,364.0,347.0,312.0,274.0,237.0,278.0,284.0,277.0,317.0,313.0,318.0,374.0,413.0,405.0,355.0,306.0,271.0,306.0,315.0,301.0,356.0,348.0,355.0,422.0,465.0,467.0,404.0,347.0,305.0,336.0,340.0,318.0,362.0,348.0,363.0,435.0,491.0,505.0,404.0,359.0,310.0,337.0,360.0,342.0,406.0,396.0,420.0,472.0,548.0,559.0,463.0,407.0,362.0,405.0,417.0,391.0,419.0,461.0,472.0,535.0,622.0,606.0,508.0,461.0,390.0,432.0]}], {\"showlegend\":true,\"template\":{\"data\":{\"bar\":[{\"error_x\":{\"color\":\"rgb(51,51,51)\"},\"error_y\":{\"color\":\"rgb(51,51,51)\"},\"marker\":{\"line\":{\"color\":\"rgb(237,237,237)\",\"width\":0.5},\"pattern\":{\"fillmode\":\"overlay\",\"size\":10,\"solidity\":0.2}},\"type\":\"bar\"}],\"barpolar\":[{\"marker\":{\"line\":{\"color\":\"rgb(237,237,237)\",\"width\":0.5},\"pattern\":{\"fillmode\":\"overlay\",\"size\":10,\"solidity\":0.2}},\"type\":\"barpolar\"}],\"carpet\":[{\"aaxis\":{\"endlinecolor\":\"rgb(51,51,51)\",\"gridcolor\":\"white\",\"linecolor\":\"white\",\"minorgridcolor\":\"white\",\"startlinecolor\":\"rgb(51,51,51)\"},\"baxis\":{\"endlinecolor\":\"rgb(51,51,51)\",\"gridcolor\":\"white\",\"linecolor\":\"white\",\"minorgridcolor\":\"white\",\"startlinecolor\":\"rgb(51,51,51)\"},\"type\":\"carpet\"}],\"choropleth\":[{\"colorbar\":{\"outlinewidth\":0,\"tickcolor\":\"rgb(237,237,237)\",\"ticklen\":6,\"ticks\":\"inside\"},\"type\":\"choropleth\"}],\"contour\":[{\"colorbar\":{\"outlinewidth\":0,\"tickcolor\":\"rgb(237,237,237)\",\"ticklen\":6,\"ticks\":\"inside\"},\"colorscale\":[[0,\"rgb(20,44,66)\"],[1,\"rgb(90,179,244)\"]],\"type\":\"contour\"}],\"contourcarpet\":[{\"colorbar\":{\"outlinewidth\":0,\"tickcolor\":\"rgb(237,237,237)\",\"ticklen\":6,\"ticks\":\"inside\"},\"type\":\"contourcarpet\"}],\"heatmap\":[{\"colorbar\":{\"outlinewidth\":0,\"tickcolor\":\"rgb(237,237,237)\",\"ticklen\":6,\"ticks\":\"inside\"},\"colorscale\":[[0,\"rgb(20,44,66)\"],[1,\"rgb(90,179,244)\"]],\"type\":\"heatmap\"}],\"heatmapgl\":[{\"colorbar\":{\"outlinewidth\":0,\"tickcolor\":\"rgb(237,237,237)\",\"ticklen\":6,\"ticks\":\"inside\"},\"colorscale\":[[0,\"rgb(20,44,66)\"],[1,\"rgb(90,179,244)\"]],\"type\":\"heatmapgl\"}],\"histogram\":[{\"marker\":{\"pattern\":{\"fillmode\":\"overlay\",\"size\":10,\"solidity\":0.2}},\"type\":\"histogram\"}],\"histogram2d\":[{\"colorbar\":{\"outlinewidth\":0,\"tickcolor\":\"rgb(237,237,237)\",\"ticklen\":6,\"ticks\":\"inside\"},\"colorscale\":[[0,\"rgb(20,44,66)\"],[1,\"rgb(90,179,244)\"]],\"type\":\"histogram2d\"}],\"histogram2dcontour\":[{\"colorbar\":{\"outlinewidth\":0,\"tickcolor\":\"rgb(237,237,237)\",\"ticklen\":6,\"ticks\":\"inside\"},\"colorscale\":[[0,\"rgb(20,44,66)\"],[1,\"rgb(90,179,244)\"]],\"type\":\"histogram2dcontour\"}],\"mesh3d\":[{\"colorbar\":{\"outlinewidth\":0,\"tickcolor\":\"rgb(237,237,237)\",\"ticklen\":6,\"ticks\":\"inside\"},\"type\":\"mesh3d\"}],\"parcoords\":[{\"line\":{\"colorbar\":{\"outlinewidth\":0,\"tickcolor\":\"rgb(237,237,237)\",\"ticklen\":6,\"ticks\":\"inside\"}},\"type\":\"parcoords\"}],\"pie\":[{\"automargin\":true,\"type\":\"pie\"}],\"scatter\":[{\"marker\":{\"colorbar\":{\"outlinewidth\":0,\"tickcolor\":\"rgb(237,237,237)\",\"ticklen\":6,\"ticks\":\"inside\"}},\"type\":\"scatter\"}],\"scatter3d\":[{\"line\":{\"colorbar\":{\"outlinewidth\":0,\"tickcolor\":\"rgb(237,237,237)\",\"ticklen\":6,\"ticks\":\"inside\"}},\"marker\":{\"colorbar\":{\"outlinewidth\":0,\"tickcolor\":\"rgb(237,237,237)\",\"ticklen\":6,\"ticks\":\"inside\"}},\"type\":\"scatter3d\"}],\"scattercarpet\":[{\"marker\":{\"colorbar\":{\"outlinewidth\":0,\"tickcolor\":\"rgb(237,237,237)\",\"ticklen\":6,\"ticks\":\"inside\"}},\"type\":\"scattercarpet\"}],\"scattergeo\":[{\"marker\":{\"colorbar\":{\"outlinewidth\":0,\"tickcolor\":\"rgb(237,237,237)\",\"ticklen\":6,\"ticks\":\"inside\"}},\"type\":\"scattergeo\"}],\"scattergl\":[{\"marker\":{\"colorbar\":{\"outlinewidth\":0,\"tickcolor\":\"rgb(237,237,237)\",\"ticklen\":6,\"ticks\":\"inside\"}},\"type\":\"scattergl\"}],\"scattermapbox\":[{\"marker\":{\"colorbar\":{\"outlinewidth\":0,\"tickcolor\":\"rgb(237,237,237)\",\"ticklen\":6,\"ticks\":\"inside\"}},\"type\":\"scattermapbox\"}],\"scatterpolar\":[{\"marker\":{\"colorbar\":{\"outlinewidth\":0,\"tickcolor\":\"rgb(237,237,237)\",\"ticklen\":6,\"ticks\":\"inside\"}},\"type\":\"scatterpolar\"}],\"scatterpolargl\":[{\"marker\":{\"colorbar\":{\"outlinewidth\":0,\"tickcolor\":\"rgb(237,237,237)\",\"ticklen\":6,\"ticks\":\"inside\"}},\"type\":\"scatterpolargl\"}],\"scatterternary\":[{\"marker\":{\"colorbar\":{\"outlinewidth\":0,\"tickcolor\":\"rgb(237,237,237)\",\"ticklen\":6,\"ticks\":\"inside\"}},\"type\":\"scatterternary\"}],\"surface\":[{\"colorbar\":{\"outlinewidth\":0,\"tickcolor\":\"rgb(237,237,237)\",\"ticklen\":6,\"ticks\":\"inside\"},\"colorscale\":[[0,\"rgb(20,44,66)\"],[1,\"rgb(90,179,244)\"]],\"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\":0,\"tickcolor\":\"rgb(237,237,237)\",\"ticklen\":6,\"ticks\":\"inside\"}},\"colorscale\":{\"sequential\":[[0,\"rgb(20,44,66)\"],[1,\"rgb(90,179,244)\"]],\"sequentialminus\":[[0,\"rgb(20,44,66)\"],[1,\"rgb(90,179,244)\"]]},\"colorway\":[\"#F8766D\",\"#A3A500\",\"#00BF7D\",\"#00B0F6\",\"#E76BF3\"],\"font\":{\"color\":\"rgb(51,51,51)\"},\"geo\":{\"bgcolor\":\"white\",\"lakecolor\":\"white\",\"landcolor\":\"rgb(237,237,237)\",\"showlakes\":true,\"showland\":true,\"subunitcolor\":\"white\"},\"hoverlabel\":{\"align\":\"left\"},\"hovermode\":\"closest\",\"paper_bgcolor\":\"white\",\"plot_bgcolor\":\"rgb(237,237,237)\",\"polar\":{\"angularaxis\":{\"gridcolor\":\"white\",\"linecolor\":\"white\",\"showgrid\":true,\"tickcolor\":\"rgb(51,51,51)\",\"ticks\":\"outside\"},\"bgcolor\":\"rgb(237,237,237)\",\"radialaxis\":{\"gridcolor\":\"white\",\"linecolor\":\"white\",\"showgrid\":true,\"tickcolor\":\"rgb(51,51,51)\",\"ticks\":\"outside\"}},\"scene\":{\"xaxis\":{\"backgroundcolor\":\"rgb(237,237,237)\",\"gridcolor\":\"white\",\"gridwidth\":2,\"linecolor\":\"white\",\"showbackground\":true,\"showgrid\":true,\"tickcolor\":\"rgb(51,51,51)\",\"ticks\":\"outside\",\"zerolinecolor\":\"white\"},\"yaxis\":{\"backgroundcolor\":\"rgb(237,237,237)\",\"gridcolor\":\"white\",\"gridwidth\":2,\"linecolor\":\"white\",\"showbackground\":true,\"showgrid\":true,\"tickcolor\":\"rgb(51,51,51)\",\"ticks\":\"outside\",\"zerolinecolor\":\"white\"},\"zaxis\":{\"backgroundcolor\":\"rgb(237,237,237)\",\"gridcolor\":\"white\",\"gridwidth\":2,\"linecolor\":\"white\",\"showbackground\":true,\"showgrid\":true,\"tickcolor\":\"rgb(51,51,51)\",\"ticks\":\"outside\",\"zerolinecolor\":\"white\"}},\"shapedefaults\":{\"fillcolor\":\"black\",\"line\":{\"width\":0},\"opacity\":0.3},\"ternary\":{\"aaxis\":{\"gridcolor\":\"white\",\"linecolor\":\"white\",\"showgrid\":true,\"tickcolor\":\"rgb(51,51,51)\",\"ticks\":\"outside\"},\"baxis\":{\"gridcolor\":\"white\",\"linecolor\":\"white\",\"showgrid\":true,\"tickcolor\":\"rgb(51,51,51)\",\"ticks\":\"outside\"},\"bgcolor\":\"rgb(237,237,237)\",\"caxis\":{\"gridcolor\":\"white\",\"linecolor\":\"white\",\"showgrid\":true,\"tickcolor\":\"rgb(51,51,51)\",\"ticks\":\"outside\"}},\"xaxis\":{\"automargin\":true,\"gridcolor\":\"white\",\"linecolor\":\"white\",\"showgrid\":true,\"tickcolor\":\"rgb(51,51,51)\",\"ticks\":\"outside\",\"title\":{\"standoff\":15},\"zerolinecolor\":\"white\"},\"yaxis\":{\"automargin\":true,\"gridcolor\":\"white\",\"linecolor\":\"white\",\"showgrid\":true,\"tickcolor\":\"rgb(51,51,51)\",\"ticks\":\"outside\",\"title\":{\"standoff\":15},\"zerolinecolor\":\"white\"}}},\"title\":{\"text\":\"Actual vs. Forecast | Number of airline passengers\"},\"xaxis\":{\"title\":{\"text\":\"Time\"}},\"yaxis\":{\"title\":{\"text\":\"Values\"}}}, {\"responsive\": true} ).then(function(){\n",
" \n",
"var gd = document.getElementById('7917ba3c-df5c-4bf4-a52b-67526482dd93');\n",
"var x = new MutationObserver(function (mutations, observer) {{\n",
" var display = window.getComputedStyle(gd).display;\n",
" if (!display || display === 'none') {{\n",
" console.log([gd, 'removed!']);\n",
" Plotly.purge(gd);\n",
" observer.disconnect();\n",
" }}\n",
"}});\n",
"\n",
"// Listen for the removal of the full notebook cells\n",
"var notebookContainer = gd.closest('#notebook-container');\n",
"if (notebookContainer) {{\n",
" x.observe(notebookContainer, {childList: true});\n",
"}}\n",
"\n",
"// Listen for the clearing of the current output cell\n",
"var outputEl = gd.closest('.output');\n",
"if (outputEl) {{\n",
" x.observe(outputEl, {childList: true});\n",
"}}\n",
"\n",
" }) }; </script> </div>\n",
"</body>\n",
"</html>"
]
},
"metadata": {}
}
]
},
{
"cell_type": "code",
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/",
"height": 731
},
"id": "IKDmYmDX16na",
"outputId": "d7bcd405-17ad-4444-867c-e908ec603438"
},
"source": [
"#### Regression Based Model with Lags: lightgbm\n",
"model3 = exp.create_model(\"lightgbm_cds_dt\")\n",
"exp.plot_model(model3)"
],
"execution_count": 8,
"outputs": [
{
"output_type": "display_data",
"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>cutoff</th>\n",
" <th>MAE</th>\n",
" <th>RMSE</th>\n",
" <th>MAPE</th>\n",
" <th>SMAPE</th>\n",
" <th>R2</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>0</th>\n",
" <td>1956-12</td>\n",
" <td>36.4896</td>\n",
" <td>43.0267</td>\n",
" <td>0.0939</td>\n",
" <td>0.0986</td>\n",
" <td>0.3974</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1</th>\n",
" <td>1957-12</td>\n",
" <td>25.4164</td>\n",
" <td>30.6510</td>\n",
" <td>0.0641</td>\n",
" <td>0.0642</td>\n",
" <td>0.7539</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2</th>\n",
" <td>1958-12</td>\n",
" <td>24.4155</td>\n",
" <td>35.0399</td>\n",
" <td>0.0514</td>\n",
" <td>0.0539</td>\n",
" <td>0.7253</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Mean</th>\n",
" <td>NaN</td>\n",
" <td>28.7738</td>\n",
" <td>36.2392</td>\n",
" <td>0.0698</td>\n",
" <td>0.0722</td>\n",
" <td>0.6255</td>\n",
" </tr>\n",
" <tr>\n",
" <th>SD</th>\n",
" <td>NaN</td>\n",
" <td>5.4712</td>\n",
" <td>5.1231</td>\n",
" <td>0.0178</td>\n",
" <td>0.0191</td>\n",
" <td>0.1617</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"text/plain": [
" cutoff MAE RMSE MAPE SMAPE R2\n",
"0 1956-12 36.4896 43.0267 0.0939 0.0986 0.3974\n",
"1 1957-12 25.4164 30.6510 0.0641 0.0642 0.7539\n",
"2 1958-12 24.4155 35.0399 0.0514 0.0539 0.7253\n",
"Mean NaN 28.7738 36.2392 0.0698 0.0722 0.6255\n",
"SD NaN 5.4712 5.1231 0.0178 0.0191 0.1617"
]
},
"metadata": {}
},
{
"output_type": "display_data",
"data": {
"text/html": [
"<html>\n",
"<head><meta charset=\"utf-8\" /></head>\n",
"<body>\n",
" <div> <script src=\"https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js?config=TeX-AMS-MML_SVG\"></script><script type=\"text/javascript\">if (window.MathJax) {MathJax.Hub.Config({SVG: {font: \"STIX-Web\"}});}</script> <script type=\"text/javascript\">window.PlotlyConfig = {MathJaxConfig: 'local'};</script>\n",
" <script src=\"https://cdn.plot.ly/plotly-2.4.2.min.js\"></script> <div id=\"cdc1b0c9-88c4-45ef-87f6-9ba75bb6ba24\" class=\"plotly-graph-div\" style=\"height:525px; width:100%;\"></div> <script type=\"text/javascript\"> window.PLOTLYENV=window.PLOTLYENV || {}; if (document.getElementById(\"cdc1b0c9-88c4-45ef-87f6-9ba75bb6ba24\")) { Plotly.newPlot( \"cdc1b0c9-88c4-45ef-87f6-9ba75bb6ba24\", [{\"line\":{\"color\":\"#1f77b4\"},\"marker\":{\"size\":5},\"mode\":\"lines+markers\",\"name\":\"Forecast | LGBMRegressor\",\"showlegend\":true,\"type\":\"scatter\",\"x\":[\"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\":[396.5473,416.8324,423.9737,419.7766,438.9223,476.8667,533.7231,509.0046,459.614,420.1482,394.9577,432.815]},{\"marker\":{\"color\":\"#3f3f3f\",\"size\":5},\"mode\":\"lines+markers\",\"name\":\"Original\",\"showlegend\":true,\"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\",\"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\":[112.0,118.0,132.0,129.0,121.0,135.0,148.0,148.0,136.0,119.0,104.0,118.0,115.0,126.0,141.0,135.0,125.0,149.0,170.0,170.0,158.0,133.0,114.0,140.0,145.0,150.0,178.0,163.0,172.0,178.0,199.0,199.0,184.0,162.0,146.0,166.0,171.0,180.0,193.0,181.0,183.0,218.0,230.0,242.0,209.0,191.0,172.0,194.0,196.0,196.0,236.0,235.0,229.0,243.0,264.0,272.0,237.0,211.0,180.0,201.0,204.0,188.0,235.0,227.0,234.0,264.0,302.0,293.0,259.0,229.0,203.0,229.0,242.0,233.0,267.0,269.0,270.0,315.0,364.0,347.0,312.0,274.0,237.0,278.0,284.0,277.0,317.0,313.0,318.0,374.0,413.0,405.0,355.0,306.0,271.0,306.0,315.0,301.0,356.0,348.0,355.0,422.0,465.0,467.0,404.0,347.0,305.0,336.0,340.0,318.0,362.0,348.0,363.0,435.0,491.0,505.0,404.0,359.0,310.0,337.0,360.0,342.0,406.0,396.0,420.0,472.0,548.0,559.0,463.0,407.0,362.0,405.0,417.0,391.0,419.0,461.0,472.0,535.0,622.0,606.0,508.0,461.0,390.0,432.0]}], {\"showlegend\":true,\"template\":{\"data\":{\"bar\":[{\"error_x\":{\"color\":\"rgb(51,51,51)\"},\"error_y\":{\"color\":\"rgb(51,51,51)\"},\"marker\":{\"line\":{\"color\":\"rgb(237,237,237)\",\"width\":0.5},\"pattern\":{\"fillmode\":\"overlay\",\"size\":10,\"solidity\":0.2}},\"type\":\"bar\"}],\"barpolar\":[{\"marker\":{\"line\":{\"color\":\"rgb(237,237,237)\",\"width\":0.5},\"pattern\":{\"fillmode\":\"overlay\",\"size\":10,\"solidity\":0.2}},\"type\":\"barpolar\"}],\"carpet\":[{\"aaxis\":{\"endlinecolor\":\"rgb(51,51,51)\",\"gridcolor\":\"white\",\"linecolor\":\"white\",\"minorgridcolor\":\"white\",\"startlinecolor\":\"rgb(51,51,51)\"},\"baxis\":{\"endlinecolor\":\"rgb(51,51,51)\",\"gridcolor\":\"white\",\"linecolor\":\"white\",\"minorgridcolor\":\"white\",\"startlinecolor\":\"rgb(51,51,51)\"},\"type\":\"carpet\"}],\"choropleth\":[{\"colorbar\":{\"outlinewidth\":0,\"tickcolor\":\"rgb(237,237,237)\",\"ticklen\":6,\"ticks\":\"inside\"},\"type\":\"choropleth\"}],\"contour\":[{\"colorbar\":{\"outlinewidth\":0,\"tickcolor\":\"rgb(237,237,237)\",\"ticklen\":6,\"ticks\":\"inside\"},\"colorscale\":[[0,\"rgb(20,44,66)\"],[1,\"rgb(90,179,244)\"]],\"type\":\"contour\"}],\"contourcarpet\":[{\"colorbar\":{\"outlinewidth\":0,\"tickcolor\":\"rgb(237,237,237)\",\"ticklen\":6,\"ticks\":\"inside\"},\"type\":\"contourcarpet\"}],\"heatmap\":[{\"colorbar\":{\"outlinewidth\":0,\"tickcolor\":\"rgb(237,237,237)\",\"ticklen\":6,\"ticks\":\"inside\"},\"colorscale\":[[0,\"rgb(20,44,66)\"],[1,\"rgb(90,179,244)\"]],\"type\":\"heatmap\"}],\"heatmapgl\":[{\"colorbar\":{\"outlinewidth\":0,\"tickcolor\":\"rgb(237,237,237)\",\"ticklen\":6,\"ticks\":\"inside\"},\"colorscale\":[[0,\"rgb(20,44,66)\"],[1,\"rgb(90,179,244)\"]],\"type\":\"heatmapgl\"}],\"histogram\":[{\"marker\":{\"pattern\":{\"fillmode\":\"overlay\",\"size\":10,\"solidity\":0.2}},\"type\":\"histogram\"}],\"histogram2d\":[{\"colorbar\":{\"outlinewidth\":0,\"tickcolor\":\"rgb(237,237,237)\",\"ticklen\":6,\"ticks\":\"inside\"},\"colorscale\":[[0,\"rgb(20,44,66)\"],[1,\"rgb(90,179,244)\"]],\"type\":\"histogram2d\"}],\"histogram2dcontour\":[{\"colorbar\":{\"outlinewidth\":0,\"tickcolor\":\"rgb(237,237,237)\",\"ticklen\":6,\"ticks\":\"inside\"},\"colorscale\":[[0,\"rgb(20,44,66)\"],[1,\"rgb(90,179,244)\"]],\"type\":\"histogram2dcontour\"}],\"mesh3d\":[{\"colorbar\":{\"outlinewidth\":0,\"tickcolor\":\"rgb(237,237,237)\",\"ticklen\":6,\"ticks\":\"inside\"},\"type\":\"mesh3d\"}],\"parcoords\":[{\"line\":{\"colorbar\":{\"outlinewidth\":0,\"tickcolor\":\"rgb(237,237,237)\",\"ticklen\":6,\"ticks\":\"inside\"}},\"type\":\"parcoords\"}],\"pie\":[{\"automargin\":true,\"type\":\"pie\"}],\"scatter\":[{\"marker\":{\"colorbar\":{\"outlinewidth\":0,\"tickcolor\":\"rgb(237,237,237)\",\"ticklen\":6,\"ticks\":\"inside\"}},\"type\":\"scatter\"}],\"scatter3d\":[{\"line\":{\"colorbar\":{\"outlinewidth\":0,\"tickcolor\":\"rgb(237,237,237)\",\"ticklen\":6,\"ticks\":\"inside\"}},\"marker\":{\"colorbar\":{\"outlinewidth\":0,\"tickcolor\":\"rgb(237,237,237)\",\"ticklen\":6,\"ticks\":\"inside\"}},\"type\":\"scatter3d\"}],\"scattercarpet\":[{\"marker\":{\"colorbar\":{\"outlinewidth\":0,\"tickcolor\":\"rgb(237,237,237)\",\"ticklen\":6,\"ticks\":\"inside\"}},\"type\":\"scattercarpet\"}],\"scattergeo\":[{\"marker\":{\"colorbar\":{\"outlinewidth\":0,\"tickcolor\":\"rgb(237,237,237)\",\"ticklen\":6,\"ticks\":\"inside\"}},\"type\":\"scattergeo\"}],\"scattergl\":[{\"marker\":{\"colorbar\":{\"outlinewidth\":0,\"tickcolor\":\"rgb(237,237,237)\",\"ticklen\":6,\"ticks\":\"inside\"}},\"type\":\"scattergl\"}],\"scattermapbox\":[{\"marker\":{\"colorbar\":{\"outlinewidth\":0,\"tickcolor\":\"rgb(237,237,237)\",\"ticklen\":6,\"ticks\":\"inside\"}},\"type\":\"scattermapbox\"}],\"scatterpolar\":[{\"marker\":{\"colorbar\":{\"outlinewidth\":0,\"tickcolor\":\"rgb(237,237,237)\",\"ticklen\":6,\"ticks\":\"inside\"}},\"type\":\"scatterpolar\"}],\"scatterpolargl\":[{\"marker\":{\"colorbar\":{\"outlinewidth\":0,\"tickcolor\":\"rgb(237,237,237)\",\"ticklen\":6,\"ticks\":\"inside\"}},\"type\":\"scatterpolargl\"}],\"scatterternary\":[{\"marker\":{\"colorbar\":{\"outlinewidth\":0,\"tickcolor\":\"rgb(237,237,237)\",\"ticklen\":6,\"ticks\":\"inside\"}},\"type\":\"scatterternary\"}],\"surface\":[{\"colorbar\":{\"outlinewidth\":0,\"tickcolor\":\"rgb(237,237,237)\",\"ticklen\":6,\"ticks\":\"inside\"},\"colorscale\":[[0,\"rgb(20,44,66)\"],[1,\"rgb(90,179,244)\"]],\"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\":0,\"tickcolor\":\"rgb(237,237,237)\",\"ticklen\":6,\"ticks\":\"inside\"}},\"colorscale\":{\"sequential\":[[0,\"rgb(20,44,66)\"],[1,\"rgb(90,179,244)\"]],\"sequentialminus\":[[0,\"rgb(20,44,66)\"],[1,\"rgb(90,179,244)\"]]},\"colorway\":[\"#F8766D\",\"#A3A500\",\"#00BF7D\",\"#00B0F6\",\"#E76BF3\"],\"font\":{\"color\":\"rgb(51,51,51)\"},\"geo\":{\"bgcolor\":\"white\",\"lakecolor\":\"white\",\"landcolor\":\"rgb(237,237,237)\",\"showlakes\":true,\"showland\":true,\"subunitcolor\":\"white\"},\"hoverlabel\":{\"align\":\"left\"},\"hovermode\":\"closest\",\"paper_bgcolor\":\"white\",\"plot_bgcolor\":\"rgb(237,237,237)\",\"polar\":{\"angularaxis\":{\"gridcolor\":\"white\",\"linecolor\":\"white\",\"showgrid\":true,\"tickcolor\":\"rgb(51,51,51)\",\"ticks\":\"outside\"},\"bgcolor\":\"rgb(237,237,237)\",\"radialaxis\":{\"gridcolor\":\"white\",\"linecolor\":\"white\",\"showgrid\":true,\"tickcolor\":\"rgb(51,51,51)\",\"ticks\":\"outside\"}},\"scene\":{\"xaxis\":{\"backgroundcolor\":\"rgb(237,237,237)\",\"gridcolor\":\"white\",\"gridwidth\":2,\"linecolor\":\"white\",\"showbackground\":true,\"showgrid\":true,\"tickcolor\":\"rgb(51,51,51)\",\"ticks\":\"outside\",\"zerolinecolor\":\"white\"},\"yaxis\":{\"backgroundcolor\":\"rgb(237,237,237)\",\"gridcolor\":\"white\",\"gridwidth\":2,\"linecolor\":\"white\",\"showbackground\":true,\"showgrid\":true,\"tickcolor\":\"rgb(51,51,51)\",\"ticks\":\"outside\",\"zerolinecolor\":\"white\"},\"zaxis\":{\"backgroundcolor\":\"rgb(237,237,237)\",\"gridcolor\":\"white\",\"gridwidth\":2,\"linecolor\":\"white\",\"showbackground\":true,\"showgrid\":true,\"tickcolor\":\"rgb(51,51,51)\",\"ticks\":\"outside\",\"zerolinecolor\":\"white\"}},\"shapedefaults\":{\"fillcolor\":\"black\",\"line\":{\"width\":0},\"opacity\":0.3},\"ternary\":{\"aaxis\":{\"gridcolor\":\"white\",\"linecolor\":\"white\",\"showgrid\":true,\"tickcolor\":\"rgb(51,51,51)\",\"ticks\":\"outside\"},\"baxis\":{\"gridcolor\":\"white\",\"linecolor\":\"white\",\"showgrid\":true,\"tickcolor\":\"rgb(51,51,51)\",\"ticks\":\"outside\"},\"bgcolor\":\"rgb(237,237,237)\",\"caxis\":{\"gridcolor\":\"white\",\"linecolor\":\"white\",\"showgrid\":true,\"tickcolor\":\"rgb(51,51,51)\",\"ticks\":\"outside\"}},\"xaxis\":{\"automargin\":true,\"gridcolor\":\"white\",\"linecolor\":\"white\",\"showgrid\":true,\"tickcolor\":\"rgb(51,51,51)\",\"ticks\":\"outside\",\"title\":{\"standoff\":15},\"zerolinecolor\":\"white\"},\"yaxis\":{\"automargin\":true,\"gridcolor\":\"white\",\"linecolor\":\"white\",\"showgrid\":true,\"tickcolor\":\"rgb(51,51,51)\",\"ticks\":\"outside\",\"title\":{\"standoff\":15},\"zerolinecolor\":\"white\"}}},\"title\":{\"text\":\"Actual vs. Forecast | Number of airline passengers\"},\"xaxis\":{\"title\":{\"text\":\"Time\"}},\"yaxis\":{\"title\":{\"text\":\"Values\"}}}, {\"responsive\": true} ).then(function(){\n",
" \n",
"var gd = document.getElementById('cdc1b0c9-88c4-45ef-87f6-9ba75bb6ba24');\n",
"var x = new MutationObserver(function (mutations, observer) {{\n",
" var display = window.getComputedStyle(gd).display;\n",
" if (!display || display === 'none') {{\n",
" console.log([gd, 'removed!']);\n",
" Plotly.purge(gd);\n",
" observer.disconnect();\n",
" }}\n",
"}});\n",
"\n",
"// Listen for the removal of the full notebook cells\n",
"var notebookContainer = gd.closest('#notebook-container');\n",
"if (notebookContainer) {{\n",
" x.observe(notebookContainer, {childList: true});\n",
"}}\n",
"\n",
"// Listen for the clearing of the current output cell\n",
"var outputEl = gd.closest('.output');\n",
"if (outputEl) {{\n",
" x.observe(outputEl, {childList: true});\n",
"}}\n",
"\n",
" }) }; </script> </div>\n",
"</body>\n",
"</html>"
]
},
"metadata": {}
}
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "N84IN-B3ALU8"
},
"source": [
"## Automated Comparison"
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "_ATta_QLA_NS"
},
"source": [
"### Basics"
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "fTEYpIzF2jTS"
},
"source": [
"So some models do better than others. How do I know which one forecasts the best? Trying one by one would be time comsuming. \n",
"\n",
"That's why `pycaret` provides a convenient wrapper to do this - `compare_models`. Let's see how it works. "
]
},
{
"cell_type": "code",
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/",
"height": 1000,
"referenced_widgets": [
"54a60843685342d78de6ac6204aec7d7",
"3347de0612a24f288bf881da13b1ae70",
"d807dfcb81ba4f6d8beeb70b2a0f12ea"
]
},
"id": "7APQxr1a2WAs",
"outputId": "49f8cab5-d535-4ec6-f8a4-5e341ea8830c"
},
"source": [
"best_baseline = exp.compare_models()\n",
"exp.plot_model(best_baseline)"
],
"execution_count": 9,
"outputs": [
{
"output_type": "display_data",
"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>Model</th>\n",
" <th>MAE</th>\n",
" <th>RMSE</th>\n",
" <th>MAPE</th>\n",
" <th>SMAPE</th>\n",
" <th>R2</th>\n",
" <th>TT (Sec)</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>exp_smooth</th>\n",
" <td>Exponential Smoothing</td>\n",
" <td>16.7773</td>\n",
" <td>19.7959</td>\n",
" <td>0.0422</td>\n",
" <td>0.0427</td>\n",
" <td>0.8954</td>\n",
" <td>0.1400</td>\n",
" </tr>\n",
" <tr>\n",
" <th>ets</th>\n",
" <td>ETS</td>\n",
" <td>17.4191</td>\n",
" <td>20.5125</td>\n",
" <td>0.044</td>\n",
" <td>0.0445</td>\n",
" <td>0.8882</td>\n",
" <td>0.2033</td>\n",
" </tr>\n",
" <tr>\n",
" <th>arima</th>\n",
" <td>ARIMA</td>\n",
" <td>20.0069</td>\n",
" <td>22.2199</td>\n",
" <td>0.0501</td>\n",
" <td>0.0507</td>\n",
" <td>0.8677</td>\n",
" <td>0.0767</td>\n",
" </tr>\n",
" <tr>\n",
" <th>auto_arima</th>\n",
" <td>Auto ARIMA</td>\n",
" <td>21.0297</td>\n",
" <td>23.4661</td>\n",
" <td>0.0525</td>\n",
" <td>0.0531</td>\n",
" <td>0.8509</td>\n",
" <td>4.3500</td>\n",
" </tr>\n",
" <tr>\n",
" <th>et_cds_dt</th>\n",
" <td>Extra Trees w/ Cond. Deseasonalize &amp; Detrending</td>\n",
" <td>24.4233</td>\n",
" <td>31.4395</td>\n",
" <td>0.0584</td>\n",
" <td>0.0601</td>\n",
" <td>0.7169</td>\n",
" <td>0.9767</td>\n",
" </tr>\n",
" <tr>\n",
" <th>knn_cds_dt</th>\n",
" <td>K Neighbors w/ Cond. Deseasonalize &amp; Detrending</td>\n",
" <td>25.8293</td>\n",
" <td>34.9633</td>\n",
" <td>0.0617</td>\n",
" <td>0.0641</td>\n",
" <td>0.626</td>\n",
" <td>0.8367</td>\n",
" </tr>\n",
" <tr>\n",
" <th>rf_cds_dt</th>\n",
" <td>Random Forest w/ Cond. Deseasonalize &amp; Detrending</td>\n",
" <td>26.8586</td>\n",
" <td>38.0499</td>\n",
" <td>0.0629</td>\n",
" <td>0.0654</td>\n",
" <td>0.6023</td>\n",
" <td>1.0067</td>\n",
" </tr>\n",
" <tr>\n",
" <th>ada_cds_dt</th>\n",
" <td>AdaBoost w/ Cond. Deseasonalize &amp; Detrending</td>\n",
" <td>27.82</td>\n",
" <td>37.791</td>\n",
" <td>0.0661</td>\n",
" <td>0.0686</td>\n",
" <td>0.6015</td>\n",
" <td>0.1167</td>\n",
" </tr>\n",
" <tr>\n",
" <th>theta</th>\n",
" <td>Theta Forecaster</td>\n",
" <td>28.3192</td>\n",
" <td>33.8639</td>\n",
" <td>0.067</td>\n",
" <td>0.07</td>\n",
" <td>0.671</td>\n",
" <td>0.0200</td>\n",
" </tr>\n",
" <tr>\n",
" <th>gbr_cds_dt</th>\n",
" <td>Gradient Boosting w/ Cond. Deseasonalize &amp; Det...</td>\n",
" <td>29.1314</td>\n",
" <td>38.308</td>\n",
" <td>0.0685</td>\n",
" <td>0.0715</td>\n",
" <td>0.5855</td>\n",
" <td>0.0700</td>\n",
" </tr>\n",
" <tr>\n",
" <th>lightgbm_cds_dt</th>\n",
" <td>Light Gradient Boosting w/ Cond. Deseasonalize...</td>\n",
" <td>28.7738</td>\n",
" <td>36.2392</td>\n",
" <td>0.0698</td>\n",
" <td>0.0722</td>\n",
" <td>0.6255</td>\n",
" <td>0.0367</td>\n",
" </tr>\n",
" <tr>\n",
" <th>br_cds_dt</th>\n",
" <td>Bayesian Ridge w/ Cond. Deseasonalize &amp; Detren...</td>\n",
" <td>32.0341</td>\n",
" <td>39.2191</td>\n",
" <td>0.0799</td>\n",
" <td>0.0818</td>\n",
" <td>0.5658</td>\n",
" <td>0.0267</td>\n",
" </tr>\n",
" <tr>\n",
" <th>lasso_cds_dt</th>\n",
" <td>Lasso w/ Cond. Deseasonalize &amp; Detrending</td>\n",
" <td>32.8026</td>\n",
" <td>39.2084</td>\n",
" <td>0.0823</td>\n",
" <td>0.0841</td>\n",
" <td>0.5678</td>\n",
" <td>0.0233</td>\n",
" </tr>\n",
" <tr>\n",
" <th>en_cds_dt</th>\n",
" <td>Elastic Net w/ Cond. Deseasonalize &amp; Detrending</td>\n",
" <td>32.8556</td>\n",
" <td>39.2557</td>\n",
" <td>0.0825</td>\n",
" <td>0.0843</td>\n",
" <td>0.5669</td>\n",
" <td>0.0267</td>\n",
" </tr>\n",
" <tr>\n",
" <th>lr_cds_dt</th>\n",
" <td>Linear w/ Cond. Deseasonalize &amp; Detrending</td>\n",
" <td>32.9708</td>\n",
" <td>39.3456</td>\n",
" <td>0.0828</td>\n",
" <td>0.0846</td>\n",
" <td>0.5652</td>\n",
" <td>0.0200</td>\n",
" </tr>\n",
" <tr>\n",
" <th>ridge_cds_dt</th>\n",
" <td>Ridge w/ Cond. Deseasonalize &amp; Detrending</td>\n",
" <td>32.9702</td>\n",
" <td>39.3452</td>\n",
" <td>0.0828</td>\n",
" <td>0.0846</td>\n",
" <td>0.5652</td>\n",
" <td>0.0233</td>\n",
" </tr>\n",
" <tr>\n",
" <th>dt_cds_dt</th>\n",
" <td>Decision Tree w/ Cond. Deseasonalize &amp; Detrending</td>\n",
" <td>35.1446</td>\n",
" <td>45.8861</td>\n",
" <td>0.0826</td>\n",
" <td>0.0869</td>\n",
" <td>0.4284</td>\n",
" <td>0.0233</td>\n",
" </tr>\n",
" <tr>\n",
" <th>snaive</th>\n",
" <td>Seasonal Naive Forecaster</td>\n",
" <td>33.3611</td>\n",
" <td>35.9139</td>\n",
" <td>0.0832</td>\n",
" <td>0.0879</td>\n",
" <td>0.6072</td>\n",
" <td>0.0167</td>\n",
" </tr>\n",
" <tr>\n",
" <th>huber_cds_dt</th>\n",
" <td>Huber w/ Cond. Deseasonalize &amp; Detrending</td>\n",
" <td>35.4709</td>\n",
" <td>41.1489</td>\n",
" <td>0.091</td>\n",
" <td>0.0936</td>\n",
" <td>0.5226</td>\n",
" <td>0.0467</td>\n",
" </tr>\n",
" <tr>\n",
" <th>lar_cds_dt</th>\n",
" <td>Least Angular Regressor w/ Cond. Deseasonalize...</td>\n",
" <td>36.5285</td>\n",
" <td>42.4001</td>\n",
" <td>0.0936</td>\n",
" <td>0.0945</td>\n",
" <td>0.5058</td>\n",
" <td>0.0233</td>\n",
" </tr>\n",
" <tr>\n",
" <th>llar_cds_dt</th>\n",
" <td>Lasso Least Angular Regressor w/ Cond. Deseaso...</td>\n",
" <td>46.7239</td>\n",
" <td>63.1706</td>\n",
" <td>0.1109</td>\n",
" <td>0.1165</td>\n",
" <td>-0.0733</td>\n",
" <td>0.0233</td>\n",
" </tr>\n",
" <tr>\n",
" <th>omp_cds_dt</th>\n",
" <td>Orthogonal Matching Pursuit w/ Cond. Deseasona...</td>\n",
" <td>47.2799</td>\n",
" <td>64.5891</td>\n",
" <td>0.111</td>\n",
" <td>0.1177</td>\n",
" <td>-0.1201</td>\n",
" <td>0.0233</td>\n",
" </tr>\n",
" <tr>\n",
" <th>polytrend</th>\n",
" <td>Polynomial Trend Forecaster</td>\n",
" <td>48.6301</td>\n",
" <td>63.4299</td>\n",
" <td>0.117</td>\n",
" <td>0.1216</td>\n",
" <td>-0.0784</td>\n",
" <td>0.0133</td>\n",
" </tr>\n",
" <tr>\n",
" <th>naive</th>\n",
" <td>Naive Forecaster</td>\n",
" <td>69.0278</td>\n",
" <td>91.0322</td>\n",
" <td>0.1569</td>\n",
" <td>0.1792</td>\n",
" <td>-1.2216</td>\n",
" <td>0.0133</td>\n",
" </tr>\n",
" <tr>\n",
" <th>par_cds_dt</th>\n",
" <td>Passive Aggressive w/ Cond. Deseasonalize &amp; De...</td>\n",
" <td>78.0396</td>\n",
" <td>95.4251</td>\n",
" <td>0.2137</td>\n",
" <td>0.2531</td>\n",
" <td>-3.0784</td>\n",
" <td>0.0233</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"text/plain": [
" Model MAE \\\n",
"exp_smooth Exponential Smoothing 16.7773 \n",
"ets ETS 17.4191 \n",
"arima ARIMA 20.0069 \n",
"auto_arima Auto ARIMA 21.0297 \n",
"et_cds_dt Extra Trees w/ Cond. Deseasonalize & Detrending 24.4233 \n",
"knn_cds_dt K Neighbors w/ Cond. Deseasonalize & Detrending 25.8293 \n",
"rf_cds_dt Random Forest w/ Cond. Deseasonalize & Detrending 26.8586 \n",
"ada_cds_dt AdaBoost w/ Cond. Deseasonalize & Detrending 27.82 \n",
"theta Theta Forecaster 28.3192 \n",
"gbr_cds_dt Gradient Boosting w/ Cond. Deseasonalize & Det... 29.1314 \n",
"lightgbm_cds_dt Light Gradient Boosting w/ Cond. Deseasonalize... 28.7738 \n",
"br_cds_dt Bayesian Ridge w/ Cond. Deseasonalize & Detren... 32.0341 \n",
"lasso_cds_dt Lasso w/ Cond. Deseasonalize & Detrending 32.8026 \n",
"en_cds_dt Elastic Net w/ Cond. Deseasonalize & Detrending 32.8556 \n",
"lr_cds_dt Linear w/ Cond. Deseasonalize & Detrending 32.9708 \n",
"ridge_cds_dt Ridge w/ Cond. Deseasonalize & Detrending 32.9702 \n",
"dt_cds_dt Decision Tree w/ Cond. Deseasonalize & Detrending 35.1446 \n",
"snaive Seasonal Naive Forecaster 33.3611 \n",
"huber_cds_dt Huber w/ Cond. Deseasonalize & Detrending 35.4709 \n",
"lar_cds_dt Least Angular Regressor w/ Cond. Deseasonalize... 36.5285 \n",
"llar_cds_dt Lasso Least Angular Regressor w/ Cond. Deseaso... 46.7239 \n",
"omp_cds_dt Orthogonal Matching Pursuit w/ Cond. Deseasona... 47.2799 \n",
"polytrend Polynomial Trend Forecaster 48.6301 \n",
"naive Naive Forecaster 69.0278 \n",
"par_cds_dt Passive Aggressive w/ Cond. Deseasonalize & De... 78.0396 \n",
"\n",
" RMSE MAPE SMAPE R2 TT (Sec) \n",
"exp_smooth 19.7959 0.0422 0.0427 0.8954 0.1400 \n",
"ets 20.5125 0.044 0.0445 0.8882 0.2033 \n",
"arima 22.2199 0.0501 0.0507 0.8677 0.0767 \n",
"auto_arima 23.4661 0.0525 0.0531 0.8509 4.3500 \n",
"et_cds_dt 31.4395 0.0584 0.0601 0.7169 0.9767 \n",
"knn_cds_dt 34.9633 0.0617 0.0641 0.626 0.8367 \n",
"rf_cds_dt 38.0499 0.0629 0.0654 0.6023 1.0067 \n",
"ada_cds_dt 37.791 0.0661 0.0686 0.6015 0.1167 \n",
"theta 33.8639 0.067 0.07 0.671 0.0200 \n",
"gbr_cds_dt 38.308 0.0685 0.0715 0.5855 0.0700 \n",
"lightgbm_cds_dt 36.2392 0.0698 0.0722 0.6255 0.0367 \n",
"br_cds_dt 39.2191 0.0799 0.0818 0.5658 0.0267 \n",
"lasso_cds_dt 39.2084 0.0823 0.0841 0.5678 0.0233 \n",
"en_cds_dt 39.2557 0.0825 0.0843 0.5669 0.0267 \n",
"lr_cds_dt 39.3456 0.0828 0.0846 0.5652 0.0200 \n",
"ridge_cds_dt 39.3452 0.0828 0.0846 0.5652 0.0233 \n",
"dt_cds_dt 45.8861 0.0826 0.0869 0.4284 0.0233 \n",
"snaive 35.9139 0.0832 0.0879 0.6072 0.0167 \n",
"huber_cds_dt 41.1489 0.091 0.0936 0.5226 0.0467 \n",
"lar_cds_dt 42.4001 0.0936 0.0945 0.5058 0.0233 \n",
"llar_cds_dt 63.1706 0.1109 0.1165 -0.0733 0.0233 \n",
"omp_cds_dt 64.5891 0.111 0.1177 -0.1201 0.0233 \n",
"polytrend 63.4299 0.117 0.1216 -0.0784 0.0133 \n",
"naive 91.0322 0.1569 0.1792 -1.2216 0.0133 \n",
"par_cds_dt 95.4251 0.2137 0.2531 -3.0784 0.0233 "
]
},
"metadata": {}
},
{
"output_type": "display_data",
"data": {
"text/html": [
"<html>\n",
"<head><meta charset=\"utf-8\" /></head>\n",
"<body>\n",
" <div> <script src=\"https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js?config=TeX-AMS-MML_SVG\"></script><script type=\"text/javascript\">if (window.MathJax) {MathJax.Hub.Config({SVG: {font: \"STIX-Web\"}});}</script> <script type=\"text/javascript\">window.PlotlyConfig = {MathJaxConfig: 'local'};</script>\n",
" <script src=\"https://cdn.plot.ly/plotly-2.4.2.min.js\"></script> <div id=\"4dc595bf-e69a-42f9-b807-b096ac8eea35\" class=\"plotly-graph-div\" style=\"height:525px; width:100%;\"></div> <script type=\"text/javascript\"> window.PLOTLYENV=window.PLOTLYENV || {}; if (document.getElementById(\"4dc595bf-e69a-42f9-b807-b096ac8eea35\")) { Plotly.newPlot( \"4dc595bf-e69a-42f9-b807-b096ac8eea35\", [{\"line\":{\"color\":\"#1f77b4\"},\"marker\":{\"size\":5},\"mode\":\"lines+markers\",\"name\":\"Forecast | Exponential Smoothing\",\"showlegend\":true,\"type\":\"scatter\",\"x\":[\"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\":[417.2857,394.0622,462.4446,448.5984,471.8709,539.8948,623.8243,631.1553,515.5813,449.9025,394.2778,422.5128]},{\"marker\":{\"color\":\"#3f3f3f\",\"size\":5},\"mode\":\"lines+markers\",\"name\":\"Original\",\"showlegend\":true,\"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\",\"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\":[112.0,118.0,132.0,129.0,121.0,135.0,148.0,148.0,136.0,119.0,104.0,118.0,115.0,126.0,141.0,135.0,125.0,149.0,170.0,170.0,158.0,133.0,114.0,140.0,145.0,150.0,178.0,163.0,172.0,178.0,199.0,199.0,184.0,162.0,146.0,166.0,171.0,180.0,193.0,181.0,183.0,218.0,230.0,242.0,209.0,191.0,172.0,194.0,196.0,196.0,236.0,235.0,229.0,243.0,264.0,272.0,237.0,211.0,180.0,201.0,204.0,188.0,235.0,227.0,234.0,264.0,302.0,293.0,259.0,229.0,203.0,229.0,242.0,233.0,267.0,269.0,270.0,315.0,364.0,347.0,312.0,274.0,237.0,278.0,284.0,277.0,317.0,313.0,318.0,374.0,413.0,405.0,355.0,306.0,271.0,306.0,315.0,301.0,356.0,348.0,355.0,422.0,465.0,467.0,404.0,347.0,305.0,336.0,340.0,318.0,362.0,348.0,363.0,435.0,491.0,505.0,404.0,359.0,310.0,337.0,360.0,342.0,406.0,396.0,420.0,472.0,548.0,559.0,463.0,407.0,362.0,405.0,417.0,391.0,419.0,461.0,472.0,535.0,622.0,606.0,508.0,461.0,390.0,432.0]}], {\"showlegend\":true,\"template\":{\"data\":{\"bar\":[{\"error_x\":{\"color\":\"rgb(51,51,51)\"},\"error_y\":{\"color\":\"rgb(51,51,51)\"},\"marker\":{\"line\":{\"color\":\"rgb(237,237,237)\",\"width\":0.5},\"pattern\":{\"fillmode\":\"overlay\",\"size\":10,\"solidity\":0.2}},\"type\":\"bar\"}],\"barpolar\":[{\"marker\":{\"line\":{\"color\":\"rgb(237,237,237)\",\"width\":0.5},\"pattern\":{\"fillmode\":\"overlay\",\"size\":10,\"solidity\":0.2}},\"type\":\"barpolar\"}],\"carpet\":[{\"aaxis\":{\"endlinecolor\":\"rgb(51,51,51)\",\"gridcolor\":\"white\",\"linecolor\":\"white\",\"minorgridcolor\":\"white\",\"startlinecolor\":\"rgb(51,51,51)\"},\"baxis\":{\"endlinecolor\":\"rgb(51,51,51)\",\"gridcolor\":\"white\",\"linecolor\":\"white\",\"minorgridcolor\":\"white\",\"startlinecolor\":\"rgb(51,51,51)\"},\"type\":\"carpet\"}],\"choropleth\":[{\"colorbar\":{\"outlinewidth\":0,\"tickcolor\":\"rgb(237,237,237)\",\"ticklen\":6,\"ticks\":\"inside\"},\"type\":\"choropleth\"}],\"contour\":[{\"colorbar\":{\"outlinewidth\":0,\"tickcolor\":\"rgb(237,237,237)\",\"ticklen\":6,\"ticks\":\"inside\"},\"colorscale\":[[0,\"rgb(20,44,66)\"],[1,\"rgb(90,179,244)\"]],\"type\":\"contour\"}],\"contourcarpet\":[{\"colorbar\":{\"outlinewidth\":0,\"tickcolor\":\"rgb(237,237,237)\",\"ticklen\":6,\"ticks\":\"inside\"},\"type\":\"contourcarpet\"}],\"heatmap\":[{\"colorbar\":{\"outlinewidth\":0,\"tickcolor\":\"rgb(237,237,237)\",\"ticklen\":6,\"ticks\":\"inside\"},\"colorscale\":[[0,\"rgb(20,44,66)\"],[1,\"rgb(90,179,244)\"]],\"type\":\"heatmap\"}],\"heatmapgl\":[{\"colorbar\":{\"outlinewidth\":0,\"tickcolor\":\"rgb(237,237,237)\",\"ticklen\":6,\"ticks\":\"inside\"},\"colorscale\":[[0,\"rgb(20,44,66)\"],[1,\"rgb(90,179,244)\"]],\"type\":\"heatmapgl\"}],\"histogram\":[{\"marker\":{\"pattern\":{\"fillmode\":\"overlay\",\"size\":10,\"solidity\":0.2}},\"type\":\"histogram\"}],\"histogram2d\":[{\"colorbar\":{\"outlinewidth\":0,\"tickcolor\":\"rgb(237,237,237)\",\"ticklen\":6,\"ticks\":\"inside\"},\"colorscale\":[[0,\"rgb(20,44,66)\"],[1,\"rgb(90,179,244)\"]],\"type\":\"histogram2d\"}],\"histogram2dcontour\":[{\"colorbar\":{\"outlinewidth\":0,\"tickcolor\":\"rgb(237,237,237)\",\"ticklen\":6,\"ticks\":\"inside\"},\"colorscale\":[[0,\"rgb(20,44,66)\"],[1,\"rgb(90,179,244)\"]],\"type\":\"histogram2dcontour\"}],\"mesh3d\":[{\"colorbar\":{\"outlinewidth\":0,\"tickcolor\":\"rgb(237,237,237)\",\"ticklen\":6,\"ticks\":\"inside\"},\"type\":\"mesh3d\"}],\"parcoords\":[{\"line\":{\"colorbar\":{\"outlinewidth\":0,\"tickcolor\":\"rgb(237,237,237)\",\"ticklen\":6,\"ticks\":\"inside\"}},\"type\":\"parcoords\"}],\"pie\":[{\"automargin\":true,\"type\":\"pie\"}],\"scatter\":[{\"marker\":{\"colorbar\":{\"outlinewidth\":0,\"tickcolor\":\"rgb(237,237,237)\",\"ticklen\":6,\"ticks\":\"inside\"}},\"type\":\"scatter\"}],\"scatter3d\":[{\"line\":{\"colorbar\":{\"outlinewidth\":0,\"tickcolor\":\"rgb(237,237,237)\",\"ticklen\":6,\"ticks\":\"inside\"}},\"marker\":{\"colorbar\":{\"outlinewidth\":0,\"tickcolor\":\"rgb(237,237,237)\",\"ticklen\":6,\"ticks\":\"inside\"}},\"type\":\"scatter3d\"}],\"scattercarpet\":[{\"marker\":{\"colorbar\":{\"outlinewidth\":0,\"tickcolor\":\"rgb(237,237,237)\",\"ticklen\":6,\"ticks\":\"inside\"}},\"type\":\"scattercarpet\"}],\"scattergeo\":[{\"marker\":{\"colorbar\":{\"outlinewidth\":0,\"tickcolor\":\"rgb(237,237,237)\",\"ticklen\":6,\"ticks\":\"inside\"}},\"type\":\"scattergeo\"}],\"scattergl\":[{\"marker\":{\"colorbar\":{\"outlinewidth\":0,\"tickcolor\":\"rgb(237,237,237)\",\"ticklen\":6,\"ticks\":\"inside\"}},\"type\":\"scattergl\"}],\"scattermapbox\":[{\"marker\":{\"colorbar\":{\"outlinewidth\":0,\"tickcolor\":\"rgb(237,237,237)\",\"ticklen\":6,\"ticks\":\"inside\"}},\"type\":\"scattermapbox\"}],\"scatterpolar\":[{\"marker\":{\"colorbar\":{\"outlinewidth\":0,\"tickcolor\":\"rgb(237,237,237)\",\"ticklen\":6,\"ticks\":\"inside\"}},\"type\":\"scatterpolar\"}],\"scatterpolargl\":[{\"marker\":{\"colorbar\":{\"outlinewidth\":0,\"tickcolor\":\"rgb(237,237,237)\",\"ticklen\":6,\"ticks\":\"inside\"}},\"type\":\"scatterpolargl\"}],\"scatterternary\":[{\"marker\":{\"colorbar\":{\"outlinewidth\":0,\"tickcolor\":\"rgb(237,237,237)\",\"ticklen\":6,\"ticks\":\"inside\"}},\"type\":\"scatterternary\"}],\"surface\":[{\"colorbar\":{\"outlinewidth\":0,\"tickcolor\":\"rgb(237,237,237)\",\"ticklen\":6,\"ticks\":\"inside\"},\"colorscale\":[[0,\"rgb(20,44,66)\"],[1,\"rgb(90,179,244)\"]],\"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\":0,\"tickcolor\":\"rgb(237,237,237)\",\"ticklen\":6,\"ticks\":\"inside\"}},\"colorscale\":{\"sequential\":[[0,\"rgb(20,44,66)\"],[1,\"rgb(90,179,244)\"]],\"sequentialminus\":[[0,\"rgb(20,44,66)\"],[1,\"rgb(90,179,244)\"]]},\"colorway\":[\"#F8766D\",\"#A3A500\",\"#00BF7D\",\"#00B0F6\",\"#E76BF3\"],\"font\":{\"color\":\"rgb(51,51,51)\"},\"geo\":{\"bgcolor\":\"white\",\"lakecolor\":\"white\",\"landcolor\":\"rgb(237,237,237)\",\"showlakes\":true,\"showland\":true,\"subunitcolor\":\"white\"},\"hoverlabel\":{\"align\":\"left\"},\"hovermode\":\"closest\",\"paper_bgcolor\":\"white\",\"plot_bgcolor\":\"rgb(237,237,237)\",\"polar\":{\"angularaxis\":{\"gridcolor\":\"white\",\"linecolor\":\"white\",\"showgrid\":true,\"tickcolor\":\"rgb(51,51,51)\",\"ticks\":\"outside\"},\"bgcolor\":\"rgb(237,237,237)\",\"radialaxis\":{\"gridcolor\":\"white\",\"linecolor\":\"white\",\"showgrid\":true,\"tickcolor\":\"rgb(51,51,51)\",\"ticks\":\"outside\"}},\"scene\":{\"xaxis\":{\"backgroundcolor\":\"rgb(237,237,237)\",\"gridcolor\":\"white\",\"gridwidth\":2,\"linecolor\":\"white\",\"showbackground\":true,\"showgrid\":true,\"tickcolor\":\"rgb(51,51,51)\",\"ticks\":\"outside\",\"zerolinecolor\":\"white\"},\"yaxis\":{\"backgroundcolor\":\"rgb(237,237,237)\",\"gridcolor\":\"white\",\"gridwidth\":2,\"linecolor\":\"white\",\"showbackground\":true,\"showgrid\":true,\"tickcolor\":\"rgb(51,51,51)\",\"ticks\":\"outside\",\"zerolinecolor\":\"white\"},\"zaxis\":{\"backgroundcolor\":\"rgb(237,237,237)\",\"gridcolor\":\"white\",\"gridwidth\":2,\"linecolor\":\"white\",\"showbackground\":true,\"showgrid\":true,\"tickcolor\":\"rgb(51,51,51)\",\"ticks\":\"outside\",\"zerolinecolor\":\"white\"}},\"shapedefaults\":{\"fillcolor\":\"black\",\"line\":{\"width\":0},\"opacity\":0.3},\"ternary\":{\"aaxis\":{\"gridcolor\":\"white\",\"linecolor\":\"white\",\"showgrid\":true,\"tickcolor\":\"rgb(51,51,51)\",\"ticks\":\"outside\"},\"baxis\":{\"gridcolor\":\"white\",\"linecolor\":\"white\",\"showgrid\":true,\"tickcolor\":\"rgb(51,51,51)\",\"ticks\":\"outside\"},\"bgcolor\":\"rgb(237,237,237)\",\"caxis\":{\"gridcolor\":\"white\",\"linecolor\":\"white\",\"showgrid\":true,\"tickcolor\":\"rgb(51,51,51)\",\"ticks\":\"outside\"}},\"xaxis\":{\"automargin\":true,\"gridcolor\":\"white\",\"linecolor\":\"white\",\"showgrid\":true,\"tickcolor\":\"rgb(51,51,51)\",\"ticks\":\"outside\",\"title\":{\"standoff\":15},\"zerolinecolor\":\"white\"},\"yaxis\":{\"automargin\":true,\"gridcolor\":\"white\",\"linecolor\":\"white\",\"showgrid\":true,\"tickcolor\":\"rgb(51,51,51)\",\"ticks\":\"outside\",\"title\":{\"standoff\":15},\"zerolinecolor\":\"white\"}}},\"title\":{\"text\":\"Actual vs. Forecast | Number of airline passengers\"},\"xaxis\":{\"title\":{\"text\":\"Time\"}},\"yaxis\":{\"title\":{\"text\":\"Values\"}}}, {\"responsive\": true} ).then(function(){\n",
" \n",
"var gd = document.getElementById('4dc595bf-e69a-42f9-b807-b096ac8eea35');\n",
"var x = new MutationObserver(function (mutations, observer) {{\n",
" var display = window.getComputedStyle(gd).display;\n",
" if (!display || display === 'none') {{\n",
" console.log([gd, 'removed!']);\n",
" Plotly.purge(gd);\n",
" observer.disconnect();\n",
" }}\n",
"}});\n",
"\n",
"// Listen for the removal of the full notebook cells\n",
"var notebookContainer = gd.closest('#notebook-container');\n",
"if (notebookContainer) {{\n",
" x.observe(notebookContainer, {childList: true});\n",
"}}\n",
"\n",
"// Listen for the clearing of the current output cell\n",
"var outputEl = gd.closest('.output');\n",
"if (outputEl) {{\n",
" x.observe(outputEl, {childList: true});\n",
"}}\n",
"\n",
" }) }; </script> </div>\n",
"</body>\n",
"</html>"
]
},
"metadata": {}
}
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "wpqBTUPy3NOk"
},
"source": [
"We are now able to quickly compare multiple models using cross-validation and get the best model(s) for the next steps of our modeling flow.\n",
"\n",
"`compare_models` by default, returns the best model from the list. Sometimes, however, there is also a need for get the top N models for further analysis. `compare_modls` provides a conventient way to do this as well."
]
},
{
"cell_type": "code",
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/",
"height": 1000,
"referenced_widgets": [
"adea4e783f744bdc9c36eb13ec1346e7",
"00086a38361442d386a0ba757c6d8c3d",
"7182039c4b034039bf891f00aeed048b"
]
},
"id": "pad4VfPL3nVh",
"outputId": "3389d74a-5ca6-4cc3-e5a1-2ef9cd1fefa4"
},
"source": [
"#### Return the 3 top models ----\n",
"best_baseline_models = exp.compare_models(n_select=3)\n",
"for model in best_baseline_models:\n",
" exp.plot_model(model)"
],
"execution_count": 10,
"outputs": [
{
"output_type": "display_data",
"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>Model</th>\n",
" <th>MAE</th>\n",
" <th>RMSE</th>\n",
" <th>MAPE</th>\n",
" <th>SMAPE</th>\n",
" <th>R2</th>\n",
" <th>TT (Sec)</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>exp_smooth</th>\n",
" <td>Exponential Smoothing</td>\n",
" <td>16.7773</td>\n",
" <td>19.7959</td>\n",
" <td>0.0422</td>\n",
" <td>0.0427</td>\n",
" <td>0.8954</td>\n",
" <td>0.1333</td>\n",
" </tr>\n",
" <tr>\n",
" <th>ets</th>\n",
" <td>ETS</td>\n",
" <td>17.4191</td>\n",
" <td>20.5125</td>\n",
" <td>0.044</td>\n",
" <td>0.0445</td>\n",
" <td>0.8882</td>\n",
" <td>0.2100</td>\n",
" </tr>\n",
" <tr>\n",
" <th>arima</th>\n",
" <td>ARIMA</td>\n",
" <td>20.0069</td>\n",
" <td>22.2199</td>\n",
" <td>0.0501</td>\n",
" <td>0.0507</td>\n",
" <td>0.8677</td>\n",
" <td>0.0700</td>\n",
" </tr>\n",
" <tr>\n",
" <th>auto_arima</th>\n",
" <td>Auto ARIMA</td>\n",
" <td>21.0297</td>\n",
" <td>23.4661</td>\n",
" <td>0.0525</td>\n",
" <td>0.0531</td>\n",
" <td>0.8509</td>\n",
" <td>4.2800</td>\n",
" </tr>\n",
" <tr>\n",
" <th>et_cds_dt</th>\n",
" <td>Extra Trees w/ Cond. Deseasonalize &amp; Detrending</td>\n",
" <td>24.4233</td>\n",
" <td>31.4395</td>\n",
" <td>0.0584</td>\n",
" <td>0.0601</td>\n",
" <td>0.7169</td>\n",
" <td>0.9733</td>\n",
" </tr>\n",
" <tr>\n",
" <th>knn_cds_dt</th>\n",
" <td>K Neighbors w/ Cond. Deseasonalize &amp; Detrending</td>\n",
" <td>25.8293</td>\n",
" <td>34.9633</td>\n",
" <td>0.0617</td>\n",
" <td>0.0641</td>\n",
" <td>0.626</td>\n",
" <td>0.8367</td>\n",
" </tr>\n",
" <tr>\n",
" <th>rf_cds_dt</th>\n",
" <td>Random Forest w/ Cond. Deseasonalize &amp; Detrending</td>\n",
" <td>26.8586</td>\n",
" <td>38.0499</td>\n",
" <td>0.0629</td>\n",
" <td>0.0654</td>\n",
" <td>0.6023</td>\n",
" <td>1.0100</td>\n",
" </tr>\n",
" <tr>\n",
" <th>ada_cds_dt</th>\n",
" <td>AdaBoost w/ Cond. Deseasonalize &amp; Detrending</td>\n",
" <td>27.82</td>\n",
" <td>37.791</td>\n",
" <td>0.0661</td>\n",
" <td>0.0686</td>\n",
" <td>0.6015</td>\n",
" <td>0.1200</td>\n",
" </tr>\n",
" <tr>\n",
" <th>theta</th>\n",
" <td>Theta Forecaster</td>\n",
" <td>28.3192</td>\n",
" <td>33.8639</td>\n",
" <td>0.067</td>\n",
" <td>0.07</td>\n",
" <td>0.671</td>\n",
" <td>0.0167</td>\n",
" </tr>\n",
" <tr>\n",
" <th>gbr_cds_dt</th>\n",
" <td>Gradient Boosting w/ Cond. Deseasonalize &amp; Det...</td>\n",
" <td>29.1314</td>\n",
" <td>38.308</td>\n",
" <td>0.0685</td>\n",
" <td>0.0715</td>\n",
" <td>0.5855</td>\n",
" <td>0.0700</td>\n",
" </tr>\n",
" <tr>\n",
" <th>lightgbm_cds_dt</th>\n",
" <td>Light Gradient Boosting w/ Cond. Deseasonalize...</td>\n",
" <td>28.7738</td>\n",
" <td>36.2392</td>\n",
" <td>0.0698</td>\n",
" <td>0.0722</td>\n",
" <td>0.6255</td>\n",
" <td>0.0367</td>\n",
" </tr>\n",
" <tr>\n",
" <th>br_cds_dt</th>\n",
" <td>Bayesian Ridge w/ Cond. Deseasonalize &amp; Detren...</td>\n",
" <td>32.0341</td>\n",
" <td>39.2191</td>\n",
" <td>0.0799</td>\n",
" <td>0.0818</td>\n",
" <td>0.5658</td>\n",
" <td>0.0233</td>\n",
" </tr>\n",
" <tr>\n",
" <th>lasso_cds_dt</th>\n",
" <td>Lasso w/ Cond. Deseasonalize &amp; Detrending</td>\n",
" <td>32.8026</td>\n",
" <td>39.2084</td>\n",
" <td>0.0823</td>\n",
" <td>0.0841</td>\n",
" <td>0.5678</td>\n",
" <td>0.0233</td>\n",
" </tr>\n",
" <tr>\n",
" <th>en_cds_dt</th>\n",
" <td>Elastic Net w/ Cond. Deseasonalize &amp; Detrending</td>\n",
" <td>32.8556</td>\n",
" <td>39.2557</td>\n",
" <td>0.0825</td>\n",
" <td>0.0843</td>\n",
" <td>0.5669</td>\n",
" <td>0.0267</td>\n",
" </tr>\n",
" <tr>\n",
" <th>lr_cds_dt</th>\n",
" <td>Linear w/ Cond. Deseasonalize &amp; Detrending</td>\n",
" <td>32.9708</td>\n",
" <td>39.3456</td>\n",
" <td>0.0828</td>\n",
" <td>0.0846</td>\n",
" <td>0.5652</td>\n",
" <td>0.0233</td>\n",
" </tr>\n",
" <tr>\n",
" <th>ridge_cds_dt</th>\n",
" <td>Ridge w/ Cond. Deseasonalize &amp; Detrending</td>\n",
" <td>32.9702</td>\n",
" <td>39.3452</td>\n",
" <td>0.0828</td>\n",
" <td>0.0846</td>\n",
" <td>0.5652</td>\n",
" <td>0.0233</td>\n",
" </tr>\n",
" <tr>\n",
" <th>dt_cds_dt</th>\n",
" <td>Decision Tree w/ Cond. Deseasonalize &amp; Detrending</td>\n",
" <td>35.1446</td>\n",
" <td>45.8861</td>\n",
" <td>0.0826</td>\n",
" <td>0.0869</td>\n",
" <td>0.4284</td>\n",
" <td>0.0233</td>\n",
" </tr>\n",
" <tr>\n",
" <th>snaive</th>\n",
" <td>Seasonal Naive Forecaster</td>\n",
" <td>33.3611</td>\n",
" <td>35.9139</td>\n",
" <td>0.0832</td>\n",
" <td>0.0879</td>\n",
" <td>0.6072</td>\n",
" <td>0.0167</td>\n",
" </tr>\n",
" <tr>\n",
" <th>huber_cds_dt</th>\n",
" <td>Huber w/ Cond. Deseasonalize &amp; Detrending</td>\n",
" <td>35.4709</td>\n",
" <td>41.1489</td>\n",
" <td>0.091</td>\n",
" <td>0.0936</td>\n",
" <td>0.5226</td>\n",
" <td>0.0467</td>\n",
" </tr>\n",
" <tr>\n",
" <th>lar_cds_dt</th>\n",
" <td>Least Angular Regressor w/ Cond. Deseasonalize...</td>\n",
" <td>36.5285</td>\n",
" <td>42.4001</td>\n",
" <td>0.0936</td>\n",
" <td>0.0945</td>\n",
" <td>0.5058</td>\n",
" <td>0.0233</td>\n",
" </tr>\n",
" <tr>\n",
" <th>llar_cds_dt</th>\n",
" <td>Lasso Least Angular Regressor w/ Cond. Deseaso...</td>\n",
" <td>46.7239</td>\n",
" <td>63.1706</td>\n",
" <td>0.1109</td>\n",
" <td>0.1165</td>\n",
" <td>-0.0733</td>\n",
" <td>0.0233</td>\n",
" </tr>\n",
" <tr>\n",
" <th>omp_cds_dt</th>\n",
" <td>Orthogonal Matching Pursuit w/ Cond. Deseasona...</td>\n",
" <td>47.2799</td>\n",
" <td>64.5891</td>\n",
" <td>0.111</td>\n",
" <td>0.1177</td>\n",
" <td>-0.1201</td>\n",
" <td>0.0233</td>\n",
" </tr>\n",
" <tr>\n",
" <th>polytrend</th>\n",
" <td>Polynomial Trend Forecaster</td>\n",
" <td>48.6301</td>\n",
" <td>63.4299</td>\n",
" <td>0.117</td>\n",
" <td>0.1216</td>\n",
" <td>-0.0784</td>\n",
" <td>0.0100</td>\n",
" </tr>\n",
" <tr>\n",
" <th>naive</th>\n",
" <td>Naive Forecaster</td>\n",
" <td>69.0278</td>\n",
" <td>91.0322</td>\n",
" <td>0.1569</td>\n",
" <td>0.1792</td>\n",
" <td>-1.2216</td>\n",
" <td>0.0167</td>\n",
" </tr>\n",
" <tr>\n",
" <th>par_cds_dt</th>\n",
" <td>Passive Aggressive w/ Cond. Deseasonalize &amp; De...</td>\n",
" <td>78.0396</td>\n",
" <td>95.4251</td>\n",
" <td>0.2137</td>\n",
" <td>0.2531</td>\n",
" <td>-3.0784</td>\n",
" <td>0.0233</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"text/plain": [
" Model MAE \\\n",
"exp_smooth Exponential Smoothing 16.7773 \n",
"ets ETS 17.4191 \n",
"arima ARIMA 20.0069 \n",
"auto_arima Auto ARIMA 21.0297 \n",
"et_cds_dt Extra Trees w/ Cond. Deseasonalize & Detrending 24.4233 \n",
"knn_cds_dt K Neighbors w/ Cond. Deseasonalize & Detrending 25.8293 \n",
"rf_cds_dt Random Forest w/ Cond. Deseasonalize & Detrending 26.8586 \n",
"ada_cds_dt AdaBoost w/ Cond. Deseasonalize & Detrending 27.82 \n",
"theta Theta Forecaster 28.3192 \n",
"gbr_cds_dt Gradient Boosting w/ Cond. Deseasonalize & Det... 29.1314 \n",
"lightgbm_cds_dt Light Gradient Boosting w/ Cond. Deseasonalize... 28.7738 \n",
"br_cds_dt Bayesian Ridge w/ Cond. Deseasonalize & Detren... 32.0341 \n",
"lasso_cds_dt Lasso w/ Cond. Deseasonalize & Detrending 32.8026 \n",
"en_cds_dt Elastic Net w/ Cond. Deseasonalize & Detrending 32.8556 \n",
"lr_cds_dt Linear w/ Cond. Deseasonalize & Detrending 32.9708 \n",
"ridge_cds_dt Ridge w/ Cond. Deseasonalize & Detrending 32.9702 \n",
"dt_cds_dt Decision Tree w/ Cond. Deseasonalize & Detrending 35.1446 \n",
"snaive Seasonal Naive Forecaster 33.3611 \n",
"huber_cds_dt Huber w/ Cond. Deseasonalize & Detrending 35.4709 \n",
"lar_cds_dt Least Angular Regressor w/ Cond. Deseasonalize... 36.5285 \n",
"llar_cds_dt Lasso Least Angular Regressor w/ Cond. Deseaso... 46.7239 \n",
"omp_cds_dt Orthogonal Matching Pursuit w/ Cond. Deseasona... 47.2799 \n",
"polytrend Polynomial Trend Forecaster 48.6301 \n",
"naive Naive Forecaster 69.0278 \n",
"par_cds_dt Passive Aggressive w/ Cond. Deseasonalize & De... 78.0396 \n",
"\n",
" RMSE MAPE SMAPE R2 TT (Sec) \n",
"exp_smooth 19.7959 0.0422 0.0427 0.8954 0.1333 \n",
"ets 20.5125 0.044 0.0445 0.8882 0.2100 \n",
"arima 22.2199 0.0501 0.0507 0.8677 0.0700 \n",
"auto_arima 23.4661 0.0525 0.0531 0.8509 4.2800 \n",
"et_cds_dt 31.4395 0.0584 0.0601 0.7169 0.9733 \n",
"knn_cds_dt 34.9633 0.0617 0.0641 0.626 0.8367 \n",
"rf_cds_dt 38.0499 0.0629 0.0654 0.6023 1.0100 \n",
"ada_cds_dt 37.791 0.0661 0.0686 0.6015 0.1200 \n",
"theta 33.8639 0.067 0.07 0.671 0.0167 \n",
"gbr_cds_dt 38.308 0.0685 0.0715 0.5855 0.0700 \n",
"lightgbm_cds_dt 36.2392 0.0698 0.0722 0.6255 0.0367 \n",
"br_cds_dt 39.2191 0.0799 0.0818 0.5658 0.0233 \n",
"lasso_cds_dt 39.2084 0.0823 0.0841 0.5678 0.0233 \n",
"en_cds_dt 39.2557 0.0825 0.0843 0.5669 0.0267 \n",
"lr_cds_dt 39.3456 0.0828 0.0846 0.5652 0.0233 \n",
"ridge_cds_dt 39.3452 0.0828 0.0846 0.5652 0.0233 \n",
"dt_cds_dt 45.8861 0.0826 0.0869 0.4284 0.0233 \n",
"snaive 35.9139 0.0832 0.0879 0.6072 0.0167 \n",
"huber_cds_dt 41.1489 0.091 0.0936 0.5226 0.0467 \n",
"lar_cds_dt 42.4001 0.0936 0.0945 0.5058 0.0233 \n",
"llar_cds_dt 63.1706 0.1109 0.1165 -0.0733 0.0233 \n",
"omp_cds_dt 64.5891 0.111 0.1177 -0.1201 0.0233 \n",
"polytrend 63.4299 0.117 0.1216 -0.0784 0.0100 \n",
"naive 91.0322 0.1569 0.1792 -1.2216 0.0167 \n",
"par_cds_dt 95.4251 0.2137 0.2531 -3.0784 0.0233 "
]
},
"metadata": {}
},
{
"output_type": "display_data",
"data": {
"text/html": [
"<html>\n",
"<head><meta charset=\"utf-8\" /></head>\n",
"<body>\n",
" <div> <script src=\"https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js?config=TeX-AMS-MML_SVG\"></script><script type=\"text/javascript\">if (window.MathJax) {MathJax.Hub.Config({SVG: {font: \"STIX-Web\"}});}</script> <script type=\"text/javascript\">window.PlotlyConfig = {MathJaxConfig: 'local'};</script>\n",
" <script src=\"https://cdn.plot.ly/plotly-2.4.2.min.js\"></script> <div id=\"b3f2d65d-5376-419d-a8da-6503f2b55ce1\" class=\"plotly-graph-div\" style=\"height:525px; width:100%;\"></div> <script type=\"text/javascript\"> window.PLOTLYENV=window.PLOTLYENV || {}; if (document.getElementById(\"b3f2d65d-5376-419d-a8da-6503f2b55ce1\")) { Plotly.newPlot( \"b3f2d65d-5376-419d-a8da-6503f2b55ce1\", [{\"line\":{\"color\":\"#1f77b4\"},\"marker\":{\"size\":5},\"mode\":\"lines+markers\",\"name\":\"Forecast | Exponential Smoothing\",\"showlegend\":true,\"type\":\"scatter\",\"x\":[\"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\":[417.2857,394.0622,462.4446,448.5984,471.8709,539.8948,623.8243,631.1553,515.5813,449.9025,394.2778,422.5128]},{\"marker\":{\"color\":\"#3f3f3f\",\"size\":5},\"mode\":\"lines+markers\",\"name\":\"Original\",\"showlegend\":true,\"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\",\"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\":[112.0,118.0,132.0,129.0,121.0,135.0,148.0,148.0,136.0,119.0,104.0,118.0,115.0,126.0,141.0,135.0,125.0,149.0,170.0,170.0,158.0,133.0,114.0,140.0,145.0,150.0,178.0,163.0,172.0,178.0,199.0,199.0,184.0,162.0,146.0,166.0,171.0,180.0,193.0,181.0,183.0,218.0,230.0,242.0,209.0,191.0,172.0,194.0,196.0,196.0,236.0,235.0,229.0,243.0,264.0,272.0,237.0,211.0,180.0,201.0,204.0,188.0,235.0,227.0,234.0,264.0,302.0,293.0,259.0,229.0,203.0,229.0,242.0,233.0,267.0,269.0,270.0,315.0,364.0,347.0,312.0,274.0,237.0,278.0,284.0,277.0,317.0,313.0,318.0,374.0,413.0,405.0,355.0,306.0,271.0,306.0,315.0,301.0,356.0,348.0,355.0,422.0,465.0,467.0,404.0,347.0,305.0,336.0,340.0,318.0,362.0,348.0,363.0,435.0,491.0,505.0,404.0,359.0,310.0,337.0,360.0,342.0,406.0,396.0,420.0,472.0,548.0,559.0,463.0,407.0,362.0,405.0,417.0,391.0,419.0,461.0,472.0,535.0,622.0,606.0,508.0,461.0,390.0,432.0]}], {\"showlegend\":true,\"template\":{\"data\":{\"bar\":[{\"error_x\":{\"color\":\"rgb(51,51,51)\"},\"error_y\":{\"color\":\"rgb(51,51,51)\"},\"marker\":{\"line\":{\"color\":\"rgb(237,237,237)\",\"width\":0.5},\"pattern\":{\"fillmode\":\"overlay\",\"size\":10,\"solidity\":0.2}},\"type\":\"bar\"}],\"barpolar\":[{\"marker\":{\"line\":{\"color\":\"rgb(237,237,237)\",\"width\":0.5},\"pattern\":{\"fillmode\":\"overlay\",\"size\":10,\"solidity\":0.2}},\"type\":\"barpolar\"}],\"carpet\":[{\"aaxis\":{\"endlinecolor\":\"rgb(51,51,51)\",\"gridcolor\":\"white\",\"linecolor\":\"white\",\"minorgridcolor\":\"white\",\"startlinecolor\":\"rgb(51,51,51)\"},\"baxis\":{\"endlinecolor\":\"rgb(51,51,51)\",\"gridcolor\":\"white\",\"linecolor\":\"white\",\"minorgridcolor\":\"white\",\"startlinecolor\":\"rgb(51,51,51)\"},\"type\":\"carpet\"}],\"choropleth\":[{\"colorbar\":{\"outlinewidth\":0,\"tickcolor\":\"rgb(237,237,237)\",\"ticklen\":6,\"ticks\":\"inside\"},\"type\":\"choropleth\"}],\"contour\":[{\"colorbar\":{\"outlinewidth\":0,\"tickcolor\":\"rgb(237,237,237)\",\"ticklen\":6,\"ticks\":\"inside\"},\"colorscale\":[[0,\"rgb(20,44,66)\"],[1,\"rgb(90,179,244)\"]],\"type\":\"contour\"}],\"contourcarpet\":[{\"colorbar\":{\"outlinewidth\":0,\"tickcolor\":\"rgb(237,237,237)\",\"ticklen\":6,\"ticks\":\"inside\"},\"type\":\"contourcarpet\"}],\"heatmap\":[{\"colorbar\":{\"outlinewidth\":0,\"tickcolor\":\"rgb(237,237,237)\",\"ticklen\":6,\"ticks\":\"inside\"},\"colorscale\":[[0,\"rgb(20,44,66)\"],[1,\"rgb(90,179,244)\"]],\"type\":\"heatmap\"}],\"heatmapgl\":[{\"colorbar\":{\"outlinewidth\":0,\"tickcolor\":\"rgb(237,237,237)\",\"ticklen\":6,\"ticks\":\"inside\"},\"colorscale\":[[0,\"rgb(20,44,66)\"],[1,\"rgb(90,179,244)\"]],\"type\":\"heatmapgl\"}],\"histogram\":[{\"marker\":{\"pattern\":{\"fillmode\":\"overlay\",\"size\":10,\"solidity\":0.2}},\"type\":\"histogram\"}],\"histogram2d\":[{\"colorbar\":{\"outlinewidth\":0,\"tickcolor\":\"rgb(237,237,237)\",\"ticklen\":6,\"ticks\":\"inside\"},\"colorscale\":[[0,\"rgb(20,44,66)\"],[1,\"rgb(90,179,244)\"]],\"type\":\"histogram2d\"}],\"histogram2dcontour\":[{\"colorbar\":{\"outlinewidth\":0,\"tickcolor\":\"rgb(237,237,237)\",\"ticklen\":6,\"ticks\":\"inside\"},\"colorscale\":[[0,\"rgb(20,44,66)\"],[1,\"rgb(90,179,244)\"]],\"type\":\"histogram2dcontour\"}],\"mesh3d\":[{\"colorbar\":{\"outlinewidth\":0,\"tickcolor\":\"rgb(237,237,237)\",\"ticklen\":6,\"ticks\":\"inside\"},\"type\":\"mesh3d\"}],\"parcoords\":[{\"line\":{\"colorbar\":{\"outlinewidth\":0,\"tickcolor\":\"rgb(237,237,237)\",\"ticklen\":6,\"ticks\":\"inside\"}},\"type\":\"parcoords\"}],\"pie\":[{\"automargin\":true,\"type\":\"pie\"}],\"scatter\":[{\"marker\":{\"colorbar\":{\"outlinewidth\":0,\"tickcolor\":\"rgb(237,237,237)\",\"ticklen\":6,\"ticks\":\"inside\"}},\"type\":\"scatter\"}],\"scatter3d\":[{\"line\":{\"colorbar\":{\"outlinewidth\":0,\"tickcolor\":\"rgb(237,237,237)\",\"ticklen\":6,\"ticks\":\"inside\"}},\"marker\":{\"colorbar\":{\"outlinewidth\":0,\"tickcolor\":\"rgb(237,237,237)\",\"ticklen\":6,\"ticks\":\"inside\"}},\"type\":\"scatter3d\"}],\"scattercarpet\":[{\"marker\":{\"colorbar\":{\"outlinewidth\":0,\"tickcolor\":\"rgb(237,237,237)\",\"ticklen\":6,\"ticks\":\"inside\"}},\"type\":\"scattercarpet\"}],\"scattergeo\":[{\"marker\":{\"colorbar\":{\"outlinewidth\":0,\"tickcolor\":\"rgb(237,237,237)\",\"ticklen\":6,\"ticks\":\"inside\"}},\"type\":\"scattergeo\"}],\"scattergl\":[{\"marker\":{\"colorbar\":{\"outlinewidth\":0,\"tickcolor\":\"rgb(237,237,237)\",\"ticklen\":6,\"ticks\":\"inside\"}},\"type\":\"scattergl\"}],\"scattermapbox\":[{\"marker\":{\"colorbar\":{\"outlinewidth\":0,\"tickcolor\":\"rgb(237,237,237)\",\"ticklen\":6,\"ticks\":\"inside\"}},\"type\":\"scattermapbox\"}],\"scatterpolar\":[{\"marker\":{\"colorbar\":{\"outlinewidth\":0,\"tickcolor\":\"rgb(237,237,237)\",\"ticklen\":6,\"ticks\":\"inside\"}},\"type\":\"scatterpolar\"}],\"scatterpolargl\":[{\"marker\":{\"colorbar\":{\"outlinewidth\":0,\"tickcolor\":\"rgb(237,237,237)\",\"ticklen\":6,\"ticks\":\"inside\"}},\"type\":\"scatterpolargl\"}],\"scatterternary\":[{\"marker\":{\"colorbar\":{\"outlinewidth\":0,\"tickcolor\":\"rgb(237,237,237)\",\"ticklen\":6,\"ticks\":\"inside\"}},\"type\":\"scatterternary\"}],\"surface\":[{\"colorbar\":{\"outlinewidth\":0,\"tickcolor\":\"rgb(237,237,237)\",\"ticklen\":6,\"ticks\":\"inside\"},\"colorscale\":[[0,\"rgb(20,44,66)\"],[1,\"rgb(90,179,244)\"]],\"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\":0,\"tickcolor\":\"rgb(237,237,237)\",\"ticklen\":6,\"ticks\":\"inside\"}},\"colorscale\":{\"sequential\":[[0,\"rgb(20,44,66)\"],[1,\"rgb(90,179,244)\"]],\"sequentialminus\":[[0,\"rgb(20,44,66)\"],[1,\"rgb(90,179,244)\"]]},\"colorway\":[\"#F8766D\",\"#A3A500\",\"#00BF7D\",\"#00B0F6\",\"#E76BF3\"],\"font\":{\"color\":\"rgb(51,51,51)\"},\"geo\":{\"bgcolor\":\"white\",\"lakecolor\":\"white\",\"landcolor\":\"rgb(237,237,237)\",\"showlakes\":true,\"showland\":true,\"subunitcolor\":\"white\"},\"hoverlabel\":{\"align\":\"left\"},\"hovermode\":\"closest\",\"paper_bgcolor\":\"white\",\"plot_bgcolor\":\"rgb(237,237,237)\",\"polar\":{\"angularaxis\":{\"gridcolor\":\"white\",\"linecolor\":\"white\",\"showgrid\":true,\"tickcolor\":\"rgb(51,51,51)\",\"ticks\":\"outside\"},\"bgcolor\":\"rgb(237,237,237)\",\"radialaxis\":{\"gridcolor\":\"white\",\"linecolor\":\"white\",\"showgrid\":true,\"tickcolor\":\"rgb(51,51,51)\",\"ticks\":\"outside\"}},\"scene\":{\"xaxis\":{\"backgroundcolor\":\"rgb(237,237,237)\",\"gridcolor\":\"white\",\"gridwidth\":2,\"linecolor\":\"white\",\"showbackground\":true,\"showgrid\":true,\"tickcolor\":\"rgb(51,51,51)\",\"ticks\":\"outside\",\"zerolinecolor\":\"white\"},\"yaxis\":{\"backgroundcolor\":\"rgb(237,237,237)\",\"gridcolor\":\"white\",\"gridwidth\":2,\"linecolor\":\"white\",\"showbackground\":true,\"showgrid\":true,\"tickcolor\":\"rgb(51,51,51)\",\"ticks\":\"outside\",\"zerolinecolor\":\"white\"},\"zaxis\":{\"backgroundcolor\":\"rgb(237,237,237)\",\"gridcolor\":\"white\",\"gridwidth\":2,\"linecolor\":\"white\",\"showbackground\":true,\"showgrid\":true,\"tickcolor\":\"rgb(51,51,51)\",\"ticks\":\"outside\",\"zerolinecolor\":\"white\"}},\"shapedefaults\":{\"fillcolor\":\"black\",\"line\":{\"width\":0},\"opacity\":0.3},\"ternary\":{\"aaxis\":{\"gridcolor\":\"white\",\"linecolor\":\"white\",\"showgrid\":true,\"tickcolor\":\"rgb(51,51,51)\",\"ticks\":\"outside\"},\"baxis\":{\"gridcolor\":\"white\",\"linecolor\":\"white\",\"showgrid\":true,\"tickcolor\":\"rgb(51,51,51)\",\"ticks\":\"outside\"},\"bgcolor\":\"rgb(237,237,237)\",\"caxis\":{\"gridcolor\":\"white\",\"linecolor\":\"white\",\"showgrid\":true,\"tickcolor\":\"rgb(51,51,51)\",\"ticks\":\"outside\"}},\"xaxis\":{\"automargin\":true,\"gridcolor\":\"white\",\"linecolor\":\"white\",\"showgrid\":true,\"tickcolor\":\"rgb(51,51,51)\",\"ticks\":\"outside\",\"title\":{\"standoff\":15},\"zerolinecolor\":\"white\"},\"yaxis\":{\"automargin\":true,\"gridcolor\":\"white\",\"linecolor\":\"white\",\"showgrid\":true,\"tickcolor\":\"rgb(51,51,51)\",\"ticks\":\"outside\",\"title\":{\"standoff\":15},\"zerolinecolor\":\"white\"}}},\"title\":{\"text\":\"Actual vs. Forecast | Number of airline passengers\"},\"xaxis\":{\"title\":{\"text\":\"Time\"}},\"yaxis\":{\"title\":{\"text\":\"Values\"}}}, {\"responsive\": true} ).then(function(){\n",
" \n",
"var gd = document.getElementById('b3f2d65d-5376-419d-a8da-6503f2b55ce1');\n",
"var x = new MutationObserver(function (mutations, observer) {{\n",
" var display = window.getComputedStyle(gd).display;\n",
" if (!display || display === 'none') {{\n",
" console.log([gd, 'removed!']);\n",
" Plotly.purge(gd);\n",
" observer.disconnect();\n",
" }}\n",
"}});\n",
"\n",
"// Listen for the removal of the full notebook cells\n",
"var notebookContainer = gd.closest('#notebook-container');\n",
"if (notebookContainer) {{\n",
" x.observe(notebookContainer, {childList: true});\n",
"}}\n",
"\n",
"// Listen for the clearing of the current output cell\n",
"var outputEl = gd.closest('.output');\n",
"if (outputEl) {{\n",
" x.observe(outputEl, {childList: true});\n",
"}}\n",
"\n",
" }) }; </script> </div>\n",
"</body>\n",
"</html>"
]
},
"metadata": {}
},
{
"output_type": "display_data",
"data": {
"text/html": [
"<html>\n",
"<head><meta charset=\"utf-8\" /></head>\n",
"<body>\n",
" <div> <script src=\"https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js?config=TeX-AMS-MML_SVG\"></script><script type=\"text/javascript\">if (window.MathJax) {MathJax.Hub.Config({SVG: {font: \"STIX-Web\"}});}</script> <script type=\"text/javascript\">window.PlotlyConfig = {MathJaxConfig: 'local'};</script>\n",
" <script src=\"https://cdn.plot.ly/plotly-2.4.2.min.js\"></script> <div id=\"7767608f-94bf-4064-8c50-c5d85fc2f07f\" class=\"plotly-graph-div\" style=\"height:525px; width:100%;\"></div> <script type=\"text/javascript\"> window.PLOTLYENV=window.PLOTLYENV || {}; if (document.getElementById(\"7767608f-94bf-4064-8c50-c5d85fc2f07f\")) { Plotly.newPlot( \"7767608f-94bf-4064-8c50-c5d85fc2f07f\", [{\"line\":{\"width\":0},\"marker\":{\"color\":\"#68BBE3\"},\"mode\":\"lines\",\"name\":\"Lower Interval\",\"showlegend\":false,\"type\":\"scatter\",\"x\":[\"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\":[399.1724,374.2371,441.7475,424.885,445.9866,512.4318,593.5584,597.6323,487.5193,423.1288,368.6979,405.3603]},{\"fill\":\"tonexty\",\"fillcolor\":\"#68BBE3\",\"line\":{\"color\":\"#1f77b4\"},\"marker\":{\"size\":5},\"mode\":\"lines+markers\",\"name\":\"Forecast | ETS\",\"showlegend\":true,\"type\":\"scatter\",\"x\":[\"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\":[417.2265,394.0018,462.2049,448.3367,471.6366,539.3359,623.561,630.7469,515.2,449.7405,394.1071,433.6767]},{\"fill\":\"tonexty\",\"fillcolor\":\"#68BBE3\",\"line\":{\"width\":0},\"marker\":{\"color\":\"#68BBE3\"},\"mode\":\"lines\",\"name\":\"Prediction Interval | ETS\",\"showlegend\":true,\"type\":\"scatter\",\"x\":[\"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\":[435.9598,415.3192,484.8106,472.5015,495.2967,565.8552,652.9493,664.4028,545.2246,475.8882,419.5679,461.5141]},{\"marker\":{\"color\":\"#3f3f3f\",\"size\":5},\"mode\":\"lines+markers\",\"name\":\"Original\",\"showlegend\":true,\"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\",\"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\":[112.0,118.0,132.0,129.0,121.0,135.0,148.0,148.0,136.0,119.0,104.0,118.0,115.0,126.0,141.0,135.0,125.0,149.0,170.0,170.0,158.0,133.0,114.0,140.0,145.0,150.0,178.0,163.0,172.0,178.0,199.0,199.0,184.0,162.0,146.0,166.0,171.0,180.0,193.0,181.0,183.0,218.0,230.0,242.0,209.0,191.0,172.0,194.0,196.0,196.0,236.0,235.0,229.0,243.0,264.0,272.0,237.0,211.0,180.0,201.0,204.0,188.0,235.0,227.0,234.0,264.0,302.0,293.0,259.0,229.0,203.0,229.0,242.0,233.0,267.0,269.0,270.0,315.0,364.0,347.0,312.0,274.0,237.0,278.0,284.0,277.0,317.0,313.0,318.0,374.0,413.0,405.0,355.0,306.0,271.0,306.0,315.0,301.0,356.0,348.0,355.0,422.0,465.0,467.0,404.0,347.0,305.0,336.0,340.0,318.0,362.0,348.0,363.0,435.0,491.0,505.0,404.0,359.0,310.0,337.0,360.0,342.0,406.0,396.0,420.0,472.0,548.0,559.0,463.0,407.0,362.0,405.0,417.0,391.0,419.0,461.0,472.0,535.0,622.0,606.0,508.0,461.0,390.0,432.0]}], {\"showlegend\":true,\"template\":{\"data\":{\"bar\":[{\"error_x\":{\"color\":\"rgb(51,51,51)\"},\"error_y\":{\"color\":\"rgb(51,51,51)\"},\"marker\":{\"line\":{\"color\":\"rgb(237,237,237)\",\"width\":0.5},\"pattern\":{\"fillmode\":\"overlay\",\"size\":10,\"solidity\":0.2}},\"type\":\"bar\"}],\"barpolar\":[{\"marker\":{\"line\":{\"color\":\"rgb(237,237,237)\",\"width\":0.5},\"pattern\":{\"fillmode\":\"overlay\",\"size\":10,\"solidity\":0.2}},\"type\":\"barpolar\"}],\"carpet\":[{\"aaxis\":{\"endlinecolor\":\"rgb(51,51,51)\",\"gridcolor\":\"white\",\"linecolor\":\"white\",\"minorgridcolor\":\"white\",\"startlinecolor\":\"rgb(51,51,51)\"},\"baxis\":{\"endlinecolor\":\"rgb(51,51,51)\",\"gridcolor\":\"white\",\"linecolor\":\"white\",\"minorgridcolor\":\"white\",\"startlinecolor\":\"rgb(51,51,51)\"},\"type\":\"carpet\"}],\"choropleth\":[{\"colorbar\":{\"outlinewidth\":0,\"tickcolor\":\"rgb(237,237,237)\",\"ticklen\":6,\"ticks\":\"inside\"},\"type\":\"choropleth\"}],\"contour\":[{\"colorbar\":{\"outlinewidth\":0,\"tickcolor\":\"rgb(237,237,237)\",\"ticklen\":6,\"ticks\":\"inside\"},\"colorscale\":[[0,\"rgb(20,44,66)\"],[1,\"rgb(90,179,244)\"]],\"type\":\"contour\"}],\"contourcarpet\":[{\"colorbar\":{\"outlinewidth\":0,\"tickcolor\":\"rgb(237,237,237)\",\"ticklen\":6,\"ticks\":\"inside\"},\"type\":\"contourcarpet\"}],\"heatmap\":[{\"colorbar\":{\"outlinewidth\":0,\"tickcolor\":\"rgb(237,237,237)\",\"ticklen\":6,\"ticks\":\"inside\"},\"colorscale\":[[0,\"rgb(20,44,66)\"],[1,\"rgb(90,179,244)\"]],\"type\":\"heatmap\"}],\"heatmapgl\":[{\"colorbar\":{\"outlinewidth\":0,\"tickcolor\":\"rgb(237,237,237)\",\"ticklen\":6,\"ticks\":\"inside\"},\"colorscale\":[[0,\"rgb(20,44,66)\"],[1,\"rgb(90,179,244)\"]],\"type\":\"heatmapgl\"}],\"histogram\":[{\"marker\":{\"pattern\":{\"fillmode\":\"overlay\",\"size\":10,\"solidity\":0.2}},\"type\":\"histogram\"}],\"histogram2d\":[{\"colorbar\":{\"outlinewidth\":0,\"tickcolor\":\"rgb(237,237,237)\",\"ticklen\":6,\"ticks\":\"inside\"},\"colorscale\":[[0,\"rgb(20,44,66)\"],[1,\"rgb(90,179,244)\"]],\"type\":\"histogram2d\"}],\"histogram2dcontour\":[{\"colorbar\":{\"outlinewidth\":0,\"tickcolor\":\"rgb(237,237,237)\",\"ticklen\":6,\"ticks\":\"inside\"},\"colorscale\":[[0,\"rgb(20,44,66)\"],[1,\"rgb(90,179,244)\"]],\"type\":\"histogram2dcontour\"}],\"mesh3d\":[{\"colorbar\":{\"outlinewidth\":0,\"tickcolor\":\"rgb(237,237,237)\",\"ticklen\":6,\"ticks\":\"inside\"},\"type\":\"mesh3d\"}],\"parcoords\":[{\"line\":{\"colorbar\":{\"outlinewidth\":0,\"tickcolor\":\"rgb(237,237,237)\",\"ticklen\":6,\"ticks\":\"inside\"}},\"type\":\"parcoords\"}],\"pie\":[{\"automargin\":true,\"type\":\"pie\"}],\"scatter\":[{\"marker\":{\"colorbar\":{\"outlinewidth\":0,\"tickcolor\":\"rgb(237,237,237)\",\"ticklen\":6,\"ticks\":\"inside\"}},\"type\":\"scatter\"}],\"scatter3d\":[{\"line\":{\"colorbar\":{\"outlinewidth\":0,\"tickcolor\":\"rgb(237,237,237)\",\"ticklen\":6,\"ticks\":\"inside\"}},\"marker\":{\"colorbar\":{\"outlinewidth\":0,\"tickcolor\":\"rgb(237,237,237)\",\"ticklen\":6,\"ticks\":\"inside\"}},\"type\":\"scatter3d\"}],\"scattercarpet\":[{\"marker\":{\"colorbar\":{\"outlinewidth\":0,\"tickcolor\":\"rgb(237,237,237)\",\"ticklen\":6,\"ticks\":\"inside\"}},\"type\":\"scattercarpet\"}],\"scattergeo\":[{\"marker\":{\"colorbar\":{\"outlinewidth\":0,\"tickcolor\":\"rgb(237,237,237)\",\"ticklen\":6,\"ticks\":\"inside\"}},\"type\":\"scattergeo\"}],\"scattergl\":[{\"marker\":{\"colorbar\":{\"outlinewidth\":0,\"tickcolor\":\"rgb(237,237,237)\",\"ticklen\":6,\"ticks\":\"inside\"}},\"type\":\"scattergl\"}],\"scattermapbox\":[{\"marker\":{\"colorbar\":{\"outlinewidth\":0,\"tickcolor\":\"rgb(237,237,237)\",\"ticklen\":6,\"ticks\":\"inside\"}},\"type\":\"scattermapbox\"}],\"scatterpolar\":[{\"marker\":{\"colorbar\":{\"outlinewidth\":0,\"tickcolor\":\"rgb(237,237,237)\",\"ticklen\":6,\"ticks\":\"inside\"}},\"type\":\"scatterpolar\"}],\"scatterpolargl\":[{\"marker\":{\"colorbar\":{\"outlinewidth\":0,\"tickcolor\":\"rgb(237,237,237)\",\"ticklen\":6,\"ticks\":\"inside\"}},\"type\":\"scatterpolargl\"}],\"scatterternary\":[{\"marker\":{\"colorbar\":{\"outlinewidth\":0,\"tickcolor\":\"rgb(237,237,237)\",\"ticklen\":6,\"ticks\":\"inside\"}},\"type\":\"scatterternary\"}],\"surface\":[{\"colorbar\":{\"outlinewidth\":0,\"tickcolor\":\"rgb(237,237,237)\",\"ticklen\":6,\"ticks\":\"inside\"},\"colorscale\":[[0,\"rgb(20,44,66)\"],[1,\"rgb(90,179,244)\"]],\"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\":0,\"tickcolor\":\"rgb(237,237,237)\",\"ticklen\":6,\"ticks\":\"inside\"}},\"colorscale\":{\"sequential\":[[0,\"rgb(20,44,66)\"],[1,\"rgb(90,179,244)\"]],\"sequentialminus\":[[0,\"rgb(20,44,66)\"],[1,\"rgb(90,179,244)\"]]},\"colorway\":[\"#F8766D\",\"#A3A500\",\"#00BF7D\",\"#00B0F6\",\"#E76BF3\"],\"font\":{\"color\":\"rgb(51,51,51)\"},\"geo\":{\"bgcolor\":\"white\",\"lakecolor\":\"white\",\"landcolor\":\"rgb(237,237,237)\",\"showlakes\":true,\"showland\":true,\"subunitcolor\":\"white\"},\"hoverlabel\":{\"align\":\"left\"},\"hovermode\":\"closest\",\"paper_bgcolor\":\"white\",\"plot_bgcolor\":\"rgb(237,237,237)\",\"polar\":{\"angularaxis\":{\"gridcolor\":\"white\",\"linecolor\":\"white\",\"showgrid\":true,\"tickcolor\":\"rgb(51,51,51)\",\"ticks\":\"outside\"},\"bgcolor\":\"rgb(237,237,237)\",\"radialaxis\":{\"gridcolor\":\"white\",\"linecolor\":\"white\",\"showgrid\":true,\"tickcolor\":\"rgb(51,51,51)\",\"ticks\":\"outside\"}},\"scene\":{\"xaxis\":{\"backgroundcolor\":\"rgb(237,237,237)\",\"gridcolor\":\"white\",\"gridwidth\":2,\"linecolor\":\"white\",\"showbackground\":true,\"showgrid\":true,\"tickcolor\":\"rgb(51,51,51)\",\"ticks\":\"outside\",\"zerolinecolor\":\"white\"},\"yaxis\":{\"backgroundcolor\":\"rgb(237,237,237)\",\"gridcolor\":\"white\",\"gridwidth\":2,\"linecolor\":\"white\",\"showbackground\":true,\"showgrid\":true,\"tickcolor\":\"rgb(51,51,51)\",\"ticks\":\"outside\",\"zerolinecolor\":\"white\"},\"zaxis\":{\"backgroundcolor\":\"rgb(237,237,237)\",\"gridcolor\":\"white\",\"gridwidth\":2,\"linecolor\":\"white\",\"showbackground\":true,\"showgrid\":true,\"tickcolor\":\"rgb(51,51,51)\",\"ticks\":\"outside\",\"zerolinecolor\":\"white\"}},\"shapedefaults\":{\"fillcolor\":\"black\",\"line\":{\"width\":0},\"opacity\":0.3},\"ternary\":{\"aaxis\":{\"gridcolor\":\"white\",\"linecolor\":\"white\",\"showgrid\":true,\"tickcolor\":\"rgb(51,51,51)\",\"ticks\":\"outside\"},\"baxis\":{\"gridcolor\":\"white\",\"linecolor\":\"white\",\"showgrid\":true,\"tickcolor\":\"rgb(51,51,51)\",\"ticks\":\"outside\"},\"bgcolor\":\"rgb(237,237,237)\",\"caxis\":{\"gridcolor\":\"white\",\"linecolor\":\"white\",\"showgrid\":true,\"tickcolor\":\"rgb(51,51,51)\",\"ticks\":\"outside\"}},\"xaxis\":{\"automargin\":true,\"gridcolor\":\"white\",\"linecolor\":\"white\",\"showgrid\":true,\"tickcolor\":\"rgb(51,51,51)\",\"ticks\":\"outside\",\"title\":{\"standoff\":15},\"zerolinecolor\":\"white\"},\"yaxis\":{\"automargin\":true,\"gridcolor\":\"white\",\"linecolor\":\"white\",\"showgrid\":true,\"tickcolor\":\"rgb(51,51,51)\",\"ticks\":\"outside\",\"title\":{\"standoff\":15},\"zerolinecolor\":\"white\"}}},\"title\":{\"text\":\"Actual vs. Forecast | Number of airline passengers\"},\"xaxis\":{\"title\":{\"text\":\"Time\"}},\"yaxis\":{\"title\":{\"text\":\"Values\"}}}, {\"responsive\": true} ).then(function(){\n",
" \n",
"var gd = document.getElementById('7767608f-94bf-4064-8c50-c5d85fc2f07f');\n",
"var x = new MutationObserver(function (mutations, observer) {{\n",
" var display = window.getComputedStyle(gd).display;\n",
" if (!display || display === 'none') {{\n",
" console.log([gd, 'removed!']);\n",
" Plotly.purge(gd);\n",
" observer.disconnect();\n",
" }}\n",
"}});\n",
"\n",
"// Listen for the removal of the full notebook cells\n",
"var notebookContainer = gd.closest('#notebook-container');\n",
"if (notebookContainer) {{\n",
" x.observe(notebookContainer, {childList: true});\n",
"}}\n",
"\n",
"// Listen for the clearing of the current output cell\n",
"var outputEl = gd.closest('.output');\n",
"if (outputEl) {{\n",
" x.observe(outputEl, {childList: true});\n",
"}}\n",
"\n",
" }) }; </script> </div>\n",
"</body>\n",
"</html>"
]
},
"metadata": {}
},
{
"output_type": "display_data",
"data": {
"text/html": [
"<html>\n",
"<head><meta charset=\"utf-8\" /></head>\n",
"<body>\n",
" <div> <script src=\"https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js?config=TeX-AMS-MML_SVG\"></script><script type=\"text/javascript\">if (window.MathJax) {MathJax.Hub.Config({SVG: {font: \"STIX-Web\"}});}</script> <script type=\"text/javascript\">window.PlotlyConfig = {MathJaxConfig: 'local'};</script>\n",
" <script src=\"https://cdn.plot.ly/plotly-2.4.2.min.js\"></script> <div id=\"996742ff-d4d7-4061-8a6c-56a1ee6d3de4\" class=\"plotly-graph-div\" style=\"height:525px; width:100%;\"></div> <script type=\"text/javascript\"> window.PLOTLYENV=window.PLOTLYENV || {}; if (document.getElementById(\"996742ff-d4d7-4061-8a6c-56a1ee6d3de4\")) { Plotly.newPlot( \"996742ff-d4d7-4061-8a6c-56a1ee6d3de4\", [{\"line\":{\"width\":0},\"marker\":{\"color\":\"#68BBE3\"},\"mode\":\"lines\",\"name\":\"Lower Interval\",\"showlegend\":false,\"type\":\"scatter\",\"x\":[\"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\":[400.7032,371.1461,427.2937,411.599,431.3417,480.1001,553.6005,562.6548,465.1292,407.9258,361.9721,404.2133]},{\"fill\":\"tonexty\",\"fillcolor\":\"#68BBE3\",\"line\":{\"color\":\"#1f77b4\"},\"marker\":{\"size\":5},\"mode\":\"lines+markers\",\"name\":\"Forecast | ARIMA\",\"showlegend\":true,\"type\":\"scatter\",\"x\":[\"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\":[420.8767,397.1069,456.4335,442.6482,463.5822,513.0988,587.0872,596.458,499.1383,442.0694,396.2036,438.5023]},{\"fill\":\"tonexty\",\"fillcolor\":\"#68BBE3\",\"line\":{\"width\":0},\"marker\":{\"color\":\"#68BBE3\"},\"mode\":\"lines\",\"name\":\"Prediction Interval | ARIMA\",\"showlegend\":true,\"type\":\"scatter\",\"x\":[\"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\":[441.0501,423.0677,485.5734,473.6974,495.8226,546.0974,620.574,630.2611,533.1474,476.2129,430.4351,472.7914]},{\"marker\":{\"color\":\"#3f3f3f\",\"size\":5},\"mode\":\"lines+markers\",\"name\":\"Original\",\"showlegend\":true,\"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\",\"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\":[112.0,118.0,132.0,129.0,121.0,135.0,148.0,148.0,136.0,119.0,104.0,118.0,115.0,126.0,141.0,135.0,125.0,149.0,170.0,170.0,158.0,133.0,114.0,140.0,145.0,150.0,178.0,163.0,172.0,178.0,199.0,199.0,184.0,162.0,146.0,166.0,171.0,180.0,193.0,181.0,183.0,218.0,230.0,242.0,209.0,191.0,172.0,194.0,196.0,196.0,236.0,235.0,229.0,243.0,264.0,272.0,237.0,211.0,180.0,201.0,204.0,188.0,235.0,227.0,234.0,264.0,302.0,293.0,259.0,229.0,203.0,229.0,242.0,233.0,267.0,269.0,270.0,315.0,364.0,347.0,312.0,274.0,237.0,278.0,284.0,277.0,317.0,313.0,318.0,374.0,413.0,405.0,355.0,306.0,271.0,306.0,315.0,301.0,356.0,348.0,355.0,422.0,465.0,467.0,404.0,347.0,305.0,336.0,340.0,318.0,362.0,348.0,363.0,435.0,491.0,505.0,404.0,359.0,310.0,337.0,360.0,342.0,406.0,396.0,420.0,472.0,548.0,559.0,463.0,407.0,362.0,405.0,417.0,391.0,419.0,461.0,472.0,535.0,622.0,606.0,508.0,461.0,390.0,432.0]}], {\"showlegend\":true,\"template\":{\"data\":{\"bar\":[{\"error_x\":{\"color\":\"rgb(51,51,51)\"},\"error_y\":{\"color\":\"rgb(51,51,51)\"},\"marker\":{\"line\":{\"color\":\"rgb(237,237,237)\",\"width\":0.5},\"pattern\":{\"fillmode\":\"overlay\",\"size\":10,\"solidity\":0.2}},\"type\":\"bar\"}],\"barpolar\":[{\"marker\":{\"line\":{\"color\":\"rgb(237,237,237)\",\"width\":0.5},\"pattern\":{\"fillmode\":\"overlay\",\"size\":10,\"solidity\":0.2}},\"type\":\"barpolar\"}],\"carpet\":[{\"aaxis\":{\"endlinecolor\":\"rgb(51,51,51)\",\"gridcolor\":\"white\",\"linecolor\":\"white\",\"minorgridcolor\":\"white\",\"startlinecolor\":\"rgb(51,51,51)\"},\"baxis\":{\"endlinecolor\":\"rgb(51,51,51)\",\"gridcolor\":\"white\",\"linecolor\":\"white\",\"minorgridcolor\":\"white\",\"startlinecolor\":\"rgb(51,51,51)\"},\"type\":\"carpet\"}],\"choropleth\":[{\"colorbar\":{\"outlinewidth\":0,\"tickcolor\":\"rgb(237,237,237)\",\"ticklen\":6,\"ticks\":\"inside\"},\"type\":\"choropleth\"}],\"contour\":[{\"colorbar\":{\"outlinewidth\":0,\"tickcolor\":\"rgb(237,237,237)\",\"ticklen\":6,\"ticks\":\"inside\"},\"colorscale\":[[0,\"rgb(20,44,66)\"],[1,\"rgb(90,179,244)\"]],\"type\":\"contour\"}],\"contourcarpet\":[{\"colorbar\":{\"outlinewidth\":0,\"tickcolor\":\"rgb(237,237,237)\",\"ticklen\":6,\"ticks\":\"inside\"},\"type\":\"contourcarpet\"}],\"heatmap\":[{\"colorbar\":{\"outlinewidth\":0,\"tickcolor\":\"rgb(237,237,237)\",\"ticklen\":6,\"ticks\":\"inside\"},\"colorscale\":[[0,\"rgb(20,44,66)\"],[1,\"rgb(90,179,244)\"]],\"type\":\"heatmap\"}],\"heatmapgl\":[{\"colorbar\":{\"outlinewidth\":0,\"tickcolor\":\"rgb(237,237,237)\",\"ticklen\":6,\"ticks\":\"inside\"},\"colorscale\":[[0,\"rgb(20,44,66)\"],[1,\"rgb(90,179,244)\"]],\"type\":\"heatmapgl\"}],\"histogram\":[{\"marker\":{\"pattern\":{\"fillmode\":\"overlay\",\"size\":10,\"solidity\":0.2}},\"type\":\"histogram\"}],\"histogram2d\":[{\"colorbar\":{\"outlinewidth\":0,\"tickcolor\":\"rgb(237,237,237)\",\"ticklen\":6,\"ticks\":\"inside\"},\"colorscale\":[[0,\"rgb(20,44,66)\"],[1,\"rgb(90,179,244)\"]],\"type\":\"histogram2d\"}],\"histogram2dcontour\":[{\"colorbar\":{\"outlinewidth\":0,\"tickcolor\":\"rgb(237,237,237)\",\"ticklen\":6,\"ticks\":\"inside\"},\"colorscale\":[[0,\"rgb(20,44,66)\"],[1,\"rgb(90,179,244)\"]],\"type\":\"histogram2dcontour\"}],\"mesh3d\":[{\"colorbar\":{\"outlinewidth\":0,\"tickcolor\":\"rgb(237,237,237)\",\"ticklen\":6,\"ticks\":\"inside\"},\"type\":\"mesh3d\"}],\"parcoords\":[{\"line\":{\"colorbar\":{\"outlinewidth\":0,\"tickcolor\":\"rgb(237,237,237)\",\"ticklen\":6,\"ticks\":\"inside\"}},\"type\":\"parcoords\"}],\"pie\":[{\"automargin\":true,\"type\":\"pie\"}],\"scatter\":[{\"marker\":{\"colorbar\":{\"outlinewidth\":0,\"tickcolor\":\"rgb(237,237,237)\",\"ticklen\":6,\"ticks\":\"inside\"}},\"type\":\"scatter\"}],\"scatter3d\":[{\"line\":{\"colorbar\":{\"outlinewidth\":0,\"tickcolor\":\"rgb(237,237,237)\",\"ticklen\":6,\"ticks\":\"inside\"}},\"marker\":{\"colorbar\":{\"outlinewidth\":0,\"tickcolor\":\"rgb(237,237,237)\",\"ticklen\":6,\"ticks\":\"inside\"}},\"type\":\"scatter3d\"}],\"scattercarpet\":[{\"marker\":{\"colorbar\":{\"outlinewidth\":0,\"tickcolor\":\"rgb(237,237,237)\",\"ticklen\":6,\"ticks\":\"inside\"}},\"type\":\"scattercarpet\"}],\"scattergeo\":[{\"marker\":{\"colorbar\":{\"outlinewidth\":0,\"tickcolor\":\"rgb(237,237,237)\",\"ticklen\":6,\"ticks\":\"inside\"}},\"type\":\"scattergeo\"}],\"scattergl\":[{\"marker\":{\"colorbar\":{\"outlinewidth\":0,\"tickcolor\":\"rgb(237,237,237)\",\"ticklen\":6,\"ticks\":\"inside\"}},\"type\":\"scattergl\"}],\"scattermapbox\":[{\"marker\":{\"colorbar\":{\"outlinewidth\":0,\"tickcolor\":\"rgb(237,237,237)\",\"ticklen\":6,\"ticks\":\"inside\"}},\"type\":\"scattermapbox\"}],\"scatterpolar\":[{\"marker\":{\"colorbar\":{\"outlinewidth\":0,\"tickcolor\":\"rgb(237,237,237)\",\"ticklen\":6,\"ticks\":\"inside\"}},\"type\":\"scatterpolar\"}],\"scatterpolargl\":[{\"marker\":{\"colorbar\":{\"outlinewidth\":0,\"tickcolor\":\"rgb(237,237,237)\",\"ticklen\":6,\"ticks\":\"inside\"}},\"type\":\"scatterpolargl\"}],\"scatterternary\":[{\"marker\":{\"colorbar\":{\"outlinewidth\":0,\"tickcolor\":\"rgb(237,237,237)\",\"ticklen\":6,\"ticks\":\"inside\"}},\"type\":\"scatterternary\"}],\"surface\":[{\"colorbar\":{\"outlinewidth\":0,\"tickcolor\":\"rgb(237,237,237)\",\"ticklen\":6,\"ticks\":\"inside\"},\"colorscale\":[[0,\"rgb(20,44,66)\"],[1,\"rgb(90,179,244)\"]],\"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\":0,\"tickcolor\":\"rgb(237,237,237)\",\"ticklen\":6,\"ticks\":\"inside\"}},\"colorscale\":{\"sequential\":[[0,\"rgb(20,44,66)\"],[1,\"rgb(90,179,244)\"]],\"sequentialminus\":[[0,\"rgb(20,44,66)\"],[1,\"rgb(90,179,244)\"]]},\"colorway\":[\"#F8766D\",\"#A3A500\",\"#00BF7D\",\"#00B0F6\",\"#E76BF3\"],\"font\":{\"color\":\"rgb(51,51,51)\"},\"geo\":{\"bgcolor\":\"white\",\"lakecolor\":\"white\",\"landcolor\":\"rgb(237,237,237)\",\"showlakes\":true,\"showland\":true,\"subunitcolor\":\"white\"},\"hoverlabel\":{\"align\":\"left\"},\"hovermode\":\"closest\",\"paper_bgcolor\":\"white\",\"plot_bgcolor\":\"rgb(237,237,237)\",\"polar\":{\"angularaxis\":{\"gridcolor\":\"white\",\"linecolor\":\"white\",\"showgrid\":true,\"tickcolor\":\"rgb(51,51,51)\",\"ticks\":\"outside\"},\"bgcolor\":\"rgb(237,237,237)\",\"radialaxis\":{\"gridcolor\":\"white\",\"linecolor\":\"white\",\"showgrid\":true,\"tickcolor\":\"rgb(51,51,51)\",\"ticks\":\"outside\"}},\"scene\":{\"xaxis\":{\"backgroundcolor\":\"rgb(237,237,237)\",\"gridcolor\":\"white\",\"gridwidth\":2,\"linecolor\":\"white\",\"showbackground\":true,\"showgrid\":true,\"tickcolor\":\"rgb(51,51,51)\",\"ticks\":\"outside\",\"zerolinecolor\":\"white\"},\"yaxis\":{\"backgroundcolor\":\"rgb(237,237,237)\",\"gridcolor\":\"white\",\"gridwidth\":2,\"linecolor\":\"white\",\"showbackground\":true,\"showgrid\":true,\"tickcolor\":\"rgb(51,51,51)\",\"ticks\":\"outside\",\"zerolinecolor\":\"white\"},\"zaxis\":{\"backgroundcolor\":\"rgb(237,237,237)\",\"gridcolor\":\"white\",\"gridwidth\":2,\"linecolor\":\"white\",\"showbackground\":true,\"showgrid\":true,\"tickcolor\":\"rgb(51,51,51)\",\"ticks\":\"outside\",\"zerolinecolor\":\"white\"}},\"shapedefaults\":{\"fillcolor\":\"black\",\"line\":{\"width\":0},\"opacity\":0.3},\"ternary\":{\"aaxis\":{\"gridcolor\":\"white\",\"linecolor\":\"white\",\"showgrid\":true,\"tickcolor\":\"rgb(51,51,51)\",\"ticks\":\"outside\"},\"baxis\":{\"gridcolor\":\"white\",\"linecolor\":\"white\",\"showgrid\":true,\"tickcolor\":\"rgb(51,51,51)\",\"ticks\":\"outside\"},\"bgcolor\":\"rgb(237,237,237)\",\"caxis\":{\"gridcolor\":\"white\",\"linecolor\":\"white\",\"showgrid\":true,\"tickcolor\":\"rgb(51,51,51)\",\"ticks\":\"outside\"}},\"xaxis\":{\"automargin\":true,\"gridcolor\":\"white\",\"linecolor\":\"white\",\"showgrid\":true,\"tickcolor\":\"rgb(51,51,51)\",\"ticks\":\"outside\",\"title\":{\"standoff\":15},\"zerolinecolor\":\"white\"},\"yaxis\":{\"automargin\":true,\"gridcolor\":\"white\",\"linecolor\":\"white\",\"showgrid\":true,\"tickcolor\":\"rgb(51,51,51)\",\"ticks\":\"outside\",\"title\":{\"standoff\":15},\"zerolinecolor\":\"white\"}}},\"title\":{\"text\":\"Actual vs. Forecast | Number of airline passengers\"},\"xaxis\":{\"title\":{\"text\":\"Time\"}},\"yaxis\":{\"title\":{\"text\":\"Values\"}}}, {\"responsive\": true} ).then(function(){\n",
" \n",
"var gd = document.getElementById('996742ff-d4d7-4061-8a6c-56a1ee6d3de4');\n",
"var x = new MutationObserver(function (mutations, observer) {{\n",
" var display = window.getComputedStyle(gd).display;\n",
" if (!display || display === 'none') {{\n",
" console.log([gd, 'removed!']);\n",
" Plotly.purge(gd);\n",
" observer.disconnect();\n",
" }}\n",
"}});\n",
"\n",
"// Listen for the removal of the full notebook cells\n",
"var notebookContainer = gd.closest('#notebook-container');\n",
"if (notebookContainer) {{\n",
" x.observe(notebookContainer, {childList: true});\n",
"}}\n",
"\n",
"// Listen for the clearing of the current output cell\n",
"var outputEl = gd.closest('.output');\n",
"if (outputEl) {{\n",
" x.observe(outputEl, {childList: true});\n",
"}}\n",
"\n",
" }) }; </script> </div>\n",
"</body>\n",
"</html>"
]
},
"metadata": {}
}
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "ZvNJ9Q-iASPr"
},
"source": [
"### Controlling the Run Time"
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "yGr8XpUV4IqD"
},
"source": [
"By default, `compare_models` will only run fast models. Slower models such as `bats`, `tbats`, `prophet` are not run by default. We can enable these models by setting `turbo=False` in the `compare_models` call."
]
},
{
"cell_type": "code",
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/",
"height": 928,
"referenced_widgets": [
"9ef9c4e16aad4c70ab47dee085ef62a0",
"9c112b82a124419c8409bbd04156006c",
"bcf5ad1c82a34d9b82d2959775df4d42"
]
},
"id": "EztoWr-13XXJ",
"outputId": "fb77a728-5eea-4969-e133-aa8e3a3273bb"
},
"source": [
"all_baseline_inc_slow = exp.compare_models(turbo=False)"
],
"execution_count": 11,
"outputs": [
{
"output_type": "display_data",
"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>Model</th>\n",
" <th>MAE</th>\n",
" <th>RMSE</th>\n",
" <th>MAPE</th>\n",
" <th>SMAPE</th>\n",
" <th>R2</th>\n",
" <th>TT (Sec)</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>exp_smooth</th>\n",
" <td>Exponential Smoothing</td>\n",
" <td>16.7773</td>\n",
" <td>19.7959</td>\n",
" <td>0.0422</td>\n",
" <td>0.0427</td>\n",
" <td>0.8954</td>\n",
" <td>0.1367</td>\n",
" </tr>\n",
" <tr>\n",
" <th>ets</th>\n",
" <td>ETS</td>\n",
" <td>17.4191</td>\n",
" <td>20.5125</td>\n",
" <td>0.044</td>\n",
" <td>0.0445</td>\n",
" <td>0.8882</td>\n",
" <td>0.2033</td>\n",
" </tr>\n",
" <tr>\n",
" <th>arima</th>\n",
" <td>ARIMA</td>\n",
" <td>20.0069</td>\n",
" <td>22.2199</td>\n",
" <td>0.0501</td>\n",
" <td>0.0507</td>\n",
" <td>0.8677</td>\n",
" <td>0.0767</td>\n",
" </tr>\n",
" <tr>\n",
" <th>auto_arima</th>\n",
" <td>Auto ARIMA</td>\n",
" <td>21.0297</td>\n",
" <td>23.4661</td>\n",
" <td>0.0525</td>\n",
" <td>0.0531</td>\n",
" <td>0.8509</td>\n",
" <td>4.2933</td>\n",
" </tr>\n",
" <tr>\n",
" <th>tbats</th>\n",
" <td>TBATS</td>\n",
" <td>23.8716</td>\n",
" <td>28.4979</td>\n",
" <td>0.0586</td>\n",
" <td>0.0593</td>\n",
" <td>0.7707</td>\n",
" <td>26.4000</td>\n",
" </tr>\n",
" <tr>\n",
" <th>et_cds_dt</th>\n",
" <td>Extra Trees w/ Cond. Deseasonalize &amp; Detrending</td>\n",
" <td>24.4233</td>\n",
" <td>31.4395</td>\n",
" <td>0.0584</td>\n",
" <td>0.0601</td>\n",
" <td>0.7169</td>\n",
" <td>0.9733</td>\n",
" </tr>\n",
" <tr>\n",
" <th>knn_cds_dt</th>\n",
" <td>K Neighbors w/ Cond. Deseasonalize &amp; Detrending</td>\n",
" <td>25.8293</td>\n",
" <td>34.9633</td>\n",
" <td>0.0617</td>\n",
" <td>0.0641</td>\n",
" <td>0.626</td>\n",
" <td>0.8367</td>\n",
" </tr>\n",
" <tr>\n",
" <th>rf_cds_dt</th>\n",
" <td>Random Forest w/ Cond. Deseasonalize &amp; Detrending</td>\n",
" <td>26.8586</td>\n",
" <td>38.0499</td>\n",
" <td>0.0629</td>\n",
" <td>0.0654</td>\n",
" <td>0.6023</td>\n",
" <td>1.0067</td>\n",
" </tr>\n",
" <tr>\n",
" <th>bats</th>\n",
" <td>BATS</td>\n",
" <td>27.9542</td>\n",
" <td>33.2127</td>\n",
" <td>0.0651</td>\n",
" <td>0.0685</td>\n",
" <td>0.6532</td>\n",
" <td>10.4600</td>\n",
" </tr>\n",
" <tr>\n",
" <th>ada_cds_dt</th>\n",
" <td>AdaBoost w/ Cond. Deseasonalize &amp; Detrending</td>\n",
" <td>27.82</td>\n",
" <td>37.791</td>\n",
" <td>0.0661</td>\n",
" <td>0.0686</td>\n",
" <td>0.6015</td>\n",
" <td>0.1167</td>\n",
" </tr>\n",
" <tr>\n",
" <th>theta</th>\n",
" <td>Theta Forecaster</td>\n",
" <td>28.3192</td>\n",
" <td>33.8639</td>\n",
" <td>0.067</td>\n",
" <td>0.07</td>\n",
" <td>0.671</td>\n",
" <td>0.0200</td>\n",
" </tr>\n",
" <tr>\n",
" <th>gbr_cds_dt</th>\n",
" <td>Gradient Boosting w/ Cond. Deseasonalize &amp; Det...</td>\n",
" <td>29.1314</td>\n",
" <td>38.308</td>\n",
" <td>0.0685</td>\n",
" <td>0.0715</td>\n",
" <td>0.5855</td>\n",
" <td>0.0700</td>\n",
" </tr>\n",
" <tr>\n",
" <th>lightgbm_cds_dt</th>\n",
" <td>Light Gradient Boosting w/ Cond. Deseasonalize...</td>\n",
" <td>28.7738</td>\n",
" <td>36.2392</td>\n",
" <td>0.0698</td>\n",
" <td>0.0722</td>\n",
" <td>0.6255</td>\n",
" <td>0.0367</td>\n",
" </tr>\n",
" <tr>\n",
" <th>prophet</th>\n",
" <td>Prophet</td>\n",
" <td>30.239</td>\n",
" <td>35.6676</td>\n",
" <td>0.0782</td>\n",
" <td>0.0764</td>\n",
" <td>0.654</td>\n",
" <td>2.1567</td>\n",
" </tr>\n",
" <tr>\n",
" <th>br_cds_dt</th>\n",
" <td>Bayesian Ridge w/ Cond. Deseasonalize &amp; Detren...</td>\n",
" <td>32.0341</td>\n",
" <td>39.2191</td>\n",
" <td>0.0799</td>\n",
" <td>0.0818</td>\n",
" <td>0.5658</td>\n",
" <td>0.0233</td>\n",
" </tr>\n",
" <tr>\n",
" <th>lasso_cds_dt</th>\n",
" <td>Lasso w/ Cond. Deseasonalize &amp; Detrending</td>\n",
" <td>32.8026</td>\n",
" <td>39.2084</td>\n",
" <td>0.0823</td>\n",
" <td>0.0841</td>\n",
" <td>0.5678</td>\n",
" <td>0.0267</td>\n",
" </tr>\n",
" <tr>\n",
" <th>en_cds_dt</th>\n",
" <td>Elastic Net w/ Cond. Deseasonalize &amp; Detrending</td>\n",
" <td>32.8556</td>\n",
" <td>39.2557</td>\n",
" <td>0.0825</td>\n",
" <td>0.0843</td>\n",
" <td>0.5669</td>\n",
" <td>0.7800</td>\n",
" </tr>\n",
" <tr>\n",
" <th>lr_cds_dt</th>\n",
" <td>Linear w/ Cond. Deseasonalize &amp; Detrending</td>\n",
" <td>32.9708</td>\n",
" <td>39.3456</td>\n",
" <td>0.0828</td>\n",
" <td>0.0846</td>\n",
" <td>0.5652</td>\n",
" <td>0.0400</td>\n",
" </tr>\n",
" <tr>\n",
" <th>ridge_cds_dt</th>\n",
" <td>Ridge w/ Cond. Deseasonalize &amp; Detrending</td>\n",
" <td>32.9702</td>\n",
" <td>39.3452</td>\n",
" <td>0.0828</td>\n",
" <td>0.0846</td>\n",
" <td>0.5652</td>\n",
" <td>0.0233</td>\n",
" </tr>\n",
" <tr>\n",
" <th>dt_cds_dt</th>\n",
" <td>Decision Tree w/ Cond. Deseasonalize &amp; Detrending</td>\n",
" <td>35.1446</td>\n",
" <td>45.8861</td>\n",
" <td>0.0826</td>\n",
" <td>0.0869</td>\n",
" <td>0.4284</td>\n",
" <td>0.0300</td>\n",
" </tr>\n",
" <tr>\n",
" <th>snaive</th>\n",
" <td>Seasonal Naive Forecaster</td>\n",
" <td>33.3611</td>\n",
" <td>35.9139</td>\n",
" <td>0.0832</td>\n",
" <td>0.0879</td>\n",
" <td>0.6072</td>\n",
" <td>0.0167</td>\n",
" </tr>\n",
" <tr>\n",
" <th>huber_cds_dt</th>\n",
" <td>Huber w/ Cond. Deseasonalize &amp; Detrending</td>\n",
" <td>35.4709</td>\n",
" <td>41.1489</td>\n",
" <td>0.091</td>\n",
" <td>0.0936</td>\n",
" <td>0.5226</td>\n",
" <td>0.0433</td>\n",
" </tr>\n",
" <tr>\n",
" <th>lar_cds_dt</th>\n",
" <td>Least Angular Regressor w/ Cond. Deseasonalize...</td>\n",
" <td>36.5285</td>\n",
" <td>42.4001</td>\n",
" <td>0.0936</td>\n",
" <td>0.0945</td>\n",
" <td>0.5058</td>\n",
" <td>0.0267</td>\n",
" </tr>\n",
" <tr>\n",
" <th>llar_cds_dt</th>\n",
" <td>Lasso Least Angular Regressor w/ Cond. Deseaso...</td>\n",
" <td>46.7239</td>\n",
" <td>63.1706</td>\n",
" <td>0.1109</td>\n",
" <td>0.1165</td>\n",
" <td>-0.0733</td>\n",
" <td>0.0233</td>\n",
" </tr>\n",
" <tr>\n",
" <th>omp_cds_dt</th>\n",
" <td>Orthogonal Matching Pursuit w/ Cond. Deseasona...</td>\n",
" <td>47.2799</td>\n",
" <td>64.5891</td>\n",
" <td>0.111</td>\n",
" <td>0.1177</td>\n",
" <td>-0.1201</td>\n",
" <td>0.0233</td>\n",
" </tr>\n",
" <tr>\n",
" <th>polytrend</th>\n",
" <td>Polynomial Trend Forecaster</td>\n",
" <td>48.6301</td>\n",
" <td>63.4299</td>\n",
" <td>0.117</td>\n",
" <td>0.1216</td>\n",
" <td>-0.0784</td>\n",
" <td>0.0100</td>\n",
" </tr>\n",
" <tr>\n",
" <th>naive</th>\n",
" <td>Naive Forecaster</td>\n",
" <td>69.0278</td>\n",
" <td>91.0322</td>\n",
" <td>0.1569</td>\n",
" <td>0.1792</td>\n",
" <td>-1.2216</td>\n",
" <td>0.0133</td>\n",
" </tr>\n",
" <tr>\n",
" <th>par_cds_dt</th>\n",
" <td>Passive Aggressive w/ Cond. Deseasonalize &amp; De...</td>\n",
" <td>78.0396</td>\n",
" <td>95.4251</td>\n",
" <td>0.2137</td>\n",
" <td>0.2531</td>\n",
" <td>-3.0784</td>\n",
" <td>0.0300</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"text/plain": [
" Model MAE \\\n",
"exp_smooth Exponential Smoothing 16.7773 \n",
"ets ETS 17.4191 \n",
"arima ARIMA 20.0069 \n",
"auto_arima Auto ARIMA 21.0297 \n",
"tbats TBATS 23.8716 \n",
"et_cds_dt Extra Trees w/ Cond. Deseasonalize & Detrending 24.4233 \n",
"knn_cds_dt K Neighbors w/ Cond. Deseasonalize & Detrending 25.8293 \n",
"rf_cds_dt Random Forest w/ Cond. Deseasonalize & Detrending 26.8586 \n",
"bats BATS 27.9542 \n",
"ada_cds_dt AdaBoost w/ Cond. Deseasonalize & Detrending 27.82 \n",
"theta Theta Forecaster 28.3192 \n",
"gbr_cds_dt Gradient Boosting w/ Cond. Deseasonalize & Det... 29.1314 \n",
"lightgbm_cds_dt Light Gradient Boosting w/ Cond. Deseasonalize... 28.7738 \n",
"prophet Prophet 30.239 \n",
"br_cds_dt Bayesian Ridge w/ Cond. Deseasonalize & Detren... 32.0341 \n",
"lasso_cds_dt Lasso w/ Cond. Deseasonalize & Detrending 32.8026 \n",
"en_cds_dt Elastic Net w/ Cond. Deseasonalize & Detrending 32.8556 \n",
"lr_cds_dt Linear w/ Cond. Deseasonalize & Detrending 32.9708 \n",
"ridge_cds_dt Ridge w/ Cond. Deseasonalize & Detrending 32.9702 \n",
"dt_cds_dt Decision Tree w/ Cond. Deseasonalize & Detrending 35.1446 \n",
"snaive Seasonal Naive Forecaster 33.3611 \n",
"huber_cds_dt Huber w/ Cond. Deseasonalize & Detrending 35.4709 \n",
"lar_cds_dt Least Angular Regressor w/ Cond. Deseasonalize... 36.5285 \n",
"llar_cds_dt Lasso Least Angular Regressor w/ Cond. Deseaso... 46.7239 \n",
"omp_cds_dt Orthogonal Matching Pursuit w/ Cond. Deseasona... 47.2799 \n",
"polytrend Polynomial Trend Forecaster 48.6301 \n",
"naive Naive Forecaster 69.0278 \n",
"par_cds_dt Passive Aggressive w/ Cond. Deseasonalize & De... 78.0396 \n",
"\n",
" RMSE MAPE SMAPE R2 TT (Sec) \n",
"exp_smooth 19.7959 0.0422 0.0427 0.8954 0.1367 \n",
"ets 20.5125 0.044 0.0445 0.8882 0.2033 \n",
"arima 22.2199 0.0501 0.0507 0.8677 0.0767 \n",
"auto_arima 23.4661 0.0525 0.0531 0.8509 4.2933 \n",
"tbats 28.4979 0.0586 0.0593 0.7707 26.4000 \n",
"et_cds_dt 31.4395 0.0584 0.0601 0.7169 0.9733 \n",
"knn_cds_dt 34.9633 0.0617 0.0641 0.626 0.8367 \n",
"rf_cds_dt 38.0499 0.0629 0.0654 0.6023 1.0067 \n",
"bats 33.2127 0.0651 0.0685 0.6532 10.4600 \n",
"ada_cds_dt 37.791 0.0661 0.0686 0.6015 0.1167 \n",
"theta 33.8639 0.067 0.07 0.671 0.0200 \n",
"gbr_cds_dt 38.308 0.0685 0.0715 0.5855 0.0700 \n",
"lightgbm_cds_dt 36.2392 0.0698 0.0722 0.6255 0.0367 \n",
"prophet 35.6676 0.0782 0.0764 0.654 2.1567 \n",
"br_cds_dt 39.2191 0.0799 0.0818 0.5658 0.0233 \n",
"lasso_cds_dt 39.2084 0.0823 0.0841 0.5678 0.0267 \n",
"en_cds_dt 39.2557 0.0825 0.0843 0.5669 0.7800 \n",
"lr_cds_dt 39.3456 0.0828 0.0846 0.5652 0.0400 \n",
"ridge_cds_dt 39.3452 0.0828 0.0846 0.5652 0.0233 \n",
"dt_cds_dt 45.8861 0.0826 0.0869 0.4284 0.0300 \n",
"snaive 35.9139 0.0832 0.0879 0.6072 0.0167 \n",
"huber_cds_dt 41.1489 0.091 0.0936 0.5226 0.0433 \n",
"lar_cds_dt 42.4001 0.0936 0.0945 0.5058 0.0267 \n",
"llar_cds_dt 63.1706 0.1109 0.1165 -0.0733 0.0233 \n",
"omp_cds_dt 64.5891 0.111 0.1177 -0.1201 0.0233 \n",
"polytrend 63.4299 0.117 0.1216 -0.0784 0.0100 \n",
"naive 91.0322 0.1569 0.1792 -1.2216 0.0133 \n",
"par_cds_dt 95.4251 0.2137 0.2531 -3.0784 0.0300 "
]
},
"metadata": {}
}
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "OHZgcTCi9eEO"
},
"source": [
"Sometimes, you may want to limit the run based on a budgeted time. This is especially helpful when you have to scale to 100's and 1000's of time series but only have a limited time to cerate the models. This can be done easily using the `budget_time` argument"
]
},
{
"cell_type": "code",
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/",
"height": 206,
"referenced_widgets": [
"c59627b19ec34adfb96686cb917f6a45",
"d317616e7315492a811c5cc070a1d11b",
"2907e39d613b4a718e05feeb4bc293a4"
]
},
"id": "bjRzz79u26o6",
"outputId": "74217c1c-604a-4a0e-f2b5-12d463c67ca0"
},
"source": [
"all_baseline_some_models = exp.compare_models(turbo=False, budget_time=0.1)"
],
"execution_count": 12,
"outputs": [
{
"output_type": "display_data",
"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>Model</th>\n",
" <th>MAE</th>\n",
" <th>RMSE</th>\n",
" <th>MAPE</th>\n",
" <th>SMAPE</th>\n",
" <th>R2</th>\n",
" <th>TT (Sec)</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>arima</th>\n",
" <td>ARIMA</td>\n",
" <td>20.0069</td>\n",
" <td>22.2199</td>\n",
" <td>0.0501</td>\n",
" <td>0.0507</td>\n",
" <td>0.8677</td>\n",
" <td>0.0733</td>\n",
" </tr>\n",
" <tr>\n",
" <th>auto_arima</th>\n",
" <td>Auto ARIMA</td>\n",
" <td>21.0297</td>\n",
" <td>23.4661</td>\n",
" <td>0.0525</td>\n",
" <td>0.0531</td>\n",
" <td>0.8509</td>\n",
" <td>4.3100</td>\n",
" </tr>\n",
" <tr>\n",
" <th>snaive</th>\n",
" <td>Seasonal Naive Forecaster</td>\n",
" <td>33.3611</td>\n",
" <td>35.9139</td>\n",
" <td>0.0832</td>\n",
" <td>0.0879</td>\n",
" <td>0.6072</td>\n",
" <td>0.0133</td>\n",
" </tr>\n",
" <tr>\n",
" <th>polytrend</th>\n",
" <td>Polynomial Trend Forecaster</td>\n",
" <td>48.6301</td>\n",
" <td>63.4299</td>\n",
" <td>0.117</td>\n",
" <td>0.1216</td>\n",
" <td>-0.0784</td>\n",
" <td>0.0100</td>\n",
" </tr>\n",
" <tr>\n",
" <th>naive</th>\n",
" <td>Naive Forecaster</td>\n",
" <td>69.0278</td>\n",
" <td>91.0322</td>\n",
" <td>0.1569</td>\n",
" <td>0.1792</td>\n",
" <td>-1.2216</td>\n",
" <td>0.0133</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"text/plain": [
" Model MAE RMSE MAPE SMAPE \\\n",
"arima ARIMA 20.0069 22.2199 0.0501 0.0507 \n",
"auto_arima Auto ARIMA 21.0297 23.4661 0.0525 0.0531 \n",
"snaive Seasonal Naive Forecaster 33.3611 35.9139 0.0832 0.0879 \n",
"polytrend Polynomial Trend Forecaster 48.6301 63.4299 0.117 0.1216 \n",
"naive Naive Forecaster 69.0278 91.0322 0.1569 0.1792 \n",
"\n",
" R2 TT (Sec) \n",
"arima 0.8677 0.0733 \n",
"auto_arima 0.8509 4.3100 \n",
"snaive 0.6072 0.0133 \n",
"polytrend -0.0784 0.0100 \n",
"naive -1.2216 0.0133 "
]
},
"metadata": {}
}
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "u84K3R1KAw7t"
},
"source": [
"### Including and Excluding Models"
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "gbGzRO-d8k7i"
},
"source": [
"Sometimes, there may be a need to run only certain models or exclude certain models from the run. This can be done using the `include` and `exclude` arguments respectively. Let's see how we can only include `prophet` and exclude `bats` and `tbats` from the previous run. "
]
},
{
"cell_type": "code",
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/",
"height": 865,
"referenced_widgets": [
"aa261a1a1718436eb0bc7ce4554b4d51",
"e1e2fe4e74b940bfa2c3ca6ae5d6dcc9",
"9668b468585140beb06f4186c95b1d16"
]
},
"id": "QJoBWOSt85PZ",
"outputId": "17050db2-53da-47f2-a26a-0d8c8746511d"
},
"source": [
"all_baseline_some_models = exp.compare_models(turbo=False, exclude=['bats', 'tbats'])"
],
"execution_count": 13,
"outputs": [
{
"output_type": "display_data",
"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>Model</th>\n",
" <th>MAE</th>\n",
" <th>RMSE</th>\n",
" <th>MAPE</th>\n",
" <th>SMAPE</th>\n",
" <th>R2</th>\n",
" <th>TT (Sec)</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>exp_smooth</th>\n",
" <td>Exponential Smoothing</td>\n",
" <td>16.7773</td>\n",
" <td>19.7959</td>\n",
" <td>0.0422</td>\n",
" <td>0.0427</td>\n",
" <td>0.8954</td>\n",
" <td>0.1400</td>\n",
" </tr>\n",
" <tr>\n",
" <th>ets</th>\n",
" <td>ETS</td>\n",
" <td>17.4191</td>\n",
" <td>20.5125</td>\n",
" <td>0.044</td>\n",
" <td>0.0445</td>\n",
" <td>0.8882</td>\n",
" <td>0.2033</td>\n",
" </tr>\n",
" <tr>\n",
" <th>arima</th>\n",
" <td>ARIMA</td>\n",
" <td>20.0069</td>\n",
" <td>22.2199</td>\n",
" <td>0.0501</td>\n",
" <td>0.0507</td>\n",
" <td>0.8677</td>\n",
" <td>0.0700</td>\n",
" </tr>\n",
" <tr>\n",
" <th>auto_arima</th>\n",
" <td>Auto ARIMA</td>\n",
" <td>21.0297</td>\n",
" <td>23.4661</td>\n",
" <td>0.0525</td>\n",
" <td>0.0531</td>\n",
" <td>0.8509</td>\n",
" <td>4.2967</td>\n",
" </tr>\n",
" <tr>\n",
" <th>et_cds_dt</th>\n",
" <td>Extra Trees w/ Cond. Deseasonalize &amp; Detrending</td>\n",
" <td>24.4233</td>\n",
" <td>31.4395</td>\n",
" <td>0.0584</td>\n",
" <td>0.0601</td>\n",
" <td>0.7169</td>\n",
" <td>0.9767</td>\n",
" </tr>\n",
" <tr>\n",
" <th>knn_cds_dt</th>\n",
" <td>K Neighbors w/ Cond. Deseasonalize &amp; Detrending</td>\n",
" <td>25.8293</td>\n",
" <td>34.9633</td>\n",
" <td>0.0617</td>\n",
" <td>0.0641</td>\n",
" <td>0.626</td>\n",
" <td>0.8400</td>\n",
" </tr>\n",
" <tr>\n",
" <th>rf_cds_dt</th>\n",
" <td>Random Forest w/ Cond. Deseasonalize &amp; Detrending</td>\n",
" <td>26.8586</td>\n",
" <td>38.0499</td>\n",
" <td>0.0629</td>\n",
" <td>0.0654</td>\n",
" <td>0.6023</td>\n",
" <td>1.0067</td>\n",
" </tr>\n",
" <tr>\n",
" <th>ada_cds_dt</th>\n",
" <td>AdaBoost w/ Cond. Deseasonalize &amp; Detrending</td>\n",
" <td>27.82</td>\n",
" <td>37.791</td>\n",
" <td>0.0661</td>\n",
" <td>0.0686</td>\n",
" <td>0.6015</td>\n",
" <td>0.1167</td>\n",
" </tr>\n",
" <tr>\n",
" <th>theta</th>\n",
" <td>Theta Forecaster</td>\n",
" <td>28.3192</td>\n",
" <td>33.8639</td>\n",
" <td>0.067</td>\n",
" <td>0.07</td>\n",
" <td>0.671</td>\n",
" <td>0.0200</td>\n",
" </tr>\n",
" <tr>\n",
" <th>gbr_cds_dt</th>\n",
" <td>Gradient Boosting w/ Cond. Deseasonalize &amp; Det...</td>\n",
" <td>29.1314</td>\n",
" <td>38.308</td>\n",
" <td>0.0685</td>\n",
" <td>0.0715</td>\n",
" <td>0.5855</td>\n",
" <td>0.0667</td>\n",
" </tr>\n",
" <tr>\n",
" <th>lightgbm_cds_dt</th>\n",
" <td>Light Gradient Boosting w/ Cond. Deseasonalize...</td>\n",
" <td>28.7738</td>\n",
" <td>36.2392</td>\n",
" <td>0.0698</td>\n",
" <td>0.0722</td>\n",
" <td>0.6255</td>\n",
" <td>0.0367</td>\n",
" </tr>\n",
" <tr>\n",
" <th>prophet</th>\n",
" <td>Prophet</td>\n",
" <td>30.239</td>\n",
" <td>35.6676</td>\n",
" <td>0.0782</td>\n",
" <td>0.0764</td>\n",
" <td>0.654</td>\n",
" <td>0.7667</td>\n",
" </tr>\n",
" <tr>\n",
" <th>br_cds_dt</th>\n",
" <td>Bayesian Ridge w/ Cond. Deseasonalize &amp; Detren...</td>\n",
" <td>32.0341</td>\n",
" <td>39.2191</td>\n",
" <td>0.0799</td>\n",
" <td>0.0818</td>\n",
" <td>0.5658</td>\n",
" <td>0.0233</td>\n",
" </tr>\n",
" <tr>\n",
" <th>lasso_cds_dt</th>\n",
" <td>Lasso w/ Cond. Deseasonalize &amp; Detrending</td>\n",
" <td>32.8026</td>\n",
" <td>39.2084</td>\n",
" <td>0.0823</td>\n",
" <td>0.0841</td>\n",
" <td>0.5678</td>\n",
" <td>0.0233</td>\n",
" </tr>\n",
" <tr>\n",
" <th>en_cds_dt</th>\n",
" <td>Elastic Net w/ Cond. Deseasonalize &amp; Detrending</td>\n",
" <td>32.8556</td>\n",
" <td>39.2557</td>\n",
" <td>0.0825</td>\n",
" <td>0.0843</td>\n",
" <td>0.5669</td>\n",
" <td>0.0233</td>\n",
" </tr>\n",
" <tr>\n",
" <th>ridge_cds_dt</th>\n",
" <td>Ridge w/ Cond. Deseasonalize &amp; Detrending</td>\n",
" <td>32.9702</td>\n",
" <td>39.3452</td>\n",
" <td>0.0828</td>\n",
" <td>0.0846</td>\n",
" <td>0.5652</td>\n",
" <td>0.0267</td>\n",
" </tr>\n",
" <tr>\n",
" <th>lr_cds_dt</th>\n",
" <td>Linear w/ Cond. Deseasonalize &amp; Detrending</td>\n",
" <td>32.9708</td>\n",
" <td>39.3456</td>\n",
" <td>0.0828</td>\n",
" <td>0.0846</td>\n",
" <td>0.5652</td>\n",
" <td>0.8867</td>\n",
" </tr>\n",
" <tr>\n",
" <th>dt_cds_dt</th>\n",
" <td>Decision Tree w/ Cond. Deseasonalize &amp; Detrending</td>\n",
" <td>35.1446</td>\n",
" <td>45.8861</td>\n",
" <td>0.0826</td>\n",
" <td>0.0869</td>\n",
" <td>0.4284</td>\n",
" <td>0.0267</td>\n",
" </tr>\n",
" <tr>\n",
" <th>snaive</th>\n",
" <td>Seasonal Naive Forecaster</td>\n",
" <td>33.3611</td>\n",
" <td>35.9139</td>\n",
" <td>0.0832</td>\n",
" <td>0.0879</td>\n",
" <td>0.6072</td>\n",
" <td>0.0167</td>\n",
" </tr>\n",
" <tr>\n",
" <th>huber_cds_dt</th>\n",
" <td>Huber w/ Cond. Deseasonalize &amp; Detrending</td>\n",
" <td>35.4709</td>\n",
" <td>41.1489</td>\n",
" <td>0.091</td>\n",
" <td>0.0936</td>\n",
" <td>0.5226</td>\n",
" <td>0.0400</td>\n",
" </tr>\n",
" <tr>\n",
" <th>lar_cds_dt</th>\n",
" <td>Least Angular Regressor w/ Cond. Deseasonalize...</td>\n",
" <td>36.5285</td>\n",
" <td>42.4001</td>\n",
" <td>0.0936</td>\n",
" <td>0.0945</td>\n",
" <td>0.5058</td>\n",
" <td>0.0233</td>\n",
" </tr>\n",
" <tr>\n",
" <th>llar_cds_dt</th>\n",
" <td>Lasso Least Angular Regressor w/ Cond. Deseaso...</td>\n",
" <td>46.7239</td>\n",
" <td>63.1706</td>\n",
" <td>0.1109</td>\n",
" <td>0.1165</td>\n",
" <td>-0.0733</td>\n",
" <td>0.0233</td>\n",
" </tr>\n",
" <tr>\n",
" <th>omp_cds_dt</th>\n",
" <td>Orthogonal Matching Pursuit w/ Cond. Deseasona...</td>\n",
" <td>47.2799</td>\n",
" <td>64.5891</td>\n",
" <td>0.111</td>\n",
" <td>0.1177</td>\n",
" <td>-0.1201</td>\n",
" <td>0.0267</td>\n",
" </tr>\n",
" <tr>\n",
" <th>polytrend</th>\n",
" <td>Polynomial Trend Forecaster</td>\n",
" <td>48.6301</td>\n",
" <td>63.4299</td>\n",
" <td>0.117</td>\n",
" <td>0.1216</td>\n",
" <td>-0.0784</td>\n",
" <td>0.0133</td>\n",
" </tr>\n",
" <tr>\n",
" <th>naive</th>\n",
" <td>Naive Forecaster</td>\n",
" <td>69.0278</td>\n",
" <td>91.0322</td>\n",
" <td>0.1569</td>\n",
" <td>0.1792</td>\n",
" <td>-1.2216</td>\n",
" <td>0.0167</td>\n",
" </tr>\n",
" <tr>\n",
" <th>par_cds_dt</th>\n",
" <td>Passive Aggressive w/ Cond. Deseasonalize &amp; De...</td>\n",
" <td>78.0396</td>\n",
" <td>95.4251</td>\n",
" <td>0.2137</td>\n",
" <td>0.2531</td>\n",
" <td>-3.0784</td>\n",
" <td>0.0200</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"text/plain": [
" Model MAE \\\n",
"exp_smooth Exponential Smoothing 16.7773 \n",
"ets ETS 17.4191 \n",
"arima ARIMA 20.0069 \n",
"auto_arima Auto ARIMA 21.0297 \n",
"et_cds_dt Extra Trees w/ Cond. Deseasonalize & Detrending 24.4233 \n",
"knn_cds_dt K Neighbors w/ Cond. Deseasonalize & Detrending 25.8293 \n",
"rf_cds_dt Random Forest w/ Cond. Deseasonalize & Detrending 26.8586 \n",
"ada_cds_dt AdaBoost w/ Cond. Deseasonalize & Detrending 27.82 \n",
"theta Theta Forecaster 28.3192 \n",
"gbr_cds_dt Gradient Boosting w/ Cond. Deseasonalize & Det... 29.1314 \n",
"lightgbm_cds_dt Light Gradient Boosting w/ Cond. Deseasonalize... 28.7738 \n",
"prophet Prophet 30.239 \n",
"br_cds_dt Bayesian Ridge w/ Cond. Deseasonalize & Detren... 32.0341 \n",
"lasso_cds_dt Lasso w/ Cond. Deseasonalize & Detrending 32.8026 \n",
"en_cds_dt Elastic Net w/ Cond. Deseasonalize & Detrending 32.8556 \n",
"ridge_cds_dt Ridge w/ Cond. Deseasonalize & Detrending 32.9702 \n",
"lr_cds_dt Linear w/ Cond. Deseasonalize & Detrending 32.9708 \n",
"dt_cds_dt Decision Tree w/ Cond. Deseasonalize & Detrending 35.1446 \n",
"snaive Seasonal Naive Forecaster 33.3611 \n",
"huber_cds_dt Huber w/ Cond. Deseasonalize & Detrending 35.4709 \n",
"lar_cds_dt Least Angular Regressor w/ Cond. Deseasonalize... 36.5285 \n",
"llar_cds_dt Lasso Least Angular Regressor w/ Cond. Deseaso... 46.7239 \n",
"omp_cds_dt Orthogonal Matching Pursuit w/ Cond. Deseasona... 47.2799 \n",
"polytrend Polynomial Trend Forecaster 48.6301 \n",
"naive Naive Forecaster 69.0278 \n",
"par_cds_dt Passive Aggressive w/ Cond. Deseasonalize & De... 78.0396 \n",
"\n",
" RMSE MAPE SMAPE R2 TT (Sec) \n",
"exp_smooth 19.7959 0.0422 0.0427 0.8954 0.1400 \n",
"ets 20.5125 0.044 0.0445 0.8882 0.2033 \n",
"arima 22.2199 0.0501 0.0507 0.8677 0.0700 \n",
"auto_arima 23.4661 0.0525 0.0531 0.8509 4.2967 \n",
"et_cds_dt 31.4395 0.0584 0.0601 0.7169 0.9767 \n",
"knn_cds_dt 34.9633 0.0617 0.0641 0.626 0.8400 \n",
"rf_cds_dt 38.0499 0.0629 0.0654 0.6023 1.0067 \n",
"ada_cds_dt 37.791 0.0661 0.0686 0.6015 0.1167 \n",
"theta 33.8639 0.067 0.07 0.671 0.0200 \n",
"gbr_cds_dt 38.308 0.0685 0.0715 0.5855 0.0667 \n",
"lightgbm_cds_dt 36.2392 0.0698 0.0722 0.6255 0.0367 \n",
"prophet 35.6676 0.0782 0.0764 0.654 0.7667 \n",
"br_cds_dt 39.2191 0.0799 0.0818 0.5658 0.0233 \n",
"lasso_cds_dt 39.2084 0.0823 0.0841 0.5678 0.0233 \n",
"en_cds_dt 39.2557 0.0825 0.0843 0.5669 0.0233 \n",
"ridge_cds_dt 39.3452 0.0828 0.0846 0.5652 0.0267 \n",
"lr_cds_dt 39.3456 0.0828 0.0846 0.5652 0.8867 \n",
"dt_cds_dt 45.8861 0.0826 0.0869 0.4284 0.0267 \n",
"snaive 35.9139 0.0832 0.0879 0.6072 0.0167 \n",
"huber_cds_dt 41.1489 0.091 0.0936 0.5226 0.0400 \n",
"lar_cds_dt 42.4001 0.0936 0.0945 0.5058 0.0233 \n",
"llar_cds_dt 63.1706 0.1109 0.1165 -0.0733 0.0233 \n",
"omp_cds_dt 64.5891 0.111 0.1177 -0.1201 0.0267 \n",
"polytrend 63.4299 0.117 0.1216 -0.0784 0.0133 \n",
"naive 91.0322 0.1569 0.1792 -1.2216 0.0167 \n",
"par_cds_dt 95.4251 0.2137 0.2531 -3.0784 0.0200 "
]
},
"metadata": {}
}
]
},
{
"cell_type": "code",
"metadata": {
"id": "rU7kokiW9R6-"
},
"source": [
""
],
"execution_count": 13,
"outputs": []
}
]
}
@biomedatascientistSV
Copy link

@ngupta23 works like a charm, beautiful!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment