{"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":"nvidiaTeslaT4","dataSources":[{"sourceId":84896,"databundleVersionId":10305135,"sourceType":"competition"}],"dockerImageVersionId":30805,"isInternetEnabled":true,"language":"python","sourceType":"notebook","isGpuEnabled":true}},"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/playground-series-s4e12'):\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-03T17:38:59.144889Z","iopub.execute_input":"2024-12-03T17:38:59.145254Z","iopub.status.idle":"2024-12-03T17:38:59.160988Z","shell.execute_reply.started":"2024-12-03T17:38:59.145219Z","shell.execute_reply":"2024-12-03T17:38:59.160086Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"df_train=pd.read_csv('/kaggle/input/playground-series-s4e12/train.csv')\ndf_test=pd.read_csv('/kaggle/input/playground-series-s4e12/test.csv')\n","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-12-03T17:38:59.513857Z","iopub.execute_input":"2024-12-03T17:38:59.514146Z","iopub.status.idle":"2024-12-03T17:39:04.922461Z","shell.execute_reply.started":"2024-12-03T17:38:59.51412Z","shell.execute_reply":"2024-12-03T17:39:04.921745Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"df_train","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-12-03T17:39:04.923723Z","iopub.execute_input":"2024-12-03T17:39:04.923994Z","iopub.status.idle":"2024-12-03T17:39:05.563616Z","shell.execute_reply.started":"2024-12-03T17:39:04.923968Z","shell.execute_reply":"2024-12-03T17:39:05.562749Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"df_test.isna().sum()","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-12-03T17:39:05.564639Z","iopub.execute_input":"2024-12-03T17:39:05.564933Z","iopub.status.idle":"2024-12-03T17:39:05.922117Z","shell.execute_reply.started":"2024-12-03T17:39:05.564909Z","shell.execute_reply":"2024-12-03T17:39:05.921248Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"df_test['Premium Amount']=0.0","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-12-03T17:39:05.923522Z","iopub.execute_input":"2024-12-03T17:39:05.923806Z","iopub.status.idle":"2024-12-03T17:39:05.92849Z","shell.execute_reply.started":"2024-12-03T17:39:05.923781Z","shell.execute_reply":"2024-12-03T17:39:05.927748Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"df=pd.concat([df_train,df_test],axis='rows')","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-12-03T17:39:05.929381Z","iopub.execute_input":"2024-12-03T17:39:05.92961Z","iopub.status.idle":"2024-12-03T17:39:06.24913Z","shell.execute_reply.started":"2024-12-03T17:39:05.929588Z","shell.execute_reply":"2024-12-03T17:39:06.248434Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"df","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-12-03T17:39:06.250164Z","iopub.execute_input":"2024-12-03T17:39:06.2505Z","iopub.status.idle":"2024-12-03T17:39:08.335726Z","shell.execute_reply.started":"2024-12-03T17:39:06.250464Z","shell.execute_reply":"2024-12-03T17:39:08.334869Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"df.isna().sum()","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-12-03T17:39:08.338056Z","iopub.execute_input":"2024-12-03T17:39:08.338742Z","iopub.status.idle":"2024-12-03T17:39:09.243105Z","shell.execute_reply.started":"2024-12-03T17:39:08.338675Z","shell.execute_reply":"2024-12-03T17:39:09.242147Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"df.info()","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-12-03T17:39:09.244126Z","iopub.execute_input":"2024-12-03T17:39:09.244398Z","iopub.status.idle":"2024-12-03T17:39:09.254071Z","shell.execute_reply.started":"2024-12-03T17:39:09.244373Z","shell.execute_reply":"2024-12-03T17:39:09.253057Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"import seaborn as sns\n\nsns.kdeplot(df['Age'])","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-12-03T17:39:09.255199Z","iopub.execute_input":"2024-12-03T17:39:09.255796Z","iopub.status.idle":"2024-12-03T17:39:16.901796Z","shell.execute_reply.started":"2024-12-03T17:39:09.255767Z","shell.execute_reply":"2024-12-03T17:39:16.900921Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"df['Age'].median()","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-12-03T17:39:16.903487Z","iopub.execute_input":"2024-12-03T17:39:16.903752Z","iopub.status.idle":"2024-12-03T17:39:16.944363Z","shell.execute_reply.started":"2024-12-03T17:39:16.903723Z","shell.execute_reply":"2024-12-03T17:39:16.943613Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"df['Age'].mean()","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-12-03T17:39:16.945331Z","iopub.execute_input":"2024-12-03T17:39:16.945594Z","iopub.status.idle":"2024-12-03T17:39:16.959135Z","shell.execute_reply.started":"2024-12-03T17:39:16.945569Z","shell.execute_reply":"2024-12-03T17:39:16.958421Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"df['Age']=df['Age'].fillna(df['Age'].median())","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-12-03T17:39:16.960188Z","iopub.execute_input":"2024-12-03T17:39:16.960764Z","iopub.status.idle":"2024-12-03T17:39:17.005034Z","shell.execute_reply.started":"2024-12-03T17:39:16.960724Z","shell.execute_reply":"2024-12-03T17:39:17.004337Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"df.isna().sum()","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-12-03T17:39:19.019194Z","iopub.execute_input":"2024-12-03T17:39:19.019839Z","iopub.status.idle":"2024-12-03T17:39:19.927836Z","shell.execute_reply.started":"2024-12-03T17:39:19.019806Z","shell.execute_reply":"2024-12-03T17:39:19.926929Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"sns.kdeplot(df['Annual Income'])","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-12-03T17:09:51.172135Z","iopub.execute_input":"2024-12-03T17:09:51.172492Z","iopub.status.idle":"2024-12-03T17:09:58.887602Z","shell.execute_reply.started":"2024-12-03T17:09:51.172455Z","shell.execute_reply":"2024-12-03T17:09:58.886743Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"df['Annual Income'].mean()","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-12-03T17:39:21.649133Z","iopub.execute_input":"2024-12-03T17:39:21.649467Z","iopub.status.idle":"2024-12-03T17:39:21.664087Z","shell.execute_reply.started":"2024-12-03T17:39:21.64943Z","shell.execute_reply":"2024-12-03T17:39:21.663367Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"df['Annual Income'].median()","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-12-03T17:39:23.139622Z","iopub.execute_input":"2024-12-03T17:39:23.13997Z","iopub.status.idle":"2024-12-03T17:39:23.17352Z","shell.execute_reply.started":"2024-12-03T17:39:23.139942Z","shell.execute_reply":"2024-12-03T17:39:23.17268Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"23957.0-32768.681192151846\n","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-12-03T17:09:58.939555Z","iopub.execute_input":"2024-12-03T17:09:58.939901Z","iopub.status.idle":"2024-12-03T17:09:58.945055Z","shell.execute_reply.started":"2024-12-03T17:09:58.939874Z","shell.execute_reply":"2024-12-03T17:09:58.944119Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"df['Annual Income']=df['Annual Income'].fillna(df['Annual Income'].median())","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-12-03T17:39:26.939795Z","iopub.execute_input":"2024-12-03T17:39:26.940506Z","iopub.status.idle":"2024-12-03T17:39:26.982059Z","shell.execute_reply.started":"2024-12-03T17:39:26.940475Z","shell.execute_reply":"2024-12-03T17:39:26.98133Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"df.isna().sum()","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-12-03T17:39:31.204853Z","iopub.execute_input":"2024-12-03T17:39:31.205165Z","iopub.status.idle":"2024-12-03T17:39:32.120169Z","shell.execute_reply.started":"2024-12-03T17:39:31.20514Z","shell.execute_reply":"2024-12-03T17:39:32.119306Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"df['Marital Status'].value_counts()","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-12-03T17:39:38.33468Z","iopub.execute_input":"2024-12-03T17:39:38.335079Z","iopub.status.idle":"2024-12-03T17:39:38.467455Z","shell.execute_reply.started":"2024-12-03T17:39:38.335052Z","shell.execute_reply":"2024-12-03T17:39:38.466637Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"df['Marital Status']=df['Marital Status'].fillna(df['Marital Status'].mode()[0])","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-12-03T17:16:24.96393Z","iopub.execute_input":"2024-12-03T17:16:24.964612Z","iopub.status.idle":"2024-12-03T17:16:25.254886Z","shell.execute_reply.started":"2024-12-03T17:16:24.964578Z","shell.execute_reply":"2024-12-03T17:16:25.253941Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"from sklearn.preprocessing import OneHotEncoder\n\nencoder = OneHotEncoder()\n\na=encoder.fit_transform(df[['Marital Status']]).toarray()\n\na=pd.DataFrame(a,columns=encoder.get_feature_names_out())","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-12-03T17:39:41.464549Z","iopub.execute_input":"2024-12-03T17:39:41.465232Z","iopub.status.idle":"2024-12-03T17:39:41.909019Z","shell.execute_reply.started":"2024-12-03T17:39:41.465185Z","shell.execute_reply":"2024-12-03T17:39:41.908289Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"a","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-12-03T17:16:30.233857Z","iopub.execute_input":"2024-12-03T17:16:30.234502Z","iopub.status.idle":"2024-12-03T17:16:30.246102Z","shell.execute_reply.started":"2024-12-03T17:16:30.23446Z","shell.execute_reply":"2024-12-03T17:16:30.245079Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"cols=a.columns\nfor col in cols:\n    df[col]=a[col]\n\n\na.columns","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-12-03T17:39:45.34961Z","iopub.execute_input":"2024-12-03T17:39:45.350383Z","iopub.status.idle":"2024-12-03T17:39:45.582908Z","shell.execute_reply.started":"2024-12-03T17:39:45.350351Z","shell.execute_reply":"2024-12-03T17:39:45.581994Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"df.drop(['Marital Status_nan'],axis=1,inplace=True)","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-12-03T17:39:48.049825Z","iopub.execute_input":"2024-12-03T17:39:48.050127Z","iopub.status.idle":"2024-12-03T17:39:48.406227Z","shell.execute_reply.started":"2024-12-03T17:39:48.050103Z","shell.execute_reply":"2024-12-03T17:39:48.405531Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"df.isna().sum()","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-12-03T17:39:51.389885Z","iopub.execute_input":"2024-12-03T17:39:51.390228Z","iopub.status.idle":"2024-12-03T17:39:52.329637Z","shell.execute_reply.started":"2024-12-03T17:39:51.390192Z","shell.execute_reply":"2024-12-03T17:39:52.328739Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"sns.kdeplot(df['Number of Dependents'].value_counts(),fill=True,color='r')","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-12-03T17:19:19.899144Z","iopub.execute_input":"2024-12-03T17:19:19.899476Z","iopub.status.idle":"2024-12-03T17:19:20.224708Z","shell.execute_reply.started":"2024-12-03T17:19:19.899446Z","shell.execute_reply":"2024-12-03T17:19:20.223724Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"df['Number of Dependents']=df['Number of Dependents'].fillna(df['Number of Dependents'].median())","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-12-03T17:39:58.175865Z","iopub.execute_input":"2024-12-03T17:39:58.176177Z","iopub.status.idle":"2024-12-03T17:39:58.226932Z","shell.execute_reply.started":"2024-12-03T17:39:58.17615Z","shell.execute_reply":"2024-12-03T17:39:58.225965Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"df.isna().sum()","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-12-03T17:40:01.670347Z","iopub.execute_input":"2024-12-03T17:40:01.671038Z","iopub.status.idle":"2024-12-03T17:40:02.568674Z","shell.execute_reply.started":"2024-12-03T17:40:01.671002Z","shell.execute_reply":"2024-12-03T17:40:02.567805Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"sns.kdeplot(df['Occupation'])","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-12-03T17:21:34.265264Z","iopub.execute_input":"2024-12-03T17:21:34.266146Z","iopub.status.idle":"2024-12-03T17:21:35.495534Z","shell.execute_reply.started":"2024-12-03T17:21:34.266109Z","shell.execute_reply":"2024-12-03T17:21:35.494204Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"df['Occupation']=df['Occupation'].fillna(df['Occupation'].mode()[0])","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-12-03T17:40:09.250718Z","iopub.execute_input":"2024-12-03T17:40:09.251056Z","iopub.status.idle":"2024-12-03T17:40:09.475385Z","shell.execute_reply.started":"2024-12-03T17:40:09.251025Z","shell.execute_reply":"2024-12-03T17:40:09.474679Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"df.isna().sum()","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-12-03T17:40:13.184789Z","iopub.execute_input":"2024-12-03T17:40:13.185856Z","iopub.status.idle":"2024-12-03T17:40:14.0913Z","shell.execute_reply.started":"2024-12-03T17:40:13.185809Z","shell.execute_reply":"2024-12-03T17:40:14.090405Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"\nfrom sklearn.preprocessing import OneHotEncoder\n\nencoder = OneHotEncoder()\n\na=encoder.fit_transform(df[['Occupation']]).toarray()\n\na=pd.DataFrame(a,columns=encoder.get_feature_names_out())","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-12-03T17:40:17.029668Z","iopub.execute_input":"2024-12-03T17:40:17.030477Z","iopub.status.idle":"2024-12-03T17:40:17.461211Z","shell.execute_reply.started":"2024-12-03T17:40:17.030444Z","shell.execute_reply":"2024-12-03T17:40:17.460505Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"cols=a.columns\nfor col in cols:\n    df[col]=a[col]\n\n\na.columns","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-12-03T17:40:20.014919Z","iopub.execute_input":"2024-12-03T17:40:20.015602Z","iopub.status.idle":"2024-12-03T17:40:20.192624Z","shell.execute_reply.started":"2024-12-03T17:40:20.01557Z","shell.execute_reply":"2024-12-03T17:40:20.191747Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"df","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-12-03T17:23:54.039323Z","iopub.execute_input":"2024-12-03T17:23:54.039701Z","iopub.status.idle":"2024-12-03T17:23:55.989271Z","shell.execute_reply.started":"2024-12-03T17:23:54.039656Z","shell.execute_reply":"2024-12-03T17:23:55.988173Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"df.isna().sum()","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-12-03T17:40:25.446494Z","iopub.execute_input":"2024-12-03T17:40:25.446815Z","iopub.status.idle":"2024-12-03T17:40:26.351934Z","shell.execute_reply.started":"2024-12-03T17:40:25.446787Z","shell.execute_reply":"2024-12-03T17:40:26.351017Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"df['Health Score']","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-12-03T17:41:13.732167Z","iopub.execute_input":"2024-12-03T17:41:13.733092Z","iopub.status.idle":"2024-12-03T17:41:13.740093Z","shell.execute_reply.started":"2024-12-03T17:41:13.733055Z","shell.execute_reply":"2024-12-03T17:41:13.739202Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"sns.kdeplot(df['Health Score'])","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-12-03T17:27:18.175985Z","iopub.execute_input":"2024-12-03T17:27:18.176752Z","iopub.status.idle":"2024-12-03T17:27:25.761837Z","shell.execute_reply.started":"2024-12-03T17:27:18.176691Z","shell.execute_reply":"2024-12-03T17:27:25.76094Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"df['Health Score']=df['Health Score'].fillna(df['Health Score'].median())","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-12-03T17:41:18.570527Z","iopub.execute_input":"2024-12-03T17:41:18.570868Z","iopub.status.idle":"2024-12-03T17:41:18.621097Z","shell.execute_reply.started":"2024-12-03T17:41:18.570838Z","shell.execute_reply":"2024-12-03T17:41:18.620386Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"df.isna().sum()","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-12-03T17:41:18.865196Z","iopub.execute_input":"2024-12-03T17:41:18.865835Z","iopub.status.idle":"2024-12-03T17:41:19.770305Z","shell.execute_reply.started":"2024-12-03T17:41:18.865803Z","shell.execute_reply":"2024-12-03T17:41:19.769439Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"sns.kdeplot(df['Previous Claims'])","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-12-03T17:30:40.716475Z","iopub.execute_input":"2024-12-03T17:30:40.717144Z","iopub.status.idle":"2024-12-03T17:30:46.459005Z","shell.execute_reply.started":"2024-12-03T17:30:40.717112Z","shell.execute_reply":"2024-12-03T17:30:46.45804Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"df['Previous Claims']=df['Previous Claims'].fillna(0)","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-12-03T17:41:33.271775Z","iopub.execute_input":"2024-12-03T17:41:33.272083Z","iopub.status.idle":"2024-12-03T17:41:33.28668Z","shell.execute_reply.started":"2024-12-03T17:41:33.272055Z","shell.execute_reply":"2024-12-03T17:41:33.285986Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"df.isna().sum()","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-12-03T17:41:35.219954Z","iopub.execute_input":"2024-12-03T17:41:35.220725Z","iopub.status.idle":"2024-12-03T17:41:36.129848Z","shell.execute_reply.started":"2024-12-03T17:41:35.220667Z","shell.execute_reply":"2024-12-03T17:41:36.128932Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"df['Vehicle Age']=df['Vehicle Age'].fillna(0)","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-12-03T17:41:42.075234Z","iopub.execute_input":"2024-12-03T17:41:42.075538Z","iopub.status.idle":"2024-12-03T17:41:42.088531Z","shell.execute_reply.started":"2024-12-03T17:41:42.075513Z","shell.execute_reply":"2024-12-03T17:41:42.08786Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"df.isna().sum()","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-12-03T17:41:44.754874Z","iopub.execute_input":"2024-12-03T17:41:44.755548Z","iopub.status.idle":"2024-12-03T17:41:45.666884Z","shell.execute_reply.started":"2024-12-03T17:41:44.755515Z","shell.execute_reply":"2024-12-03T17:41:45.665994Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"sns.kdeplot(df['Credit Score'])","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-12-03T17:33:34.321324Z","iopub.execute_input":"2024-12-03T17:33:34.322129Z","iopub.status.idle":"2024-12-03T17:33:41.533634Z","shell.execute_reply.started":"2024-12-03T17:33:34.322095Z","shell.execute_reply":"2024-12-03T17:33:41.532837Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"df['Credit Score']=df['Credit Score'].fillna(df['Credit Score'].mean().round())","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-12-03T17:41:54.920478Z","iopub.execute_input":"2024-12-03T17:41:54.92133Z","iopub.status.idle":"2024-12-03T17:41:54.947313Z","shell.execute_reply.started":"2024-12-03T17:41:54.921296Z","shell.execute_reply":"2024-12-03T17:41:54.946576Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"df","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-12-03T17:35:13.045978Z","iopub.execute_input":"2024-12-03T17:35:13.046344Z","iopub.status.idle":"2024-12-03T17:35:14.918473Z","shell.execute_reply.started":"2024-12-03T17:35:13.046314Z","shell.execute_reply":"2024-12-03T17:35:14.91759Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"df.isna().sum()","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-12-03T17:41:59.339651Z","iopub.execute_input":"2024-12-03T17:41:59.340011Z","iopub.status.idle":"2024-12-03T17:42:00.258141Z","shell.execute_reply.started":"2024-12-03T17:41:59.339984Z","shell.execute_reply":"2024-12-03T17:42:00.257183Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"sns.distplot(df['Insurance Duration'].value_counts())","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-12-03T17:36:22.988935Z","iopub.execute_input":"2024-12-03T17:36:22.989579Z","iopub.status.idle":"2024-12-03T17:36:23.261548Z","shell.execute_reply.started":"2024-12-03T17:36:22.989543Z","shell.execute_reply":"2024-12-03T17:36:23.26077Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"df['Insurance Duration'].fillna(df['Insurance Duration'].mean(),inplace=True)","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-12-03T17:42:19.171421Z","iopub.execute_input":"2024-12-03T17:42:19.172201Z","iopub.status.idle":"2024-12-03T17:42:19.190751Z","shell.execute_reply.started":"2024-12-03T17:42:19.172167Z","shell.execute_reply":"2024-12-03T17:42:19.18997Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"df.isna().sum()","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-12-03T17:42:28.581207Z","iopub.execute_input":"2024-12-03T17:42:28.581945Z","iopub.status.idle":"2024-12-03T17:42:29.490748Z","shell.execute_reply.started":"2024-12-03T17:42:28.581911Z","shell.execute_reply":"2024-12-03T17:42:29.489884Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"df['Customer Feedback'].fillna(df['Customer Feedback'].mode()[0],inplace=True)","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-12-03T17:42:37.671084Z","iopub.execute_input":"2024-12-03T17:42:37.671584Z","iopub.status.idle":"2024-12-03T17:42:37.890979Z","shell.execute_reply.started":"2024-12-03T17:42:37.671547Z","shell.execute_reply":"2024-12-03T17:42:37.890068Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"df.isna().sum()","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-12-03T17:42:44.755431Z","iopub.execute_input":"2024-12-03T17:42:44.755786Z","iopub.status.idle":"2024-12-03T17:42:45.658633Z","shell.execute_reply.started":"2024-12-03T17:42:44.755755Z","shell.execute_reply":"2024-12-03T17:42:45.657776Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"df.drop(['Marital Status','Occupation'],axis=1,inplace=True)","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-12-03T17:43:31.925552Z","iopub.execute_input":"2024-12-03T17:43:31.926301Z","iopub.status.idle":"2024-12-03T17:43:32.277521Z","shell.execute_reply.started":"2024-12-03T17:43:31.926268Z","shell.execute_reply":"2024-12-03T17:43:32.276819Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"df.isna().sum()","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-12-03T17:43:40.325745Z","iopub.execute_input":"2024-12-03T17:43:40.326104Z","iopub.status.idle":"2024-12-03T17:43:41.102927Z","shell.execute_reply.started":"2024-12-03T17:43:40.326061Z","shell.execute_reply":"2024-12-03T17:43:41.101971Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"df=df.set_index(['id'])","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-12-03T17:44:15.30551Z","iopub.execute_input":"2024-12-03T17:44:15.306185Z","iopub.status.idle":"2024-12-03T17:44:16.205072Z","shell.execute_reply.started":"2024-12-03T17:44:15.306149Z","shell.execute_reply":"2024-12-03T17:44:16.204001Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"df","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-12-03T17:44:19.319786Z","iopub.execute_input":"2024-12-03T17:44:19.320124Z","iopub.status.idle":"2024-12-03T17:44:20.568229Z","shell.execute_reply.started":"2024-12-03T17:44:19.320097Z","shell.execute_reply":"2024-12-03T17:44:20.567371Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"","metadata":{"trusted":true},"outputs":[],"execution_count":null}]}