{"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 # linear algebra\nimport pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)\nimport polars as pl\nfrom matplotlib import pyplot as plt\n\nimport os\nfor dirname, _, filenames in os.walk('/kaggle/input'):\n    for filename in filenames:\n        print(os.path.join(dirname, filename))","metadata":{"_uuid":"8f2839f25d086af736a60e9eeb907d3b93b6e0e5","_cell_guid":"b1076dfc-b9ad-4769-8c92-a6c4dae69d19","execution":{"iopub.status.busy":"2023-05-05T15:46:53.641316Z","iopub.execute_input":"2023-05-05T15:46:53.641971Z","iopub.status.idle":"2023-05-05T15:46:53.874288Z","shell.execute_reply.started":"2023-05-05T15:46:53.641930Z","shell.execute_reply":"2023-05-05T15:46:53.873250Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"dtyping = {\n    'session_id' : np.uint64,\n    'index' : np.uint8,\n    'elapsed_time' : np.uint8,\n    'event_name' : 'category',\n    'name' : 'category',\n    'level' : np.uint8,\n    'page' : np.float32,\n    'room_coor_x' : np.float32,\n    'room_coor_y' : np.float32,\n    'screen_coor_x' : np.float32,\n    'screen_coor_y' : np.float32,\n    'hover_duration' : np.float32,\n    'text' : 'category',\n    'fqid' : 'category',\n    'room_fqid' : 'category',\n    'text_fqid' : 'category',\n    'fullscreen' : np.bool8,\n    'hq' : np.bool8,\n    'music' : np.bool8,\n    'level_group' : 'category'\n}\ndataset_df = pd.read_csv('/kaggle/input/predict-student-performance-from-game-play/train.csv', dtype=dtyping)\ndataset_df.head(50)","metadata":{"execution":{"iopub.status.busy":"2023-05-05T15:12:49.209063Z","iopub.execute_input":"2023-05-05T15:12:49.209488Z","iopub.status.idle":"2023-05-05T15:14:34.596768Z","shell.execute_reply.started":"2023-05-05T15:12:49.209458Z","shell.execute_reply":"2023-05-05T15:14:34.595577Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"dataset_df['session_id'].hist(bins = 20)","metadata":{"execution":{"iopub.status.busy":"2023-05-05T15:14:45.269793Z","iopub.execute_input":"2023-05-05T15:14:45.271610Z","iopub.status.idle":"2023-05-05T15:14:47.480321Z","shell.execute_reply.started":"2023-05-05T15:14:45.271552Z","shell.execute_reply":"2023-05-05T15:14:47.478523Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"dataset_df['event_name'].hist(bins = 30)","metadata":{"execution":{"iopub.status.busy":"2023-05-05T15:14:52.755780Z","iopub.execute_input":"2023-05-05T15:14:52.756886Z","iopub.status.idle":"2023-05-05T15:15:07.351569Z","shell.execute_reply.started":"2023-05-05T15:14:52.756844Z","shell.execute_reply":"2023-05-05T15:15:07.350346Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"dataset_df['name'].hist(bins = 30)","metadata":{"execution":{"iopub.status.busy":"2023-05-05T15:15:12.110589Z","iopub.execute_input":"2023-05-05T15:15:12.111029Z","iopub.status.idle":"2023-05-05T15:15:23.680379Z","shell.execute_reply.started":"2023-05-05T15:15:12.110996Z","shell.execute_reply":"2023-05-05T15:15:23.678744Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"dataset_df['page'].hist(bins = 30)","metadata":{"execution":{"iopub.status.busy":"2023-05-05T15:15:27.465079Z","iopub.execute_input":"2023-05-05T15:15:27.465510Z","iopub.status.idle":"2023-05-05T15:15:28.277589Z","shell.execute_reply.started":"2023-05-05T15:15:27.465476Z","shell.execute_reply":"2023-05-05T15:15:28.275420Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"dataset_df['level_group'].hist(bins = 30)","metadata":{"execution":{"iopub.status.busy":"2023-05-05T15:15:31.981686Z","iopub.execute_input":"2023-05-05T15:15:31.982153Z","iopub.status.idle":"2023-05-05T15:15:42.436632Z","shell.execute_reply.started":"2023-05-05T15:15:31.982123Z","shell.execute_reply":"2023-05-05T15:15:42.434689Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"labels = pd.read_csv('/kaggle/input/predict-student-performance-from-game-play/train_labels.csv')\nlabels['session'] = labels['session_id'].str.split('_', expand = True)[0].astype(np.uint64)\nlabels['q'] = labels['session_id'].str.split('_q', expand = True)[1].astype(int)  \nlabels","metadata":{"execution":{"iopub.status.busy":"2023-05-05T15:12:30.862212Z","iopub.execute_input":"2023-05-05T15:12:30.862641Z","iopub.status.idle":"2023-05-05T15:12:34.551981Z","shell.execute_reply.started":"2023-05-05T15:12:30.862608Z","shell.execute_reply":"2023-05-05T15:12:34.550463Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"labels['q'].value_counts()","metadata":{"execution":{"iopub.status.busy":"2023-05-05T15:12:42.791215Z","iopub.execute_input":"2023-05-05T15:12:42.791731Z","iopub.status.idle":"2023-05-05T15:12:42.818146Z","shell.execute_reply.started":"2023-05-05T15:12:42.791687Z","shell.execute_reply":"2023-05-05T15:12:42.816571Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"session_ids = list(np.unique(labels[\"session_id\"]))\nlen(session_ids)","metadata":{"execution":{"iopub.status.busy":"2023-05-05T15:12:46.192677Z","iopub.execute_input":"2023-05-05T15:12:46.193757Z","iopub.status.idle":"2023-05-05T15:12:46.715449Z","shell.execute_reply.started":"2023-05-05T15:12:46.193697Z","shell.execute_reply":"2023-05-05T15:12:46.713948Z"},"trusted":true},"execution_count":null,"outputs":[]}]}