{"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":"# 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)\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# 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'):\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","execution":{"iopub.status.busy":"2023-05-05T11:12:29.121434Z","iopub.execute_input":"2023-05-05T11:12:29.121822Z","iopub.status.idle":"2023-05-05T11:12:29.136706Z","shell.execute_reply.started":"2023-05-05T11:12:29.121794Z","shell.execute_reply":"2023-05-05T11:12:29.135822Z"},"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-05T11:12:33.579843Z","iopub.execute_input":"2023-05-05T11:12:33.580227Z","iopub.status.idle":"2023-05-05T11:13:04.189982Z","shell.execute_reply.started":"2023-05-05T11:12:33.580201Z","shell.execute_reply":"2023-05-05T11:13:04.189001Z"},"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-05T11:13:11.412790Z","iopub.execute_input":"2023-05-05T11:13:11.414040Z","iopub.status.idle":"2023-05-05T11:13:14.307875Z","shell.execute_reply.started":"2023-05-05T11:13:11.413980Z","shell.execute_reply":"2023-05-05T11:13:14.306853Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"labels['q'].value_counts()","metadata":{"execution":{"iopub.status.busy":"2023-05-05T11:13:19.143445Z","iopub.execute_input":"2023-05-05T11:13:19.143811Z","iopub.status.idle":"2023-05-05T11:13:19.164133Z","shell.execute_reply.started":"2023-05-05T11:13:19.143786Z","shell.execute_reply":"2023-05-05T11:13:19.163156Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"session_ids = list(np.unique(labels[\"session_id\"]))","metadata":{"execution":{"iopub.status.busy":"2023-05-05T11:13:28.168676Z","iopub.execute_input":"2023-05-05T11:13:28.169040Z","iopub.status.idle":"2023-05-05T11:13:28.618636Z","shell.execute_reply.started":"2023-05-05T11:13:28.169013Z","shell.execute_reply":"2023-05-05T11:13:28.617464Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"len(session_ids)","metadata":{"execution":{"iopub.status.busy":"2023-05-05T11:13:32.165110Z","iopub.execute_input":"2023-05-05T11:13:32.165461Z","iopub.status.idle":"2023-05-05T11:13:32.176803Z","shell.execute_reply.started":"2023-05-05T11:13:32.165434Z","shell.execute_reply":"2023-05-05T11:13:32.175782Z"},"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)\nprint(\"Full train dataset shape is {}\".format(dataset_df.shape))","metadata":{"execution":{"iopub.status.busy":"2023-05-05T11:33:01.418262Z","iopub.execute_input":"2023-05-05T11:33:01.418650Z","iopub.status.idle":"2023-05-05T11:34:54.062929Z","shell.execute_reply.started":"2023-05-05T11:33:01.418620Z","shell.execute_reply":"2023-05-05T11:34:54.061983Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"dataset_df.head(100)","metadata":{"execution":{"iopub.status.busy":"2023-05-05T11:37:22.451834Z","iopub.execute_input":"2023-05-05T11:37:22.452594Z","iopub.status.idle":"2023-05-05T11:37:22.495839Z","shell.execute_reply.started":"2023-05-05T11:37:22.452549Z","shell.execute_reply":"2023-05-05T11:37:22.494687Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"dataset_df['session_id'].hist(bins = 30)","metadata":{"execution":{"iopub.status.busy":"2023-05-05T11:45:29.188131Z","iopub.execute_input":"2023-05-05T11:45:29.188600Z","iopub.status.idle":"2023-05-05T11:45:30.459431Z","shell.execute_reply.started":"2023-05-05T11:45:29.188555Z","shell.execute_reply":"2023-05-05T11:45:30.458249Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"dataset_df['event_name'].hist(bins = 30)","metadata":{"execution":{"iopub.status.busy":"2023-05-05T11:45:51.887743Z","iopub.execute_input":"2023-05-05T11:45:51.888128Z","iopub.status.idle":"2023-05-05T11:46:01.544720Z","shell.execute_reply.started":"2023-05-05T11:45:51.888100Z","shell.execute_reply":"2023-05-05T11:46:01.543864Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"dataset_df['name'].hist(bins = 30)","metadata":{"execution":{"iopub.status.busy":"2023-05-05T11:46:19.994118Z","iopub.execute_input":"2023-05-05T11:46:19.994500Z","iopub.status.idle":"2023-05-05T11:46:29.042655Z","shell.execute_reply.started":"2023-05-05T11:46:19.994470Z","shell.execute_reply":"2023-05-05T11:46:29.041807Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"dataset_df['page'].hist(bins = 30)","metadata":{"execution":{"iopub.status.busy":"2023-05-05T11:46:52.470119Z","iopub.execute_input":"2023-05-05T11:46:52.470691Z","iopub.status.idle":"2023-05-05T11:46:53.192419Z","shell.execute_reply.started":"2023-05-05T11:46:52.470649Z","shell.execute_reply":"2023-05-05T11:46:53.191607Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"dataset_df['level_group'].hist(bins = 10)","metadata":{"execution":{"iopub.status.busy":"2023-05-05T11:51:26.442802Z","iopub.execute_input":"2023-05-05T11:51:26.443203Z","iopub.status.idle":"2023-05-05T11:51:35.563499Z","shell.execute_reply.started":"2023-05-05T11:51:26.443174Z","shell.execute_reply":"2023-05-05T11:51:35.559897Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"import numpy as np\nnp.random.seed(100)\nangka = []\nfor i in range (0, 100):\n    angka.append(i)","metadata":{"execution":{"iopub.status.busy":"2023-05-05T11:24:19.879618Z","iopub.execute_input":"2023-05-05T11:24:19.880148Z","iopub.status.idle":"2023-05-05T11:24:19.886057Z","shell.execute_reply.started":"2023-05-05T11:24:19.880117Z","shell.execute_reply":"2023-05-05T11:24:19.885192Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"dataset_df = pd.DataFrame(np.random.rand(100, 5), angka,['A','B','C','D','E'])","metadata":{"execution":{"iopub.status.busy":"2023-05-05T11:24:24.799450Z","iopub.execute_input":"2023-05-05T11:24:24.799815Z","iopub.status.idle":"2023-05-05T11:24:24.805913Z","shell.execute_reply.started":"2023-05-05T11:24:24.799787Z","shell.execute_reply":"2023-05-05T11:24:24.804874Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"dataset_df.plot.area()","metadata":{"execution":{"iopub.status.busy":"2023-05-05T11:24:27.528762Z","iopub.execute_input":"2023-05-05T11:24:27.529532Z","iopub.status.idle":"2023-05-05T11:24:28.772855Z","shell.execute_reply.started":"2023-05-05T11:24:27.529435Z","shell.execute_reply":"2023-05-05T11:24:28.771988Z"},"trusted":true},"execution_count":null,"outputs":[]}]}