{"metadata":{"kernelspec":{"language":"python","display_name":"Python 3","name":"python3"},"language_info":{"pygments_lexer":"ipython3","nbconvert_exporter":"python","version":"3.6.4","file_extension":".py","codemirror_mode":{"name":"ipython","version":3},"name":"python","mimetype":"text/x-python"}},"nbformat_minor":4,"nbformat":4,"cells":[{"cell_type":"code","source":"import numpy as np\nimport pandas as pd\nfrom sklearn.model_selection import KFold, GroupKFold\nfrom xgboost import XGBClassifier\nfrom sklearn.metrics import f1_score","metadata":{"_uuid":"8f2839f25d086af736a60e9eeb907d3b93b6e0e5","_cell_guid":"b1076dfc-b9ad-4769-8c92-a6c4dae69d19","execution":{"iopub.status.busy":"2023-03-30T20:00:07.967673Z","iopub.execute_input":"2023-03-30T20:00:07.968091Z","iopub.status.idle":"2023-03-30T20:00:09.134328Z","shell.execute_reply.started":"2023-03-30T20:00:07.968053Z","shell.execute_reply":"2023-03-30T20:00:09.133038Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"dtypes = {\"session_id\": 'int64',\n          \"index\": np.int16,\n          \"elapsed_time\": np.int32,\n          \"event_name\": 'category',\n          \"name\": 'category',\n          \"level\": np.int8,\n          \"page\": np.float16,\n          \"room_coor_x\": np.float16,\n          \"room_coor_y\": np.float16,\n          \"screen_coor_x\": np.float16,\n          \"screen_coor_y\": np.float16,\n          \"hover_duration\": np.float32,\n          \"text\": 'category',\n          \"fqid\": 'category',\n          \"room_fqid\": 'category',\n          \"text_fqid\": 'category',\n          \"fullscreen\": np.int8,\n          \"hq\": np.int8,\n          \"music\": np.int8,\n          \"level_group\": 'category'\n          }\n# Specify the list of columns you are using\nuse_col = ['session_id', 'index', 'elapsed_time', 'event_name', 'name', 'level', 'page', 'room_coor_x', 'room_coor_y', \n           'screen_coor_x', 'screen_coor_y', 'hover_duration', 'text', 'fqid', 'room_fqid', 'text_fqid', 'level_group']\n","metadata":{"execution":{"iopub.status.busy":"2023-03-30T20:00:14.773906Z","iopub.execute_input":"2023-03-30T20:00:14.775213Z","iopub.status.idle":"2023-03-30T20:00:14.783737Z","shell.execute_reply.started":"2023-03-30T20:00:14.775158Z","shell.execute_reply":"2023-03-30T20:00:14.782310Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"train_df = pd.read_csv('/kaggle/input/predict-student-performance-from-game-play/train.csv', dtype=dtypes, usecols=use_col)\nmem_usg = train_df.memory_usage().sum() / 1024 ** 2\nprint(\"Memory usage became: \", mem_usg, \" MB\")","metadata":{"execution":{"iopub.status.busy":"2023-03-30T20:00:57.247891Z","iopub.execute_input":"2023-03-30T20:00:57.248340Z","iopub.status.idle":"2023-03-30T20:03:09.039204Z","shell.execute_reply.started":"2023-03-30T20:00:57.248301Z","shell.execute_reply":"2023-03-30T20:03:09.037548Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"train_df.head()","metadata":{"execution":{"iopub.status.busy":"2023-03-30T20:03:28.477144Z","iopub.execute_input":"2023-03-30T20:03:28.477597Z","iopub.status.idle":"2023-03-30T20:03:28.518637Z","shell.execute_reply.started":"2023-03-30T20:03:28.477560Z","shell.execute_reply":"2023-03-30T20:03:28.517458Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"test_df=pd.read_csv(\"/kaggle/input/predict-student-performance-from-game-play/test.csv\")\ntest_df.head()","metadata":{"execution":{"iopub.status.busy":"2023-03-30T20:03:52.461427Z","iopub.execute_input":"2023-03-30T20:03:52.461835Z","iopub.status.idle":"2023-03-30T20:03:52.524203Z","shell.execute_reply.started":"2023-03-30T20:03:52.461798Z","shell.execute_reply":"2023-03-30T20:03:52.522782Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"raw","source":"","metadata":{}},{"cell_type":"code","source":"targets = pd.read_csv(\"/kaggle/input/predict-student-performance-from-game-play/train_labels.csv\")\ntargets.head()","metadata":{"execution":{"iopub.status.busy":"2023-03-30T20:04:42.411264Z","iopub.execute_input":"2023-03-30T20:04:42.412358Z","iopub.status.idle":"2023-03-30T20:04:42.708933Z","shell.execute_reply.started":"2023-03-30T20:04:42.412312Z","shell.execute_reply":"2023-03-30T20:04:42.707879Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"","metadata":{},"execution_count":null,"outputs":[]}]}