{"metadata":{"kernelspec":{"language":"python","display_name":"Python 3","name":"python3"},"language_info":{"name":"python","version":"3.10.14","mimetype":"text/x-python","codemirror_mode":{"name":"ipython","version":3},"pygments_lexer":"ipython3","nbconvert_exporter":"python","file_extension":".py"},"kaggle":{"accelerator":"none","dataSources":[{"sourceId":84896,"databundleVersionId":10305135,"sourceType":"competition"}],"dockerImageVersionId":30804,"isInternetEnabled":false,"language":"python","sourceType":"notebook","isGpuEnabled":false}},"nbformat_minor":4,"nbformat":4,"cells":[{"cell_type":"code","source":"# This Python 3 environment comes with many helpful analytics libraries installed\n# It is defined by the kaggle/python Docker image: https://github.com/kaggle/docker-python\n# For example, here's several helpful packages to load\n\nimport numpy as np # linear algebra\nimport pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)\n\n# Input data files are available in the read-only \"../input/\" directory\n# For example, running this (by clicking run or pressing Shift+Enter) will list all files under the input directory\n\nimport os\nfor dirname, _, filenames in os.walk('/kaggle/input'):\n    for filename in filenames:\n        print(os.path.join(dirname, filename))\n\n# You can write up to 20GB to the current directory (/kaggle/working/) that gets preserved as output when you create a version using \"Save & Run All\" \n# You can also write temporary files to /kaggle/temp/, but they won't be saved outside of the current session","metadata":{"_uuid":"8f2839f25d086af736a60e9eeb907d3b93b6e0e5","_cell_guid":"b1076dfc-b9ad-4769-8c92-a6c4dae69d19","trusted":true,"execution":{"iopub.status.busy":"2024-12-09T23:06:08.049286Z","iopub.execute_input":"2024-12-09T23:06:08.050571Z","iopub.status.idle":"2024-12-09T23:06:08.058664Z","shell.execute_reply.started":"2024-12-09T23:06:08.050516Z","shell.execute_reply":"2024-12-09T23:06:08.057284Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"import numpy as np\nimport pandas as pd\nimport seaborn as sns\nimport matplotlib.pyplot as plt\nfrom sklearn import preprocessing\nimport warnings\nwarnings.filterwarnings(\"ignore\")\nfrom sklearn.linear_model import LinearRegression\nfrom sklearn.model_selection import train_test_split\nfrom sklearn import metrics\nfrom sklearn.linear_model import Lasso\nfrom sklearn.metrics import mean_absolute_error, mean_squared_error","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-12-09T23:22:13.220544Z","iopub.execute_input":"2024-12-09T23:22:13.221403Z","iopub.status.idle":"2024-12-09T23:22:13.228435Z","shell.execute_reply.started":"2024-12-09T23:22:13.221363Z","shell.execute_reply":"2024-12-09T23:22:13.226457Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"df1=pd.read_csv('/kaggle/input/playground-series-s4e12/train.csv')\ndf1","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-12-09T23:22:13.792262Z","iopub.execute_input":"2024-12-09T23:22:13.792702Z","iopub.status.idle":"2024-12-09T23:22:20.168324Z","shell.execute_reply.started":"2024-12-09T23:22:13.792666Z","shell.execute_reply":"2024-12-09T23:22:20.16714Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"print('Training data ')\nprint(df1.head())","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-12-09T23:22:20.170344Z","iopub.execute_input":"2024-12-09T23:22:20.170779Z","iopub.status.idle":"2024-12-09T23:22:20.188124Z","shell.execute_reply.started":"2024-12-09T23:22:20.170734Z","shell.execute_reply":"2024-12-09T23:22:20.18693Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"df1.info()","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-12-09T23:22:20.18953Z","iopub.execute_input":"2024-12-09T23:22:20.19006Z","iopub.status.idle":"2024-12-09T23:22:20.864752Z","shell.execute_reply.started":"2024-12-09T23:22:20.189999Z","shell.execute_reply":"2024-12-09T23:22:20.863458Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"df1.describe()","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-12-09T23:22:20.867301Z","iopub.execute_input":"2024-12-09T23:22:20.8677Z","iopub.status.idle":"2024-12-09T23:22:21.591926Z","shell.execute_reply.started":"2024-12-09T23:22:20.867663Z","shell.execute_reply":"2024-12-09T23:22:21.590578Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"df1.shape","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-12-09T23:22:21.593297Z","iopub.execute_input":"2024-12-09T23:22:21.593689Z","iopub.status.idle":"2024-12-09T23:22:21.601688Z","shell.execute_reply.started":"2024-12-09T23:22:21.593655Z","shell.execute_reply":"2024-12-09T23:22:21.60026Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"df1.columns","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-12-09T23:22:21.603534Z","iopub.execute_input":"2024-12-09T23:22:21.604014Z","iopub.status.idle":"2024-12-09T23:22:21.617935Z","shell.execute_reply.started":"2024-12-09T23:22:21.603964Z","shell.execute_reply":"2024-12-09T23:22:21.616704Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"df1.tail()","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-12-09T23:22:21.619624Z","iopub.execute_input":"2024-12-09T23:22:21.620759Z","iopub.status.idle":"2024-12-09T23:22:21.655347Z","shell.execute_reply.started":"2024-12-09T23:22:21.620702Z","shell.execute_reply":"2024-12-09T23:22:21.653597Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"df1.isnull().sum()","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-12-09T23:22:21.656976Z","iopub.execute_input":"2024-12-09T23:22:21.657805Z","iopub.status.idle":"2024-12-09T23:22:22.331927Z","shell.execute_reply.started":"2024-12-09T23:22:21.657743Z","shell.execute_reply":"2024-12-09T23:22:22.330565Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"# calculating the percentage of missing values \nmiss_per_df1=df1.isnull().sum()/len(df1)*100\nprint(\"percentage of missing values in train data:\",miss_per_df1)","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-12-09T23:22:22.333336Z","iopub.execute_input":"2024-12-09T23:22:22.333799Z","iopub.status.idle":"2024-12-09T23:22:22.975552Z","shell.execute_reply.started":"2024-12-09T23:22:22.333762Z","shell.execute_reply":"2024-12-09T23:22:22.974399Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"df1.duplicated().sum()","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-12-09T23:22:22.978862Z","iopub.execute_input":"2024-12-09T23:22:22.979293Z","iopub.status.idle":"2024-12-09T23:22:24.857676Z","shell.execute_reply.started":"2024-12-09T23:22:22.979258Z","shell.execute_reply":"2024-12-09T23:22:24.856526Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"df1= df1.drop(['id'], axis=1)","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-12-09T23:22:24.928279Z","iopub.execute_input":"2024-12-09T23:22:24.928707Z","iopub.status.idle":"2024-12-09T23:22:25.108677Z","shell.execute_reply.started":"2024-12-09T23:22:24.92867Z","shell.execute_reply":"2024-12-09T23:22:25.107503Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"df1.head()","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-12-09T23:22:29.177709Z","iopub.execute_input":"2024-12-09T23:22:29.178112Z","iopub.status.idle":"2024-12-09T23:22:29.202335Z","shell.execute_reply.started":"2024-12-09T23:22:29.178078Z","shell.execute_reply":"2024-12-09T23:22:29.200927Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"df2=pd.read_csv('/kaggle/input/playground-series-s4e12/test.csv')\ndf2","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-12-09T23:22:30.907956Z","iopub.execute_input":"2024-12-09T23:22:30.908398Z","iopub.status.idle":"2024-12-09T23:22:34.19317Z","shell.execute_reply.started":"2024-12-09T23:22:30.908364Z","shell.execute_reply":"2024-12-09T23:22:34.191955Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"print('Testing data ')\nprint(df2.head())","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-12-09T23:22:34.194946Z","iopub.execute_input":"2024-12-09T23:22:34.195351Z","iopub.status.idle":"2024-12-09T23:22:34.212061Z","shell.execute_reply.started":"2024-12-09T23:22:34.195317Z","shell.execute_reply":"2024-12-09T23:22:34.210123Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"df2.info()","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-12-09T23:22:34.21392Z","iopub.execute_input":"2024-12-09T23:22:34.214444Z","iopub.status.idle":"2024-12-09T23:22:34.667907Z","shell.execute_reply.started":"2024-12-09T23:22:34.214391Z","shell.execute_reply":"2024-12-09T23:22:34.666663Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"df2.describe()","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-12-09T23:22:34.670284Z","iopub.execute_input":"2024-12-09T23:22:34.670724Z","iopub.status.idle":"2024-12-09T23:22:35.11277Z","shell.execute_reply.started":"2024-12-09T23:22:34.670687Z","shell.execute_reply":"2024-12-09T23:22:35.111548Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"df2.shape","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-12-09T23:22:35.114706Z","iopub.execute_input":"2024-12-09T23:22:35.115133Z","iopub.status.idle":"2024-12-09T23:22:35.123056Z","shell.execute_reply.started":"2024-12-09T23:22:35.115098Z","shell.execute_reply":"2024-12-09T23:22:35.121386Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"df2.columns","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-12-09T23:22:35.124315Z","iopub.execute_input":"2024-12-09T23:22:35.124769Z","iopub.status.idle":"2024-12-09T23:22:35.140639Z","shell.execute_reply.started":"2024-12-09T23:22:35.124734Z","shell.execute_reply":"2024-12-09T23:22:35.139357Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"df2.tail()","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-12-09T23:22:35.142358Z","iopub.execute_input":"2024-12-09T23:22:35.142872Z","iopub.status.idle":"2024-12-09T23:22:35.175931Z","shell.execute_reply.started":"2024-12-09T23:22:35.142734Z","shell.execute_reply":"2024-12-09T23:22:35.174582Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"df2.isnull().sum()","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-12-09T23:22:35.177466Z","iopub.execute_input":"2024-12-09T23:22:35.177983Z","iopub.status.idle":"2024-12-09T23:22:35.62047Z","shell.execute_reply.started":"2024-12-09T23:22:35.177936Z","shell.execute_reply":"2024-12-09T23:22:35.61921Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"# calculating the percentage of missing values \nmiss_per_df2=df2.isnull().sum()/len(df2)*100\nprint(\"percentage of missing values in test data:\",miss_per_df2)","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-12-09T23:22:35.621906Z","iopub.execute_input":"2024-12-09T23:22:35.622264Z","iopub.status.idle":"2024-12-09T23:22:36.059331Z","shell.execute_reply.started":"2024-12-09T23:22:35.622232Z","shell.execute_reply":"2024-12-09T23:22:36.057901Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"df2.duplicated().sum()","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-12-09T23:22:36.063452Z","iopub.execute_input":"2024-12-09T23:22:36.063833Z","iopub.status.idle":"2024-12-09T23:22:37.292875Z","shell.execute_reply.started":"2024-12-09T23:22:36.063803Z","shell.execute_reply":"2024-12-09T23:22:37.291153Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"df2= df2.drop(['id'], axis=1)","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-12-09T23:22:37.295339Z","iopub.execute_input":"2024-12-09T23:22:37.296239Z","iopub.status.idle":"2024-12-09T23:22:37.421001Z","shell.execute_reply.started":"2024-12-09T23:22:37.296178Z","shell.execute_reply":"2024-12-09T23:22:37.419495Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"df2.head()","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-12-09T23:22:37.422754Z","iopub.execute_input":"2024-12-09T23:22:37.423168Z","iopub.status.idle":"2024-12-09T23:22:37.455605Z","shell.execute_reply.started":"2024-12-09T23:22:37.423133Z","shell.execute_reply":"2024-12-09T23:22:37.454393Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"df1['Gender']=df1['Gender'].replace({'Female':0,'Male':1})\ndf2['Gender']=df2['Gender'].replace({'Female':0,'Male':1})","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-12-09T23:22:37.456911Z","iopub.execute_input":"2024-12-09T23:22:37.457247Z","iopub.status.idle":"2024-12-09T23:22:38.240838Z","shell.execute_reply.started":"2024-12-09T23:22:37.457215Z","shell.execute_reply":"2024-12-09T23:22:38.239718Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"print(\"Categorical columns in training data\")\ncategorical=df1.select_dtypes(include=['object']).columns\ncategorical","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-12-09T23:22:38.242669Z","iopub.execute_input":"2024-12-09T23:22:38.243091Z","iopub.status.idle":"2024-12-09T23:22:38.414088Z","shell.execute_reply.started":"2024-12-09T23:22:38.243048Z","shell.execute_reply":"2024-12-09T23:22:38.412862Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"print(df1[categorical].nunique())","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-12-09T23:22:38.415401Z","iopub.execute_input":"2024-12-09T23:22:38.416613Z","iopub.status.idle":"2024-12-09T23:22:39.538006Z","shell.execute_reply.started":"2024-12-09T23:22:38.416556Z","shell.execute_reply":"2024-12-09T23:22:39.5367Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"print(\"Numerical  columns in training data\")\nnumerical=df1.select_dtypes(include=['float']).columns\nnumerical","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-12-09T23:22:39.539499Z","iopub.execute_input":"2024-12-09T23:22:39.539921Z","iopub.status.idle":"2024-12-09T23:22:39.586782Z","shell.execute_reply.started":"2024-12-09T23:22:39.539885Z","shell.execute_reply":"2024-12-09T23:22:39.585553Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"print(df1[numerical].nunique())","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-12-09T23:22:39.588181Z","iopub.execute_input":"2024-12-09T23:22:39.588586Z","iopub.status.idle":"2024-12-09T23:22:39.850576Z","shell.execute_reply.started":"2024-12-09T23:22:39.588535Z","shell.execute_reply":"2024-12-09T23:22:39.849303Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"df1[numerical].isnull().sum()","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-12-09T23:22:39.852093Z","iopub.execute_input":"2024-12-09T23:22:39.85243Z","iopub.status.idle":"2024-12-09T23:22:39.910958Z","shell.execute_reply.started":"2024-12-09T23:22:39.852397Z","shell.execute_reply":"2024-12-09T23:22:39.909821Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"print(\"Numerical  columns in testing data\")\nnumericalt=df2.select_dtypes(include=['float']).columns\nnumericalt","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-12-09T23:22:39.912656Z","iopub.execute_input":"2024-12-09T23:22:39.91334Z","iopub.status.idle":"2024-12-09T23:22:39.945213Z","shell.execute_reply.started":"2024-12-09T23:22:39.913284Z","shell.execute_reply":"2024-12-09T23:22:39.943981Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"print(df2[numericalt].nunique())","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-12-09T23:22:39.946405Z","iopub.execute_input":"2024-12-09T23:22:39.946779Z","iopub.status.idle":"2024-12-09T23:22:40.094248Z","shell.execute_reply.started":"2024-12-09T23:22:39.946743Z","shell.execute_reply":"2024-12-09T23:22:40.092913Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"df2[numericalt].isnull().sum()","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-12-09T23:22:40.095356Z","iopub.execute_input":"2024-12-09T23:22:40.095695Z","iopub.status.idle":"2024-12-09T23:22:40.134639Z","shell.execute_reply.started":"2024-12-09T23:22:40.095662Z","shell.execute_reply":"2024-12-09T23:22:40.133576Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"print(\"Categorical columns in testing data\")\ncategoricalt=df2.select_dtypes(include=['object']).columns\ncategoricalt","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-12-09T23:22:40.136336Z","iopub.execute_input":"2024-12-09T23:22:40.136839Z","iopub.status.idle":"2024-12-09T23:22:40.249907Z","shell.execute_reply.started":"2024-12-09T23:22:40.136787Z","shell.execute_reply":"2024-12-09T23:22:40.248579Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"print(df2[categoricalt].nunique())","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-12-09T23:22:40.251643Z","iopub.execute_input":"2024-12-09T23:22:40.252119Z","iopub.status.idle":"2024-12-09T23:22:40.980851Z","shell.execute_reply.started":"2024-12-09T23:22:40.25207Z","shell.execute_reply":"2024-12-09T23:22:40.979455Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"# filling the missing numerical columns data in the training and the testing data  with median\n\ndf1[numerical]=df1[numerical].fillna(df1[numerical].mean())\ndf2[numericalt]=df2[numericalt].fillna(df2[numericalt].mean())","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-12-09T23:22:40.982796Z","iopub.execute_input":"2024-12-09T23:22:40.983195Z","iopub.status.idle":"2024-12-09T23:22:41.489623Z","shell.execute_reply.started":"2024-12-09T23:22:40.983161Z","shell.execute_reply":"2024-12-09T23:22:41.488345Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"df2[numericalt].isnull().sum()","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-12-09T23:22:41.49129Z","iopub.execute_input":"2024-12-09T23:22:41.491664Z","iopub.status.idle":"2024-12-09T23:22:41.537869Z","shell.execute_reply.started":"2024-12-09T23:22:41.491631Z","shell.execute_reply":"2024-12-09T23:22:41.53574Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"df1[numerical].isnull().sum()","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-12-09T23:22:41.539635Z","iopub.execute_input":"2024-12-09T23:22:41.540163Z","iopub.status.idle":"2024-12-09T23:22:41.626789Z","shell.execute_reply.started":"2024-12-09T23:22:41.540107Z","shell.execute_reply":"2024-12-09T23:22:41.625566Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"df1= df1.drop(['Marital Status','Policy Start Date','Customer Feedback','Education Level'], axis=1)\ndf2= df2.drop(['Marital Status','Policy Start Date','Customer Feedback','Education Level'], axis=1)\n","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-12-09T23:22:41.62843Z","iopub.execute_input":"2024-12-09T23:22:41.628971Z","iopub.status.idle":"2024-12-09T23:22:41.808761Z","shell.execute_reply.started":"2024-12-09T23:22:41.628918Z","shell.execute_reply":"2024-12-09T23:22:41.807421Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"df1.info()","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-12-09T23:22:41.816701Z","iopub.execute_input":"2024-12-09T23:22:41.817355Z","iopub.status.idle":"2024-12-09T23:22:42.195805Z","shell.execute_reply.started":"2024-12-09T23:22:41.817305Z","shell.execute_reply":"2024-12-09T23:22:42.194571Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"# one hot encoding for training and testing datasets\ndf1 = pd.get_dummies(df1,drop_first=True)\ndf2= pd.get_dummies(df2,drop_first=True)","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-12-09T23:22:42.197392Z","iopub.execute_input":"2024-12-09T23:22:42.197897Z","iopub.status.idle":"2024-12-09T23:22:43.520798Z","shell.execute_reply.started":"2024-12-09T23:22:42.197847Z","shell.execute_reply":"2024-12-09T23:22:43.519566Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"df1.info()","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-12-09T23:42:14.465349Z","iopub.execute_input":"2024-12-09T23:42:14.466005Z","iopub.status.idle":"2024-12-09T23:42:14.517091Z","shell.execute_reply.started":"2024-12-09T23:42:14.465967Z","shell.execute_reply":"2024-12-09T23:42:14.51568Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"df1.isnull().sum()","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-12-09T23:22:43.522192Z","iopub.execute_input":"2024-12-09T23:22:43.522566Z","iopub.status.idle":"2024-12-09T23:22:43.562546Z","shell.execute_reply.started":"2024-12-09T23:22:43.522532Z","shell.execute_reply":"2024-12-09T23:22:43.561338Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"df2.isnull().sum()","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-12-09T23:22:43.564048Z","iopub.execute_input":"2024-12-09T23:22:43.564409Z","iopub.status.idle":"2024-12-09T23:22:43.594105Z","shell.execute_reply.started":"2024-12-09T23:22:43.564376Z","shell.execute_reply":"2024-12-09T23:22:43.592897Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"plt.figure(figsize=(8,6))\nsns.displot(df1['Age'])\nplt.title(\"Age Distribution\")","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-12-09T23:22:43.595916Z","iopub.execute_input":"2024-12-09T23:22:43.596258Z","iopub.status.idle":"2024-12-09T23:22:44.910921Z","shell.execute_reply.started":"2024-12-09T23:22:43.596229Z","shell.execute_reply":"2024-12-09T23:22:44.90939Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"df1['Gender']=df1['Gender'].replace({'Female':0,'Male':1})\ndf2['Gender']=df2['Gender'].replace({'Female':0,'Male':1})","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-12-09T23:22:44.912891Z","iopub.execute_input":"2024-12-09T23:22:44.91326Z","iopub.status.idle":"2024-12-09T23:22:44.92713Z","shell.execute_reply.started":"2024-12-09T23:22:44.913227Z","shell.execute_reply":"2024-12-09T23:22:44.925703Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"plt.figure(figsize=(6,4))\nsns.countplot(x='Gender',data=df1)\nplt.title(\"Gender Distribution\")","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-12-09T23:22:44.928466Z","iopub.execute_input":"2024-12-09T23:22:44.928877Z","iopub.status.idle":"2024-12-09T23:22:45.190239Z","shell.execute_reply.started":"2024-12-09T23:22:44.928812Z","shell.execute_reply":"2024-12-09T23:22:45.18893Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"sns.kdeplot(data=df1)","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-12-09T23:24:33.056413Z","iopub.execute_input":"2024-12-09T23:24:33.056815Z","iopub.status.idle":"2024-12-09T23:27:18.844985Z","shell.execute_reply.started":"2024-12-09T23:24:33.056784Z","shell.execute_reply":"2024-12-09T23:27:18.843675Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"plt.figure(figsize=(6,6))\nsns.distplot(df1['Health Score'])\nplt.title('Health Score')","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-12-09T23:27:18.847606Z","iopub.execute_input":"2024-12-09T23:27:18.848109Z","iopub.status.idle":"2024-12-09T23:27:24.228892Z","shell.execute_reply.started":"2024-12-09T23:27:18.848059Z","shell.execute_reply":"2024-12-09T23:27:24.227582Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"plt.figure(figsize=(6,6))\nsns.distplot(df1['Annual Income'])\nplt.title('Annual Income')","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-12-09T23:27:36.788868Z","iopub.execute_input":"2024-12-09T23:27:36.789332Z","iopub.status.idle":"2024-12-09T23:27:42.209357Z","shell.execute_reply.started":"2024-12-09T23:27:36.789293Z","shell.execute_reply":"2024-12-09T23:27:42.208187Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"plt.hist(df1['Vehicle Age'])","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-12-09T23:28:09.417582Z","iopub.execute_input":"2024-12-09T23:28:09.418032Z","iopub.status.idle":"2024-12-09T23:28:09.726978Z","shell.execute_reply.started":"2024-12-09T23:28:09.417998Z","shell.execute_reply":"2024-12-09T23:28:09.725715Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"sns.barplot(x='Vehicle Age',y='Insurance Duration',hue='Gender',data=df1)","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-12-09T23:38:11.003524Z","iopub.execute_input":"2024-12-09T23:38:11.004025Z","iopub.status.idle":"2024-12-09T23:38:20.146754Z","shell.execute_reply.started":"2024-12-09T23:38:11.003986Z","shell.execute_reply":"2024-12-09T23:38:20.145335Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"df1['Previous Claims'].value_counts().plot.pie(autopct='%1.1f%%',shadow=True,figsize=(8,6))\nplt.show()","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-12-09T23:39:22.286371Z","iopub.execute_input":"2024-12-09T23:39:22.28686Z","iopub.status.idle":"2024-12-09T23:39:22.862063Z","shell.execute_reply.started":"2024-12-09T23:39:22.286822Z","shell.execute_reply":"2024-12-09T23:39:22.860717Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"sns.histplot(data=df1,x=\"Previous Claims\",hue=\"Gender\",bins=30,kde=True)","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-12-09T23:54:56.22621Z","iopub.execute_input":"2024-12-09T23:54:56.226666Z","iopub.status.idle":"2024-12-09T23:55:02.202551Z","shell.execute_reply.started":"2024-12-09T23:54:56.226629Z","shell.execute_reply":"2024-12-09T23:55:02.2014Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"X = df1.drop(columns='Premium Amount')\ny = df1['Premium Amount']","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-12-09T23:55:44.568494Z","iopub.execute_input":"2024-12-09T23:55:44.568967Z","iopub.status.idle":"2024-12-09T23:55:44.629207Z","shell.execute_reply.started":"2024-12-09T23:55:44.568928Z","shell.execute_reply":"2024-12-09T23:55:44.627993Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"print(X)","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-12-09T23:56:12.939594Z","iopub.execute_input":"2024-12-09T23:56:12.940063Z","iopub.status.idle":"2024-12-09T23:56:13.059902Z","shell.execute_reply.started":"2024-12-09T23:56:12.940025Z","shell.execute_reply":"2024-12-09T23:56:13.058734Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"print(y)","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-12-09T23:56:50.937631Z","iopub.execute_input":"2024-12-09T23:56:50.938098Z","iopub.status.idle":"2024-12-09T23:56:50.947341Z","shell.execute_reply.started":"2024-12-09T23:56:50.938062Z","shell.execute_reply":"2024-12-09T23:56:50.946013Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"X_train,X_test,y_train,y_test=train_test_split(X,y,test_size=0.2,random_state=42)","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-12-09T23:58:59.225235Z","iopub.execute_input":"2024-12-09T23:58:59.225777Z","iopub.status.idle":"2024-12-09T23:58:59.503226Z","shell.execute_reply.started":"2024-12-09T23:58:59.225723Z","shell.execute_reply":"2024-12-09T23:58:59.501737Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"print(X.shape, X_train.shape, X_test.shape)","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-12-09T23:59:21.2799Z","iopub.execute_input":"2024-12-09T23:59:21.280299Z","iopub.status.idle":"2024-12-09T23:59:21.286997Z","shell.execute_reply.started":"2024-12-09T23:59:21.280266Z","shell.execute_reply":"2024-12-09T23:59:21.285561Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"regressor=LinearRegression()","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-12-09T23:59:46.832018Z","iopub.execute_input":"2024-12-09T23:59:46.832454Z","iopub.status.idle":"2024-12-09T23:59:46.838184Z","shell.execute_reply.started":"2024-12-09T23:59:46.832418Z","shell.execute_reply":"2024-12-09T23:59:46.836845Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"regressor.fit(X_train,y_train)","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-12-10T00:00:09.099946Z","iopub.execute_input":"2024-12-10T00:00:09.100431Z","iopub.status.idle":"2024-12-10T00:00:10.765714Z","shell.execute_reply.started":"2024-12-10T00:00:09.100394Z","shell.execute_reply":"2024-12-10T00:00:10.764508Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"# prediction of training data\ntrain_predict=regressor.predict(X_train)","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-12-10T00:00:39.016805Z","iopub.execute_input":"2024-12-10T00:00:39.01726Z","iopub.status.idle":"2024-12-10T00:00:39.170255Z","shell.execute_reply.started":"2024-12-10T00:00:39.017212Z","shell.execute_reply":"2024-12-10T00:00:39.167312Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"train_predict","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-12-10T00:00:52.350523Z","iopub.execute_input":"2024-12-10T00:00:52.350941Z","iopub.status.idle":"2024-12-10T00:00:52.358804Z","shell.execute_reply.started":"2024-12-10T00:00:52.350908Z","shell.execute_reply":"2024-12-10T00:00:52.357492Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"#R squared error\nerror_score=metrics.r2_score(y_train,train_predict)\nprint(\"r_squared error :\",error_score)","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-12-10T00:01:15.661913Z","iopub.execute_input":"2024-12-10T00:01:15.662304Z","iopub.status.idle":"2024-12-10T00:01:15.680277Z","shell.execute_reply.started":"2024-12-10T00:01:15.662272Z","shell.execute_reply":"2024-12-10T00:01:15.678699Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"plt.scatter(y_train,train_predict)\nplt.xlabel(\"Actual Amount\")\nplt.ylabel(\"Predicted Amount\")\nplt.title(\"Actual Amount vs Predicted Amount\")","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-12-10T00:01:50.127326Z","iopub.execute_input":"2024-12-10T00:01:50.127773Z","iopub.status.idle":"2024-12-10T00:01:54.734956Z","shell.execute_reply.started":"2024-12-10T00:01:50.127736Z","shell.execute_reply":"2024-12-10T00:01:54.733586Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"test_predict=regressor.predict(X_test)","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-12-10T00:02:12.029723Z","iopub.execute_input":"2024-12-10T00:02:12.030225Z","iopub.status.idle":"2024-12-10T00:02:12.080984Z","shell.execute_reply.started":"2024-12-10T00:02:12.030184Z","shell.execute_reply":"2024-12-10T00:02:12.078851Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"test_predict","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-12-10T00:02:27.141853Z","iopub.execute_input":"2024-12-10T00:02:27.142281Z","iopub.status.idle":"2024-12-10T00:02:27.150805Z","shell.execute_reply.started":"2024-12-10T00:02:27.142245Z","shell.execute_reply":"2024-12-10T00:02:27.14956Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"error_score = metrics.r2_score(y_test, test_predict)\nprint(\"R squared Error : \", error_score)","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-12-10T00:02:47.083458Z","iopub.execute_input":"2024-12-10T00:02:47.083946Z","iopub.status.idle":"2024-12-10T00:02:47.092919Z","shell.execute_reply.started":"2024-12-10T00:02:47.083909Z","shell.execute_reply":"2024-12-10T00:02:47.091709Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"plt.scatter(y_test, test_predict)\nplt.xlabel(\"Actual Amount\")\nplt.ylabel(\"Predicted Amount\")\nplt.title(\" Actual Amount vs Predicted Amount\")","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-12-10T00:03:05.944014Z","iopub.execute_input":"2024-12-10T00:03:05.944469Z","iopub.status.idle":"2024-12-10T00:03:07.423381Z","shell.execute_reply.started":"2024-12-10T00:03:05.944432Z","shell.execute_reply":"2024-12-10T00:03:07.422041Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"lass_reg_model=Lasso()","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-12-10T00:03:47.839198Z","iopub.execute_input":"2024-12-10T00:03:47.839828Z","iopub.status.idle":"2024-12-10T00:03:47.849239Z","shell.execute_reply.started":"2024-12-10T00:03:47.839771Z","shell.execute_reply":"2024-12-10T00:03:47.847656Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"lass_reg_model.fit(X_train,y_train)","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-12-10T00:04:03.882504Z","iopub.execute_input":"2024-12-10T00:04:03.88293Z","iopub.status.idle":"2024-12-10T00:04:05.19016Z","shell.execute_reply.started":"2024-12-10T00:04:03.882897Z","shell.execute_reply":"2024-12-10T00:04:05.189108Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"training_data_prediction = lass_reg_model.predict(X_train)","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-12-10T00:04:23.626902Z","iopub.execute_input":"2024-12-10T00:04:23.627313Z","iopub.status.idle":"2024-12-10T00:04:23.776991Z","shell.execute_reply.started":"2024-12-10T00:04:23.627281Z","shell.execute_reply":"2024-12-10T00:04:23.775462Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"training_data_prediction","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-12-10T00:04:40.486781Z","iopub.execute_input":"2024-12-10T00:04:40.48722Z","iopub.status.idle":"2024-12-10T00:04:40.49502Z","shell.execute_reply.started":"2024-12-10T00:04:40.487185Z","shell.execute_reply":"2024-12-10T00:04:40.49383Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"error_score = metrics.r2_score(y_train, training_data_prediction)\nprint(\"R squared Error : \", error_score)","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-12-10T00:05:03.273722Z","iopub.execute_input":"2024-12-10T00:05:03.274624Z","iopub.status.idle":"2024-12-10T00:05:03.291726Z","shell.execute_reply.started":"2024-12-10T00:05:03.274576Z","shell.execute_reply":"2024-12-10T00:05:03.290407Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"# Visualize the actual prices and predicted prices\nplt.scatter(y_train, training_data_prediction)\nplt.xlabel(\"Actual Amount\")\nplt.ylabel(\"Predicted Amount\")\nplt.title(\" Actual Amount vs Predicted Amount\")","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-12-10T00:05:31.983675Z","iopub.execute_input":"2024-12-10T00:05:31.984109Z","iopub.status.idle":"2024-12-10T00:05:36.544096Z","shell.execute_reply.started":"2024-12-10T00:05:31.984074Z","shell.execute_reply":"2024-12-10T00:05:36.542704Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"# prediction of training data\ntest_data_prediction = lass_reg_model.predict(X_test)","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-12-10T00:06:20.625229Z","iopub.execute_input":"2024-12-10T00:06:20.625696Z","iopub.status.idle":"2024-12-10T00:06:20.6766Z","shell.execute_reply.started":"2024-12-10T00:06:20.625663Z","shell.execute_reply":"2024-12-10T00:06:20.674974Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"test_data_prediction","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-12-10T00:06:35.304064Z","iopub.execute_input":"2024-12-10T00:06:35.30453Z","iopub.status.idle":"2024-12-10T00:06:35.313564Z","shell.execute_reply.started":"2024-12-10T00:06:35.304462Z","shell.execute_reply":"2024-12-10T00:06:35.312133Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"# r squared error\nerror_score = metrics.r2_score(y_test, test_data_prediction)\nprint(\"R squared Error : \", error_score)","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-12-10T00:06:53.758747Z","iopub.execute_input":"2024-12-10T00:06:53.759164Z","iopub.status.idle":"2024-12-10T00:06:53.769011Z","shell.execute_reply.started":"2024-12-10T00:06:53.75913Z","shell.execute_reply":"2024-12-10T00:06:53.767844Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"plt.scatter(y_test, test_data_prediction)\nplt.xlabel(\"Actual Amount\")\nplt.ylabel(\"Predicted Amount\")\nplt.title(\" Actual Amount vs Predicted Amount\")","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-12-10T00:08:02.073592Z","iopub.execute_input":"2024-12-10T00:08:02.074056Z","iopub.status.idle":"2024-12-10T00:08:03.508398Z","shell.execute_reply.started":"2024-12-10T00:08:02.074017Z","shell.execute_reply":"2024-12-10T00:08:03.5071Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"# model evaluation\nmae = mean_absolute_error(y_test, test_predict)","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-12-10T00:08:46.563666Z","iopub.execute_input":"2024-12-10T00:08:46.564141Z","iopub.status.idle":"2024-12-10T00:08:46.571805Z","shell.execute_reply.started":"2024-12-10T00:08:46.564106Z","shell.execute_reply":"2024-12-10T00:08:46.570554Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"mse = mean_squared_error(y_test, test_predict)","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-12-10T00:09:03.849456Z","iopub.execute_input":"2024-12-10T00:09:03.849877Z","iopub.status.idle":"2024-12-10T00:09:03.857815Z","shell.execute_reply.started":"2024-12-10T00:09:03.849838Z","shell.execute_reply":"2024-12-10T00:09:03.85641Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"rmse = np.sqrt(mse)","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-12-10T00:09:19.369288Z","iopub.execute_input":"2024-12-10T00:09:19.36972Z","iopub.status.idle":"2024-12-10T00:09:19.375279Z","shell.execute_reply.started":"2024-12-10T00:09:19.369684Z","shell.execute_reply":"2024-12-10T00:09:19.373945Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"print(f'Mean Absolute Error: {mae}')\nprint(f'Mean Squared Error: {mse}')\nprint(f'Root Mean Squared Error: {rmse}')","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-12-10T00:09:39.014912Z","iopub.execute_input":"2024-12-10T00:09:39.015359Z","iopub.status.idle":"2024-12-10T00:09:39.023096Z","shell.execute_reply.started":"2024-12-10T00:09:39.015321Z","shell.execute_reply":"2024-12-10T00:09:39.02133Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"pred=regressor.predict(df2)","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-12-10T00:13:09.471142Z","iopub.execute_input":"2024-12-10T00:13:09.471736Z","iopub.status.idle":"2024-12-10T00:13:09.628156Z","shell.execute_reply.started":"2024-12-10T00:13:09.471676Z","shell.execute_reply":"2024-12-10T00:13:09.626577Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"pred","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-12-10T00:13:47.014707Z","iopub.execute_input":"2024-12-10T00:13:47.015167Z","iopub.status.idle":"2024-12-10T00:13:47.024355Z","shell.execute_reply.started":"2024-12-10T00:13:47.015129Z","shell.execute_reply":"2024-12-10T00:13:47.022969Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"final=pd.read_csv('/kaggle/input/playground-series-s4e12/sample_submission.csv')","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-12-10T00:43:29.032846Z","iopub.execute_input":"2024-12-10T00:43:29.033672Z","iopub.status.idle":"2024-12-10T00:43:29.482076Z","shell.execute_reply.started":"2024-12-10T00:43:29.033562Z","shell.execute_reply":"2024-12-10T00:43:29.480933Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"\nfinal['Premium Amount']=pred","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-12-10T00:45:10.318228Z","iopub.execute_input":"2024-12-10T00:45:10.318741Z","iopub.status.idle":"2024-12-10T00:45:10.328647Z","shell.execute_reply.started":"2024-12-10T00:45:10.318701Z","shell.execute_reply":"2024-12-10T00:45:10.327194Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"# writing a data frame to a csv file\nfinal.to_csv('f_output.csv',index=False)","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-12-10T00:47:42.38016Z","iopub.execute_input":"2024-12-10T00:47:42.380654Z","iopub.status.idle":"2024-12-10T00:47:44.207798Z","shell.execute_reply.started":"2024-12-10T00:47:42.380615Z","shell.execute_reply":"2024-12-10T00:47:44.206669Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"insurance=pd.read_csv('f_output.csv')","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-12-10T00:47:49.490614Z","iopub.execute_input":"2024-12-10T00:47:49.491073Z","iopub.status.idle":"2024-12-10T00:47:49.746342Z","shell.execute_reply.started":"2024-12-10T00:47:49.491036Z","shell.execute_reply":"2024-12-10T00:47:49.744776Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"insurance.head()","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-12-10T00:48:17.452608Z","iopub.execute_input":"2024-12-10T00:48:17.453089Z","iopub.status.idle":"2024-12-10T00:48:17.473135Z","shell.execute_reply.started":"2024-12-10T00:48:17.45305Z","shell.execute_reply":"2024-12-10T00:48:17.471775Z"}},"outputs":[],"execution_count":null}]}