{ "nbformat": 4, "nbformat_minor": 0, "metadata": { "colab": { "name": "PyCaret 2 HousePrice Regresion.ipynb", "provenance": [], "collapsed_sections": [] }, "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.8.2" }, "widgets": { "application/vnd.jupyter.widget-state+json": { "84cd4922236448a3a306a3f6e7e43c88": { "model_module": "@jupyter-widgets/controls", "model_name": "IntProgressModel", "state": { "_view_name": "ProgressView", "style": "IPY_MODEL_47375cce9026442183ab428080b82e11", "_dom_classes": [], "description": "Processing: ", "_model_name": "IntProgressModel", "bar_style": "", "max": 13, "_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_fefbae2c76574bf7b31541e5f1e022ef" } }, "47375cce9026442183ab428080b82e11": { "model_module": "@jupyter-widgets/controls", "model_name": "ProgressStyleModel", "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" } }, "fefbae2c76574bf7b31541e5f1e022ef": { "model_module": "@jupyter-widgets/base", "model_name": "LayoutModel", "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 } }, "562caa85cf7d4a2fbf4decac3fc6983b": { "model_module": "@jupyter-widgets/controls", "model_name": "TextModel", "state": { "_view_name": "TextView", "style": "IPY_MODEL_30410561071f463ab76e219406f2fa9c", "_dom_classes": [], "description": "", "_model_name": "TextModel", "placeholder": "​", "_view_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "value": "Following data types have been inferred automatically, if they are correct press enter to continue or type 'quit' otherwise.", "_view_count": null, "disabled": false, "_view_module_version": "1.5.0", "continuous_update": true, "description_tooltip": null, "_model_module": "@jupyter-widgets/controls", "layout": "IPY_MODEL_55e0f67422e244a9842b8dcc917d493d" } }, "30410561071f463ab76e219406f2fa9c": { "model_module": "@jupyter-widgets/controls", "model_name": "DescriptionStyleModel", "state": { "_view_name": "StyleView", "_model_name": "DescriptionStyleModel", "description_width": "", "_view_module": "@jupyter-widgets/base", "_model_module_version": "1.5.0", "_view_count": null, "_view_module_version": "1.2.0", "_model_module": "@jupyter-widgets/controls" } }, "55e0f67422e244a9842b8dcc917d493d": { "model_module": "@jupyter-widgets/base", "model_name": "LayoutModel", "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": "100%", "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 } }, "cd5ab1a14de5402985b82653a139d818": { "model_module": "@jupyter-widgets/controls", "model_name": "IntProgressModel", "state": { "_view_name": "ProgressView", "style": "IPY_MODEL_6e28825ce0c1497287c54a26ed64fb9b", "_dom_classes": [], "description": "Processing: ", "_model_name": "IntProgressModel", "bar_style": "", "max": 241, "_view_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "value": 238, "_view_count": null, "_view_module_version": "1.5.0", "orientation": "horizontal", "min": 0, "description_tooltip": null, "_model_module": "@jupyter-widgets/controls", "layout": "IPY_MODEL_c45d6e58845e4a7e860c7fde14ed94d2" } }, "6e28825ce0c1497287c54a26ed64fb9b": { "model_module": "@jupyter-widgets/controls", "model_name": "ProgressStyleModel", "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" } }, "c45d6e58845e4a7e860c7fde14ed94d2": { "model_module": "@jupyter-widgets/base", "model_name": "LayoutModel", "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 } }, "3c29f19233864b53ba8da01af51d572a": { "model_module": "@jupyter-widgets/controls", "model_name": "IntProgressModel", "state": { "_view_name": "ProgressView", "style": "IPY_MODEL_c59e1582725c43f282f196e76d7f8883", "_dom_classes": [], "description": "Processing: ", "_model_name": "IntProgressModel", "bar_style": "", "max": 14, "_view_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "value": 14, "_view_count": null, "_view_module_version": "1.5.0", "orientation": "horizontal", "min": 0, "description_tooltip": null, "_model_module": "@jupyter-widgets/controls", "layout": "IPY_MODEL_629dd21d247a4a63a3705add599b59dd" } }, "c59e1582725c43f282f196e76d7f8883": { "model_module": "@jupyter-widgets/controls", "model_name": "ProgressStyleModel", "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" } }, "629dd21d247a4a63a3705add599b59dd": { "model_module": "@jupyter-widgets/base", "model_name": "LayoutModel", "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 } }, "5ea1974eab714e209d781a04564f38aa": { "model_module": "@jupyter-widgets/controls", "model_name": "IntProgressModel", "state": { "_view_name": "ProgressView", "style": "IPY_MODEL_51b30e1917584733bcc1ad280f657a6f", "_dom_classes": [], "description": "Processing: ", "_model_name": "IntProgressModel", "bar_style": "", "max": 14, "_view_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "value": 14, "_view_count": null, "_view_module_version": "1.5.0", "orientation": "horizontal", "min": 0, "description_tooltip": null, "_model_module": "@jupyter-widgets/controls", "layout": "IPY_MODEL_e3c23703d9304ea09d7233dadc0b067f" } }, "51b30e1917584733bcc1ad280f657a6f": { "model_module": "@jupyter-widgets/controls", "model_name": "ProgressStyleModel", "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" } }, "e3c23703d9304ea09d7233dadc0b067f": { "model_module": "@jupyter-widgets/base", "model_name": "LayoutModel", "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 } }, "3d8c5beac0da40168f86729f70acbb79": { "model_module": "@jupyter-widgets/controls", "model_name": "IntProgressModel", "state": { "_view_name": "ProgressView", "style": "IPY_MODEL_08c8a60ba9e94046bd2d98afe7cc741a", "_dom_classes": [], "description": "Processing: ", "_model_name": "IntProgressModel", "bar_style": "", "max": 14, "_view_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "value": 14, "_view_count": null, "_view_module_version": "1.5.0", "orientation": "horizontal", "min": 0, "description_tooltip": null, "_model_module": "@jupyter-widgets/controls", "layout": "IPY_MODEL_367ad9468f49427ca8475e5301a95ddb" } }, "08c8a60ba9e94046bd2d98afe7cc741a": { "model_module": "@jupyter-widgets/controls", "model_name": "ProgressStyleModel", "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" } }, "367ad9468f49427ca8475e5301a95ddb": { "model_module": "@jupyter-widgets/base", "model_name": "LayoutModel", "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 } }, "838a3f746e6a4b6b9f3d05d6c3d506cb": { "model_module": "@jupyter-widgets/controls", "model_name": "IntProgressModel", "state": { "_view_name": "ProgressView", "style": "IPY_MODEL_3a2d5a31c1d1444ab603e67934aa6acc", "_dom_classes": [], "description": "Processing: ", "_model_name": "IntProgressModel", "bar_style": "", "max": 16, "_view_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "value": 16, "_view_count": null, "_view_module_version": "1.5.0", "orientation": "horizontal", "min": 0, "description_tooltip": null, "_model_module": "@jupyter-widgets/controls", "layout": "IPY_MODEL_11fdc00d65ad4d82950b754c7f5ef6b0" } }, "3a2d5a31c1d1444ab603e67934aa6acc": { "model_module": "@jupyter-widgets/controls", "model_name": "ProgressStyleModel", "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" } }, "11fdc00d65ad4d82950b754c7f5ef6b0": { "model_module": "@jupyter-widgets/base", "model_name": "LayoutModel", "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 } }, "3e621330c9144f568bdc0eef124afb1a": { "model_module": "@jupyter-widgets/controls", "model_name": "IntProgressModel", "state": { "_view_name": "ProgressView", "style": "IPY_MODEL_ce93bca57c684aa3b46265d0c37eb746", "_dom_classes": [], "description": "Processing: ", "_model_name": "IntProgressModel", "bar_style": "", "max": 16, "_view_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "value": 16, "_view_count": null, "_view_module_version": "1.5.0", "orientation": "horizontal", "min": 0, "description_tooltip": null, "_model_module": "@jupyter-widgets/controls", "layout": "IPY_MODEL_c485ec5deb47455fad921d447491bb7f" } }, "ce93bca57c684aa3b46265d0c37eb746": { "model_module": "@jupyter-widgets/controls", "model_name": "ProgressStyleModel", "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" } }, "c485ec5deb47455fad921d447491bb7f": { "model_module": "@jupyter-widgets/base", "model_name": "LayoutModel", "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 } }, "5ff4ebf9ceed4072bf633bb282423dca": { "model_module": "@jupyter-widgets/controls", "model_name": "IntProgressModel", "state": { "_view_name": "ProgressView", "style": "IPY_MODEL_17633bba196a4c1897ecce8482066c29", "_dom_classes": [], "description": "Processing: ", "_model_name": "IntProgressModel", "bar_style": "", "max": 16, "_view_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "value": 16, "_view_count": null, "_view_module_version": "1.5.0", "orientation": "horizontal", "min": 0, "description_tooltip": null, "_model_module": "@jupyter-widgets/controls", "layout": "IPY_MODEL_583f1dc1beea4d75b9fe1c1f1de719e1" } }, "17633bba196a4c1897ecce8482066c29": { "model_module": "@jupyter-widgets/controls", "model_name": "ProgressStyleModel", "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" } }, "583f1dc1beea4d75b9fe1c1f1de719e1": { "model_module": "@jupyter-widgets/base", "model_name": "LayoutModel", "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 } }, "47c66341f17d40de815a82eedaf43dba": { "model_module": "@jupyter-widgets/controls", "model_name": "IntProgressModel", "state": { "_view_name": "ProgressView", "style": "IPY_MODEL_c77287c6a0dd4892b02f8e94f83360d6", "_dom_classes": [], "description": "Processing: ", "_model_name": "IntProgressModel", "bar_style": "", "max": 14, "_view_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "value": 14, "_view_count": null, "_view_module_version": "1.5.0", "orientation": "horizontal", "min": 0, "description_tooltip": null, "_model_module": "@jupyter-widgets/controls", "layout": "IPY_MODEL_2656c119068c4faa86003a43ddb52453" } }, "c77287c6a0dd4892b02f8e94f83360d6": { "model_module": "@jupyter-widgets/controls", "model_name": "ProgressStyleModel", "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" } }, "2656c119068c4faa86003a43ddb52453": { "model_module": "@jupyter-widgets/base", "model_name": "LayoutModel", "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": "I76BhvxwrMfn", "colab_type": "text" }, "source": [ "# PyCaret 2 House Price Prediction Example" ] }, { "cell_type": "markdown", "metadata": { "id": "wSSQFNvlrMfp", "colab_type": "text" }, "source": [ "This notebook is created using PyCaret 2.0. Last updated : 04-08-2020" ] }, { "cell_type": "markdown", "metadata": { "colab_type": "text", "id": "gobl5HA-juwP" }, "source": [ "House Price Prediction data set from Kaggle https://www.kaggle.com/c/house-prices-advanced-regression-techniques
\n", "Train Dataset consists of 1460 Samples with 81 features including the SalePrice
\n", "Test Dataset consists of 1459 Samples wit 80 features" ] }, { "cell_type": "code", "metadata": { "colab_type": "code", "id": "ICXiqtC_TacA", "colab": { "base_uri": "https://localhost:8080/", "height": 34 }, "outputId": "49a1f1f6-c4e7-499a-eb34-4d19bceb4562" }, "source": [ "# Mount Google Drive \n", "# Skip this step if using on local hardware \n", "from google.colab import drive\n", "drive.mount('/content/gdrive')" ], "execution_count": null, "outputs": [ { "output_type": "stream", "text": [ "Drive already mounted at /content/gdrive; to attempt to forcibly remount, call drive.mount(\"/content/gdrive\", force_remount=True).\n" ], "name": "stdout" } ] }, { "cell_type": "code", "metadata": { "colab_type": "code", "id": "pD-STV05yakD", "colab": {} }, "source": [ "# Works with pycaret and pycaret 2\n", "#!pip install pycaret==2.0\n", "from pycaret.regression import *\n", "import pandas as pd" ], "execution_count": null, "outputs": [] }, { "cell_type": "code", "metadata": { "id": "y0qd3_m7rMfu", "colab_type": "code", "colab": { "base_uri": "https://localhost:8080/", "height": 34 }, "outputId": "eff3c677-6bf6-4e21-de39-2c1e901254ce" }, "source": [ "# check version\n", "from pycaret.utils import version\n", "version()" ], "execution_count": null, "outputs": [ { "output_type": "stream", "text": [ "2.0\n" ], "name": "stdout" } ] }, { "cell_type": "code", "metadata": { "colab_type": "code", "id": "IVl3sVtl32im", "colab": { "base_uri": "https://localhost:8080/", "height": 34 }, "outputId": "5c427692-f3ce-400f-a5ac-ae916ad6d11c" }, "source": [ "# Chane path as per your file structure\n", "# Remove root_path if using local hardware\n", "\n", "root_path = 'gdrive/My Drive/Colab Notebooks/'\n", "\n", "data = pd.read_csv('gdrive/My Drive/Colab Notebooks/HousePrice/train.csv')\n", "\n", "test_data = pd.read_csv('gdrive/My Drive/Colab Notebooks/HousePrice/test.csv')\n", "\n", "print(data.shape, test_data.shape)" ], "execution_count": null, "outputs": [ { "output_type": "stream", "text": [ "(1460, 81) (1459, 80)\n" ], "name": "stdout" } ] }, { "cell_type": "code", "metadata": { "colab_type": "code", "id": "kpCdQOa9ZZnH", "colab": { "base_uri": "https://localhost:8080/", "height": 256 }, "outputId": "7faadb2f-8e76-4a34-a85e-e24f285a5113" }, "source": [ "data.head()" ], "execution_count": null, "outputs": [ { "output_type": "execute_result", "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
IdMSSubClassMSZoningLotFrontageLotAreaStreetAlleyLotShapeLandContourUtilitiesLotConfigLandSlopeNeighborhoodCondition1Condition2BldgTypeHouseStyleOverallQualOverallCondYearBuiltYearRemodAddRoofStyleRoofMatlExterior1stExterior2ndMasVnrTypeMasVnrAreaExterQualExterCondFoundationBsmtQualBsmtCondBsmtExposureBsmtFinType1BsmtFinSF1BsmtFinType2BsmtFinSF2BsmtUnfSFTotalBsmtSFHeating...CentralAirElectrical1stFlrSF2ndFlrSFLowQualFinSFGrLivAreaBsmtFullBathBsmtHalfBathFullBathHalfBathBedroomAbvGrKitchenAbvGrKitchenQualTotRmsAbvGrdFunctionalFireplacesFireplaceQuGarageTypeGarageYrBltGarageFinishGarageCarsGarageAreaGarageQualGarageCondPavedDriveWoodDeckSFOpenPorchSFEnclosedPorch3SsnPorchScreenPorchPoolAreaPoolQCFenceMiscFeatureMiscValMoSoldYrSoldSaleTypeSaleConditionSalePrice
0160RL65.08450PaveNaNRegLvlAllPubInsideGtlCollgCrNormNorm1Fam2Story7520032003GableCompShgVinylSdVinylSdBrkFace196.0GdTAPConcGdTANoGLQ706Unf0150856GasA...YSBrkr85685401710102131Gd8Typ0NaNAttchd2003.0RFn2548TATAY0610000NaNNaNNaN022008WDNormal208500
1220RL80.09600PaveNaNRegLvlAllPubFR2GtlVeenkerFeedrNorm1Fam1Story6819761976GableCompShgMetalSdMetalSdNone0.0TATACBlockGdTAGdALQ978Unf02841262GasA...YSBrkr1262001262012031TA6Typ1TAAttchd1976.0RFn2460TATAY29800000NaNNaNNaN052007WDNormal181500
2360RL68.011250PaveNaNIR1LvlAllPubInsideGtlCollgCrNormNorm1Fam2Story7520012002GableCompShgVinylSdVinylSdBrkFace162.0GdTAPConcGdTAMnGLQ486Unf0434920GasA...YSBrkr92086601786102131Gd6Typ1TAAttchd2001.0RFn2608TATAY0420000NaNNaNNaN092008WDNormal223500
3470RL60.09550PaveNaNIR1LvlAllPubCornerGtlCrawforNormNorm1Fam2Story7519151970GableCompShgWd SdngWd ShngNone0.0TATABrkTilTAGdNoALQ216Unf0540756GasA...YSBrkr96175601717101031Gd7Typ1GdDetchd1998.0Unf3642TATAY035272000NaNNaNNaN022006WDAbnorml140000
4560RL84.014260PaveNaNIR1LvlAllPubFR2GtlNoRidgeNormNorm1Fam2Story8520002000GableCompShgVinylSdVinylSdBrkFace350.0GdTAPConcGdTAAvGLQ655Unf04901145GasA...YSBrkr1145105302198102141Gd9Typ1TAAttchd2000.0RFn3836TATAY192840000NaNNaNNaN0122008WDNormal250000
\n", "

5 rows × 81 columns

\n", "
" ], "text/plain": [ " Id MSSubClass MSZoning ... SaleType SaleCondition SalePrice\n", "0 1 60 RL ... WD Normal 208500\n", "1 2 20 RL ... WD Normal 181500\n", "2 3 60 RL ... WD Normal 223500\n", "3 4 70 RL ... WD Abnorml 140000\n", "4 5 60 RL ... WD Normal 250000\n", "\n", "[5 rows x 81 columns]" ] }, "metadata": { "tags": [] }, "execution_count": 5 } ] }, { "cell_type": "code", "metadata": { "colab_type": "code", "id": "hRT-l3CUYvgW", "colab": { "base_uri": "https://localhost:8080/", "height": 973, "referenced_widgets": [ "84cd4922236448a3a306a3f6e7e43c88", "47375cce9026442183ab428080b82e11", "fefbae2c76574bf7b31541e5f1e022ef", "562caa85cf7d4a2fbf4decac3fc6983b", "30410561071f463ab76e219406f2fa9c", "55e0f67422e244a9842b8dcc917d493d" ] }, "outputId": "6834803b-b97a-478b-e92b-e262e6bdf6a6" }, "source": [ "# Ignoring features with high null values \n", "\n", "demo = setup(data = data, target = 'SalePrice', \n", " ignore_features = ['Alley','PoolQC','MiscFeature','Fence','FireplaceQu','Utilities'],normalize = True,\n", " transformation= True, transformation_method = 'yeo-johnson', \n", " transform_target = True, remove_outliers= True,\n", " remove_multicollinearity = True,\n", " ignore_low_variance = True, combine_rare_levels = True) " ], "execution_count": null, "outputs": [ { "output_type": "stream", "text": [ " \n", "Setup Succesfully Completed.\n" ], "name": "stdout" }, { "output_type": "display_data", "data": { "text/html": [ "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
Description Value
0session_id2553
1Transform Target True
2Transform Target Methodbox-cox
3Original Data(1460, 81)
4Missing Values True
5Numeric Features 21
6Categorical Features 59
7Ordinal Features False
8High Cardinality Features False
9High Cardinality Method None
10Sampled Data(1387, 81)
11Transformed Train Set(970, 244)
12Transformed Test Set(417, 244)
13Numeric Imputer mean
14Categorical Imputer constant
15Normalize True
16Normalize Method zscore
17Transformation True
18Transformation Method yeo-johnson
19PCA False
20PCA Method None
21PCA Components None
22Ignore Low Variance True
23Combine Rare Levels True
24Rare Level Threshold 0.100000
25Numeric Binning False
26Remove Outliers True
27Outliers Threshold 0.050000
28Remove Multicollinearity True
29Multicollinearity Threshold 0.900000
30Clustering False
31Clustering Iteration None
32Polynomial Features False
33Polynomial Degree None
34Trignometry Features False
35Polynomial Threshold None
36Group Features False
37Feature Selection False
38Features Selection Threshold None
39Feature Interaction False
40Feature Ratio False
41Interaction Threshold None
" ], "text/plain": [ "" ] }, "metadata": { "tags": [] } } ] }, { "cell_type": "code", "metadata": { "colab_type": "code", "id": "v8tsvaw4aHHp", "colab": { "base_uri": "https://localhost:8080/", "height": 1000, "referenced_widgets": [ "cd5ab1a14de5402985b82653a139d818", "6e28825ce0c1497287c54a26ed64fb9b", "c45d6e58845e4a7e860c7fde14ed94d2" ] }, "outputId": "1708f0d0-a5ff-4841-a3f5-634598ee507a" }, "source": [ "# Blacklist Theil–Sen Regressor \n", "# Auto sort on R2 \n", "compare_models(blacklist = ['tr'])" ], "execution_count": null, "outputs": [ { "output_type": "display_data", "data": { "text/html": [ "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
Model MAE MSE RMSE R2 RMSLE MAPE TT (Sec)
0CatBoost Regressor15313.6607776434230.544925574.65200.89660.12160.08546.0545
1Huber Regressor14604.9714912236241.932225213.09880.89390.11900.08330.1802
2Support Vector Machine15387.0710795925878.705426206.27070.88930.12520.08650.2447
3Bayesian Ridge15381.1023920602470.636326383.79030.88800.12120.08550.0722
4Light Gradient Boosting Machine16799.0399837267455.964327326.62380.88170.13030.09250.2839
5Gradient Boosting Regressor16988.6879900162869.880527414.77450.88140.13120.09430.7129
6Extreme Gradient Boosting17203.8522890529209.368427723.62690.87930.13380.09640.4334
7Ridge Regression16198.3462996008412.499427658.99150.87760.12550.08930.0130
8Random Forest17884.1543918488672.405728876.37100.86830.14070.09961.5661
9Orthogonal Matching Pursuit17525.49201180290533.405830383.12620.85440.13840.09860.0142
10K Neighbors Regressor20935.86661263777102.833433958.86450.82010.15780.11290.0197
11Linear Regression18579.58211412999991.764234303.13620.81490.88750.10160.0375
12Extra Trees Regressor21077.77651450475526.509737113.88010.78640.16480.11141.5526
13Passive Aggressive Regressor23476.63791455925010.071334983.92840.78320.16630.12580.0310
14AdaBoost Regressor24871.36951596338786.306938377.71930.77020.17830.13300.4744
15Random Sample Consensus20436.44702024540158.841442271.75090.71991.88760.11662.4091
16Decision Tree28313.96912362204385.515546922.69990.65050.21930.15560.0383
17Elastic Net48540.73275644074263.300873662.87440.16420.33670.26300.0100
18Lasso Regression55943.93506918562280.518281883.4356-0.03850.38770.31020.0097
19Lasso Least Angle Regression55943.93506918562280.518281883.4356-0.03850.38770.31020.0123
20Least Angle Regression5993932134656973907951616.000034849194485222397251019231724335227216317654899884032.000059033380261709037822803968.0000-5421370651881711978246612473249811579011072.00009.759031547047712188772352.00000.1863
" ], "text/plain": [ "" ] }, "metadata": { "tags": [] } }, { "output_type": "execute_result", "data": { "text/plain": [ "" ] }, "metadata": { "tags": [] }, "execution_count": 7 } ] }, { "cell_type": "code", "metadata": { "colab_type": "code", "id": "wXxDMgpWe_nj", "colab": { "base_uri": "https://localhost:8080/", "height": 297, "referenced_widgets": [ "3c29f19233864b53ba8da01af51d572a", "c59e1582725c43f282f196e76d7f8883", "629dd21d247a4a63a3705add599b59dd", "5ea1974eab714e209d781a04564f38aa", "51b30e1917584733bcc1ad280f657a6f", "e3c23703d9304ea09d7233dadc0b067f", "3d8c5beac0da40168f86729f70acbb79", "08c8a60ba9e94046bd2d98afe7cc741a", "367ad9468f49427ca8475e5301a95ddb" ] }, "outputId": "1e60ba0d-cf32-4c8e-cb9b-a084e6a0106d" }, "source": [ "# Creating models for the best estimators \n", "huber = create_model('huber')\n", "bayesian_ridge = create_model('br')\n", "cat_boost = create_model('catboost')" ], "execution_count": null, "outputs": [ { "output_type": "display_data", "data": { "text/html": [ "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
MAE MSE RMSE R2 RMSLE MAPE
014464.0462796631140.186828224.65480.86780.10550.0744
112317.9481486929512.737722066.47940.88700.10810.0685
215872.2935582156173.383424127.91270.90940.15120.1058
316292.3554623678424.809224973.55450.90910.11060.0862
425111.91593283563129.247157302.38330.74600.17000.1107
512310.8000301712699.903417369.87910.95660.09360.0705
614194.3649427569376.363120677.75080.93690.12940.0855
715042.6148463198310.088821522.04240.88630.14890.1021
815624.3454522717385.212622863.01350.92120.11240.0843
911905.9229276186153.517016618.84930.94550.08640.0654
Mean15313.6607776434230.544925574.65200.89660.12160.0854
SD3591.9983847985780.975011062.16100.05680.02590.0154
" ], "text/plain": [ "" ] }, "metadata": { "tags": [] } } ] }, { "cell_type": "code", "metadata": { "colab_type": "code", "id": "RyfTEP0RhzAy", "colab": { "base_uri": "https://localhost:8080/", "height": 297, "referenced_widgets": [ "838a3f746e6a4b6b9f3d05d6c3d506cb", "3a2d5a31c1d1444ab603e67934aa6acc", "11fdc00d65ad4d82950b754c7f5ef6b0", "3e621330c9144f568bdc0eef124afb1a", "ce93bca57c684aa3b46265d0c37eb746", "c485ec5deb47455fad921d447491bb7f", "5ff4ebf9ceed4072bf633bb282423dca", "17633bba196a4c1897ecce8482066c29", "583f1dc1beea4d75b9fe1c1f1de719e1" ] }, "outputId": "65c8f299-4e28-4131-8d96-6523ab5edfca" }, "source": [ "# Tuning the created models \n", "huber = tune_model(huber)\n", "bayesian_ridge = tune_model(bayesian_ridge)\n", "cat_boost = tune_model(cat_boost)" ], "execution_count": null, "outputs": [ { "output_type": "display_data", "data": { "text/html": [ "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
MAE MSE RMSE R2 RMSLE MAPE
015222.1797670566500.093725895.29880.88870.10900.0828
112700.3444471383401.786121711.36570.89060.10740.0704
216694.3988633569183.117425170.80020.90140.15660.1098
317282.1157742530620.705127249.41510.89180.11920.0909
427664.43493328893846.107257696.56700.74240.17620.1211
513631.0586342263029.386218500.35210.95080.10280.0786
614448.9475421609729.305220533.13730.93780.12560.0870
716189.5874533125793.033723089.51700.86910.15750.1096
816572.7477600491213.833624504.92220.90940.11630.0884
912919.5620300757106.715517342.35010.94060.09140.0709
Mean16332.5377804519042.408426169.37260.89230.12620.0909
SD4079.7390852280183.340010939.97180.05590.02640.0164
" ], "text/plain": [ "" ] }, "metadata": { "tags": [] } } ] }, { "cell_type": "code", "metadata": { "colab_type": "code", "id": "rjXOLZR6lTRf", "colab": { "base_uri": "https://localhost:8080/", "height": 297, "referenced_widgets": [ "47c66341f17d40de815a82eedaf43dba", "c77287c6a0dd4892b02f8e94f83360d6", "2656c119068c4faa86003a43ddb52453" ] }, "outputId": "da06d194-0efd-40e3-9b50-f35120d5e76c" }, "source": [ "# Blending models\n", "blender = blend_models(estimator_list = [huber, bayesian_ridge, cat_boost])" ], "execution_count": null, "outputs": [ { "output_type": "display_data", "data": { "text/html": [ "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
MAE MSE RMSE R2 RMSLE MAPE
013233.5963463761320.619421535.11830.92300.09710.0713
111504.8842413827989.539920342.76260.90390.10180.0655
214194.1861464560920.493821553.67530.92770.14310.0960
314860.3248579523794.915824073.30050.91560.10460.0793
425506.16594270880912.600665351.97710.66960.18250.1149
512604.3339295248634.956317182.80060.95760.09160.0708
612364.6512352687304.726018779.97080.94790.11550.0750
714421.4822438085842.071120930.50030.89240.13950.0943
813692.8294351155335.642418739.13910.94700.10160.0777
910979.4809232445546.840315246.16500.95410.08210.0619
Mean14336.1935786217760.240624373.54100.90390.11600.0807
SD3909.86221165240457.930013861.75530.08080.02890.0155
" ], "text/plain": [ "" ] }, "metadata": { "tags": [] } } ] }, { "cell_type": "code", "metadata": { "colab_type": "code", "id": "dT_dnYL1na25", "colab": {} }, "source": [ "# Finaliszing model for predictions \n", "model = finalize_model(blender)\n", "predictions = predict_model(model, data = test_data)" ], "execution_count": null, "outputs": [] }, { "cell_type": "code", "metadata": { "colab_type": "code", "id": "_3lQxyHcoCzH", "colab": {} }, "source": [ "# Generating CSV for Kaggle Submissions \n", "sub = pd.DataFrame({\n", " \"Id\": predictions['Id'],\n", " \"SalePrice\": predictions['Label']\n", " })\n", "\n", "sub.to_csv('gdrive/My Drive/Colab Notebooks/HousePrice/submission.csv', index=False)" ], "execution_count": null, "outputs": [] } ] }