{"metadata":{"kernelspec":{"language":"python","display_name":"Python 3","name":"python3"},"language_info":{"name":"python","version":"3.10.13","mimetype":"text/x-python","codemirror_mode":{"name":"ipython","version":3},"pygments_lexer":"ipython3","nbconvert_exporter":"python","file_extension":".py"},"kaggle":{"accelerator":"none","dataSources":[{"sourceId":50160,"databundleVersionId":7602123,"sourceType":"competition"}],"dockerImageVersionId":30646,"isInternetEnabled":true,"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)\nfrom IPython.display import display","metadata":{"_uuid":"8f2839f25d086af736a60e9eeb907d3b93b6e0e5","_cell_guid":"b1076dfc-b9ad-4769-8c92-a6c4dae69d19","execution":{"iopub.status.busy":"2024-02-07T02:22:51.625808Z","iopub.execute_input":"2024-02-07T02:22:51.626187Z","iopub.status.idle":"2024-02-07T02:22:51.632264Z","shell.execute_reply.started":"2024-02-07T02:22:51.626159Z","shell.execute_reply":"2024-02-07T02:22:51.631088Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"feature_def = pd.read_csv('/kaggle/input/home-credit-credit-risk-model-stability/feature_definitions.csv')\nfeature_def","metadata":{"execution":{"iopub.status.busy":"2024-02-07T02:22:51.635278Z","iopub.execute_input":"2024-02-07T02:22:51.635729Z","iopub.status.idle":"2024-02-07T02:22:51.655581Z","shell.execute_reply.started":"2024-02-07T02:22:51.635689Z","shell.execute_reply":"2024-02-07T02:22:51.654619Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"def table_feature_def(columns):\n    return feature_def[feature_def['Variable'].isin(columns)].reset_index(drop=True)","metadata":{"execution":{"iopub.status.busy":"2024-02-07T02:22:51.656923Z","iopub.execute_input":"2024-02-07T02:22:51.657228Z","iopub.status.idle":"2024-02-07T02:22:51.662290Z","shell.execute_reply.started":"2024-02-07T02:22:51.657202Z","shell.execute_reply":"2024-02-07T02:22:51.661351Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"base = pd.read_csv('/kaggle/input/home-credit-credit-risk-model-stability/csv_files/train/train_base.csv')","metadata":{"execution":{"iopub.status.busy":"2024-02-07T02:22:51.663200Z","iopub.execute_input":"2024-02-07T02:22:51.663482Z","iopub.status.idle":"2024-02-07T02:22:52.572248Z","shell.execute_reply.started":"2024-02-07T02:22:51.663457Z","shell.execute_reply":"2024-02-07T02:22:52.571317Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"base.head()","metadata":{"execution":{"iopub.status.busy":"2024-02-07T02:22:52.574390Z","iopub.execute_input":"2024-02-07T02:22:52.574990Z","iopub.status.idle":"2024-02-07T02:22:52.587216Z","shell.execute_reply.started":"2024-02-07T02:22:52.574957Z","shell.execute_reply":"2024-02-07T02:22:52.585909Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"static = pd.concat([pd.read_csv('/kaggle/input/home-credit-credit-risk-model-stability/csv_files/train/train_static_0_0.csv'),\n                    pd.read_csv('/kaggle/input/home-credit-credit-risk-model-stability/csv_files/train/train_static_0_1.csv')])","metadata":{"execution":{"iopub.status.busy":"2024-02-07T02:22:52.588941Z","iopub.execute_input":"2024-02-07T02:22:52.589371Z","iopub.status.idle":"2024-02-07T02:23:39.203444Z","shell.execute_reply.started":"2024-02-07T02:22:52.589332Z","shell.execute_reply":"2024-02-07T02:23:39.202439Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"table_feature_def(static)","metadata":{"execution":{"iopub.status.busy":"2024-02-07T02:23:39.205107Z","iopub.execute_input":"2024-02-07T02:23:39.205421Z","iopub.status.idle":"2024-02-07T02:23:39.222918Z","shell.execute_reply.started":"2024-02-07T02:23:39.205395Z","shell.execute_reply":"2024-02-07T02:23:39.221709Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"static_cb_0 = pd.read_csv('/kaggle/input/home-credit-credit-risk-model-stability/csv_files/train/train_static_cb_0.csv')","metadata":{"execution":{"iopub.status.busy":"2024-02-07T02:24:03.000631Z","iopub.execute_input":"2024-02-07T02:24:03.001016Z","iopub.status.idle":"2024-02-07T02:24:15.045945Z","shell.execute_reply.started":"2024-02-07T02:24:03.000988Z","shell.execute_reply":"2024-02-07T02:24:15.044726Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"table_feature_def(static_cb_0.columns)","metadata":{"execution":{"iopub.status.busy":"2024-02-07T02:24:34.562753Z","iopub.execute_input":"2024-02-07T02:24:34.563184Z","iopub.status.idle":"2024-02-07T02:24:34.580037Z","shell.execute_reply.started":"2024-02-07T02:24:34.563153Z","shell.execute_reply":"2024-02-07T02:24:34.579202Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"applprev_1 = pd.concat([pd.read_csv(\"/kaggle/input/home-credit-credit-risk-model-stability/csv_files/train/train_applprev_1_0.csv\"), \n           pd.read_csv(\"/kaggle/input/home-credit-credit-risk-model-stability/csv_files/train/train_applprev_1_1.csv\")])","metadata":{"execution":{"iopub.status.busy":"2024-02-07T02:24:40.996831Z","iopub.execute_input":"2024-02-07T02:24:40.997230Z","iopub.status.idle":"2024-02-07T02:25:52.085350Z","shell.execute_reply.started":"2024-02-07T02:24:40.997199Z","shell.execute_reply":"2024-02-07T02:25:52.083710Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"table_feature_def(applprev_1)","metadata":{"execution":{"iopub.status.busy":"2024-02-07T02:25:58.808040Z","iopub.execute_input":"2024-02-07T02:25:58.808482Z","iopub.status.idle":"2024-02-07T02:25:58.830361Z","shell.execute_reply.started":"2024-02-07T02:25:58.808448Z","shell.execute_reply":"2024-02-07T02:25:58.829138Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"other_1 = pd.read_csv(\"/kaggle/input/home-credit-credit-risk-model-stability/csv_files/train/train_other_1.csv\")","metadata":{"execution":{"iopub.status.busy":"2024-02-07T02:26:02.400550Z","iopub.execute_input":"2024-02-07T02:26:02.401020Z","iopub.status.idle":"2024-02-07T02:26:02.485449Z","shell.execute_reply.started":"2024-02-07T02:26:02.400988Z","shell.execute_reply":"2024-02-07T02:26:02.484297Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"table_feature_def(other_1)","metadata":{"execution":{"iopub.status.busy":"2024-02-07T02:26:08.027482Z","iopub.execute_input":"2024-02-07T02:26:08.027960Z","iopub.status.idle":"2024-02-07T02:26:08.039432Z","shell.execute_reply.started":"2024-02-07T02:26:08.027927Z","shell.execute_reply":"2024-02-07T02:26:08.038606Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"tax_registry_a_1 = pd.read_csv(\"/kaggle/input/home-credit-credit-risk-model-stability/csv_files/train/train_tax_registry_a_1.csv\")\ntax_registry_b_1 = pd.read_csv(\"/kaggle/input/home-credit-credit-risk-model-stability/csv_files/train/train_tax_registry_b_1.csv\")\ntax_registry_c_1 = pd.read_csv(\"/kaggle/input/home-credit-credit-risk-model-stability/csv_files/train/train_tax_registry_c_1.csv\")","metadata":{"execution":{"iopub.status.busy":"2024-02-07T02:26:09.173113Z","iopub.execute_input":"2024-02-07T02:26:09.173566Z","iopub.status.idle":"2024-02-07T02:26:19.022717Z","shell.execute_reply.started":"2024-02-07T02:26:09.173517Z","shell.execute_reply":"2024-02-07T02:26:19.021417Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"display(table_feature_def(tax_registry_a_1))\ndisplay(table_feature_def(tax_registry_b_1))\ndisplay(table_feature_def(tax_registry_c_1))","metadata":{"execution":{"iopub.status.busy":"2024-02-07T02:26:23.575053Z","iopub.execute_input":"2024-02-07T02:26:23.575464Z","iopub.status.idle":"2024-02-07T02:26:23.600959Z","shell.execute_reply.started":"2024-02-07T02:26:23.575436Z","shell.execute_reply":"2024-02-07T02:26:23.599860Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"credit_bureau_a_1 = pd.concat([pd.read_csv(\"/kaggle/input/home-credit-credit-risk-model-stability/csv_files/train/train_credit_bureau_a_1_0.csv\"),\n                               pd.read_csv(\"/kaggle/input/home-credit-credit-risk-model-stability/csv_files/train/train_credit_bureau_a_1_1.csv\"),\n                               pd.read_csv(\"/kaggle/input/home-credit-credit-risk-model-stability/csv_files/train/train_credit_bureau_a_1_2.csv\"),\n                               pd.read_csv(\"/kaggle/input/home-credit-credit-risk-model-stability/csv_files/train/train_credit_bureau_a_1_3.csv\")])","metadata":{"execution":{"iopub.status.busy":"2024-02-07T02:26:26.677780Z","iopub.execute_input":"2024-02-07T02:26:26.678179Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"table_feature_def(credit_bureau_a_1_0.columns)","metadata":{"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"","metadata":{},"execution_count":null,"outputs":[]}]}