{"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\nimport seaborn as sns\nplt.style.use('fivethirtyeight')\nplt.rcParams['figure.figsize'] = (30, 20)\nsns.set_style('darkgrid')\n\nimport os\nfor dirname, _, filenames in os.walk('/kaggle/input'):\n    for filename in filenames:\n        print(os.path.join(dirname, filename))","metadata":{"execution":{"iopub.status.busy":"2023-05-05T14:39:29.910007Z","iopub.execute_input":"2023-05-05T14:39:29.910390Z","iopub.status.idle":"2023-05-05T14:39:29.920726Z","shell.execute_reply.started":"2023-05-05T14:39:29.910350Z","shell.execute_reply":"2023-05-05T14:39:29.919875Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"train_id = pl.read_csv('/kaggle/input/predict-student-performance-from-game-play/train.csv', columns = ['index'])\ndisplay(train_id)","metadata":{"execution":{"iopub.status.busy":"2023-05-05T14:39:37.158692Z","iopub.execute_input":"2023-05-05T14:39:37.159045Z","iopub.status.idle":"2023-05-05T14:40:09.303313Z","shell.execute_reply.started":"2023-05-05T14:39:37.159018Z","shell.execute_reply":"2023-05-05T14:40:09.302292Z"},"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-05T14:40:15.494414Z","iopub.execute_input":"2023-05-05T14:40:15.494822Z","iopub.status.idle":"2023-05-05T14:40:18.653679Z","shell.execute_reply.started":"2023-05-05T14:40:15.494787Z","shell.execute_reply":"2023-05-05T14:40:18.652572Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"labels['q'].value_counts()","metadata":{"execution":{"iopub.status.busy":"2023-05-05T14:40:24.253564Z","iopub.execute_input":"2023-05-05T14:40:24.253940Z","iopub.status.idle":"2023-05-05T14:40:24.274934Z","shell.execute_reply.started":"2023-05-05T14:40:24.253911Z","shell.execute_reply":"2023-05-05T14:40:24.273737Z"},"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-05T14:40:27.541376Z","iopub.execute_input":"2023-05-05T14:40:27.541807Z","iopub.status.idle":"2023-05-05T14:40:28.013078Z","shell.execute_reply.started":"2023-05-05T14:40:27.541770Z","shell.execute_reply":"2023-05-05T14:40:28.011936Z"},"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-05T14:42:30.746678Z","iopub.execute_input":"2023-05-05T14:42:30.747098Z","iopub.status.idle":"2023-05-05T14:44:48.803661Z","shell.execute_reply.started":"2023-05-05T14:42:30.747067Z","shell.execute_reply":"2023-05-05T14:44:48.802194Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"dataset_df['session_id'].hist(bins = 20)","metadata":{"execution":{"iopub.status.busy":"2023-05-05T14:45:09.435610Z","iopub.execute_input":"2023-05-05T14:45:09.436585Z","iopub.status.idle":"2023-05-05T14:45:10.822272Z","shell.execute_reply.started":"2023-05-05T14:45:09.436523Z","shell.execute_reply":"2023-05-05T14:45:10.821478Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"dataset_df['event_name'].hist(bins = 30)","metadata":{"execution":{"iopub.status.busy":"2023-05-05T14:45:31.988959Z","iopub.execute_input":"2023-05-05T14:45:31.989361Z","iopub.status.idle":"2023-05-05T14:45:41.165242Z","shell.execute_reply.started":"2023-05-05T14:45:31.989328Z","shell.execute_reply":"2023-05-05T14:45:41.164477Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"dataset_df['name'].hist(bins = 30)","metadata":{"execution":{"iopub.status.busy":"2023-05-05T14:45:46.464366Z","iopub.execute_input":"2023-05-05T14:45:46.465510Z","iopub.status.idle":"2023-05-05T14:45:57.062152Z","shell.execute_reply.started":"2023-05-05T14:45:46.465469Z","shell.execute_reply":"2023-05-05T14:45:57.061305Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"dataset_df['page'].hist(bins = 30)","metadata":{"execution":{"iopub.status.busy":"2023-05-05T14:46:08.990888Z","iopub.execute_input":"2023-05-05T14:46:08.991318Z","iopub.status.idle":"2023-05-05T14:46:09.750206Z","shell.execute_reply.started":"2023-05-05T14:46:08.991287Z","shell.execute_reply":"2023-05-05T14:46:09.749315Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"dataset_df['level_group'].hist(bins = 10)","metadata":{"execution":{"iopub.status.busy":"2023-05-05T14:46:13.985616Z","iopub.execute_input":"2023-05-05T14:46:13.986015Z","iopub.status.idle":"2023-05-05T14:46:24.302232Z","shell.execute_reply.started":"2023-05-05T14:46:13.985984Z","shell.execute_reply":"2023-05-05T14:46:24.301302Z"},"trusted":true},"execution_count":null,"outputs":[]}]}