{ "nbformat": 4, "nbformat_minor": 0, "metadata": { "colab": { "provenance": [] }, "kernelspec": { "name": "python3", "display_name": "Python 3" }, "language_info": { "name": "python" } }, "cells": [ { "cell_type": "code", "execution_count": null, "metadata": { "colab": { "base_uri": "https://localhost:8080/" }, "id": "ovCDP9PbJctZ", "outputId": "73606b15-3cdf-436f-a3cc-5642cf6dcc21" }, "outputs": [ { "output_type": "stream", "name": "stdout", "text": [ "Drive already mounted at /content/drive; to attempt to forcibly remount, call drive.mount(\"/content/drive\", force_remount=True).\n" ] }, { "output_type": "stream", "name": "stderr", "text": [ "Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError. Select only valid columns before calling the reduction.\n" ] } ], "source": [ "import pandas as pd\n", "from google.colab import drive\n", "drive.mount('/content/drive')\n", "# load data from a csv file\n", "df = pd.read_csv('/content/sample_data/train.csv')\n", "df = df.drop('Id', axis=1)\n", "# fill missing values with mean of respective feature \n", "df = df.fillna(df.mean())" ] }, { "cell_type": "code", "source": [ "# !pip install shap\n", "import shap\n", "import matplotlib.pylab as pl\n", "from sklearn.model_selection import train_test_split\n", "from sklearn.metrics import mean_squared_error\n", "import numpy as np\n", "import lightgbm as lgb" ], "metadata": { "id": "FN-oZ0iHJiNQ" }, "execution_count": null, "outputs": [] }, { "cell_type": "markdown", "source": [ "