{"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":"markdown","source":"## Predict Student Performance from Game Play","metadata":{"papermill":{"duration":0.018996,"end_time":"2023-03-11T02:42:44.153073","exception":false,"start_time":"2023-03-11T02:42:44.134077","status":"completed"},"tags":[]}},{"cell_type":"markdown","source":"Online educational games can collect a wide variety of data about student performance, such as time spent playing, progress through game levels, scores, and quiz results. This data can be used to identify patterns and predict future performance. For example, if a student has consistently performed well on certain types of activities in the game, it's likely that they will continue to do so in the future.\n\nBy analyzing this data over time, educators can also track how student learning progresses over time. This information can be used to identify areas where students are struggling and provide additional support or resources. Similarly, data can be used to identify areas where students are excelling and to provide additional challenges or opportunities for growth.\n\nOverall, data from online educational games can provide valuable insights into student performance and learning. By using this data effectively, educators can provide targeted and personalized support to help students succeed","metadata":{"papermill":{"duration":0.016372,"end_time":"2023-03-11T02:42:44.185660","exception":false,"start_time":"2023-03-11T02:42:44.169288","status":"completed"},"tags":[]}},{"cell_type":"markdown","source":"# Data","metadata":{"papermill":{"duration":0.014588,"end_time":"2023-03-11T02:42:44.215689","exception":false,"start_time":"2023-03-11T02:42:44.201101","status":"completed"},"tags":[]}},{"cell_type":"code","source":"import os\nfor dirname, _, filenames in os.walk('/kaggle/input'):\n    for filename in filenames:\n        print(os.path.join(dirname, filename))","metadata":{"execution":{"iopub.execute_input":"2023-03-11T02:42:44.246791Z","iopub.status.busy":"2023-03-11T02:42:44.246405Z","iopub.status.idle":"2023-03-11T02:42:44.287477Z","shell.execute_reply":"2023-03-11T02:42:44.286416Z"},"papermill":{"duration":0.059128,"end_time":"2023-03-11T02:42:44.289546","exception":false,"start_time":"2023-03-11T02:42:44.230418","status":"completed"},"tags":[]},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"import pandas as pd \nimport numpy as np ","metadata":{"execution":{"iopub.execute_input":"2023-03-11T02:42:44.322209Z","iopub.status.busy":"2023-03-11T02:42:44.321412Z","iopub.status.idle":"2023-03-11T02:42:44.326849Z","shell.execute_reply":"2023-03-11T02:42:44.325776Z"},"papermill":{"duration":0.024682,"end_time":"2023-03-11T02:42:44.329231","exception":false,"start_time":"2023-03-11T02:42:44.304549","status":"completed"},"tags":[]},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"sample = pd.read_csv(\"//kaggle/input/gameplay/sample_submission.csv\")\n","metadata":{"execution":{"iopub.execute_input":"2023-03-11T02:42:44.365091Z","iopub.status.busy":"2023-03-11T02:42:44.364658Z","iopub.status.idle":"2023-03-11T02:42:44.382209Z","shell.execute_reply":"2023-03-11T02:42:44.380867Z"},"papermill":{"duration":0.037619,"end_time":"2023-03-11T02:42:44.384462","exception":false,"start_time":"2023-03-11T02:42:44.346843","status":"completed"},"tags":[]},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"sample.head()","metadata":{"execution":{"iopub.execute_input":"2023-03-11T02:42:44.416721Z","iopub.status.busy":"2023-03-11T02:42:44.416292Z","iopub.status.idle":"2023-03-11T02:42:44.440186Z","shell.execute_reply":"2023-03-11T02:42:44.439505Z"},"papermill":{"duration":0.042388,"end_time":"2023-03-11T02:42:44.441881","exception":false,"start_time":"2023-03-11T02:42:44.399493","status":"completed"},"tags":[]},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"train = pd.read_csv(\"/kaggle/input/train-for-predict-gameplay/train.csv\")\n\n","metadata":{"execution":{"iopub.execute_input":"2023-03-11T02:42:44.473403Z","iopub.status.busy":"2023-03-11T02:42:44.473045Z","iopub.status.idle":"2023-03-11T02:43:39.008652Z","shell.execute_reply":"2023-03-11T02:43:39.007381Z"},"papermill":{"duration":54.554768,"end_time":"2023-03-11T02:43:39.011578","exception":false,"start_time":"2023-03-11T02:42:44.456810","status":"completed"},"tags":[]},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"page , name index , event name ","metadata":{"papermill":{"duration":0.0147,"end_time":"2023-03-11T02:43:39.041438","exception":false,"start_time":"2023-03-11T02:43:39.026738","status":"completed"},"tags":[]}},{"cell_type":"code","source":"train.columns","metadata":{"execution":{"iopub.execute_input":"2023-03-11T02:43:39.072629Z","iopub.status.busy":"2023-03-11T02:43:39.072247Z","iopub.status.idle":"2023-03-11T02:43:39.078727Z","shell.execute_reply":"2023-03-11T02:43:39.077767Z"},"papermill":{"duration":0.024655,"end_time":"2023-03-11T02:43:39.080768","exception":false,"start_time":"2023-03-11T02:43:39.056113","status":"completed"},"tags":[]},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"\nX = train[['page','name','event_name','level','index']]\n\n","metadata":{"execution":{"iopub.execute_input":"2023-03-11T02:43:39.113915Z","iopub.status.busy":"2023-03-11T02:43:39.113331Z","iopub.status.idle":"2023-03-11T02:43:39.371697Z","shell.execute_reply":"2023-03-11T02:43:39.370809Z"},"papermill":{"duration":0.278382,"end_time":"2023-03-11T02:43:39.374758","exception":false,"start_time":"2023-03-11T02:43:39.096376","status":"completed"},"tags":[]},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"X","metadata":{"execution":{"iopub.execute_input":"2023-03-11T02:43:39.407870Z","iopub.status.busy":"2023-03-11T02:43:39.407412Z","iopub.status.idle":"2023-03-11T02:43:39.425193Z","shell.execute_reply":"2023-03-11T02:43:39.423754Z"},"papermill":{"duration":0.037857,"end_time":"2023-03-11T02:43:39.427856","exception":false,"start_time":"2023-03-11T02:43:39.389999","status":"completed"},"tags":[]},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"test = pd.read_csv(\"/kaggle/input/gameplay/test.csv\")","metadata":{"execution":{"iopub.execute_input":"2023-03-11T02:43:39.461127Z","iopub.status.busy":"2023-03-11T02:43:39.460746Z","iopub.status.idle":"2023-03-11T02:43:39.492410Z","shell.execute_reply":"2023-03-11T02:43:39.491094Z"},"papermill":{"duration":0.051423,"end_time":"2023-03-11T02:43:39.494891","exception":false,"start_time":"2023-03-11T02:43:39.443468","status":"completed"},"tags":[]},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"train_label = pd.read_csv(\"/kaggle/input/gameplay/train_labels.csv\")","metadata":{"execution":{"iopub.execute_input":"2023-03-11T02:43:39.527805Z","iopub.status.busy":"2023-03-11T02:43:39.526987Z","iopub.status.idle":"2023-03-11T02:43:39.725062Z","shell.execute_reply":"2023-03-11T02:43:39.723752Z"},"papermill":{"duration":0.217098,"end_time":"2023-03-11T02:43:39.727395","exception":false,"start_time":"2023-03-11T02:43:39.510297","status":"completed"},"tags":[]},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"train.head()","metadata":{"execution":{"iopub.execute_input":"2023-03-11T02:43:39.760181Z","iopub.status.busy":"2023-03-11T02:43:39.759816Z","iopub.status.idle":"2023-03-11T02:43:39.780499Z","shell.execute_reply":"2023-03-11T02:43:39.779415Z"},"papermill":{"duration":0.040035,"end_time":"2023-03-11T02:43:39.783137","exception":false,"start_time":"2023-03-11T02:43:39.743102","status":"completed"},"tags":[]},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"test.head()","metadata":{"execution":{"iopub.execute_input":"2023-03-11T02:43:39.816584Z","iopub.status.busy":"2023-03-11T02:43:39.816215Z","iopub.status.idle":"2023-03-11T02:43:39.840211Z","shell.execute_reply":"2023-03-11T02:43:39.839468Z"},"papermill":{"duration":0.04326,"end_time":"2023-03-11T02:43:39.842338","exception":false,"start_time":"2023-03-11T02:43:39.799078","status":"completed"},"tags":[]},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"train_label.head()","metadata":{"execution":{"iopub.execute_input":"2023-03-11T02:43:39.876163Z","iopub.status.busy":"2023-03-11T02:43:39.875813Z","iopub.status.idle":"2023-03-11T02:43:39.885568Z","shell.execute_reply":"2023-03-11T02:43:39.884549Z"},"papermill":{"duration":0.030096,"end_time":"2023-03-11T02:43:39.888468","exception":false,"start_time":"2023-03-11T02:43:39.858372","status":"completed"},"tags":[]},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"test['index'].unique","metadata":{"execution":{"iopub.execute_input":"2023-03-11T02:43:39.923801Z","iopub.status.busy":"2023-03-11T02:43:39.922993Z","iopub.status.idle":"2023-03-11T02:43:39.933389Z","shell.execute_reply":"2023-03-11T02:43:39.932362Z"},"papermill":{"duration":0.031379,"end_time":"2023-03-11T02:43:39.936073","exception":false,"start_time":"2023-03-11T02:43:39.904694","status":"completed"},"tags":[]},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"print(train.shape)\nprint(test.shape)\n","metadata":{"execution":{"iopub.execute_input":"2023-03-11T02:43:39.971356Z","iopub.status.busy":"2023-03-11T02:43:39.970841Z","iopub.status.idle":"2023-03-11T02:43:39.977346Z","shell.execute_reply":"2023-03-11T02:43:39.976081Z"},"papermill":{"duration":0.027449,"end_time":"2023-03-11T02:43:39.979664","exception":false,"start_time":"2023-03-11T02:43:39.952215","status":"completed"},"tags":[]},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"# review data ","metadata":{"papermill":{"duration":0.016331,"end_time":"2023-03-11T02:43:40.012405","exception":false,"start_time":"2023-03-11T02:43:39.996074","status":"completed"},"tags":[]}},{"cell_type":"code","source":"import seaborn as sns \nimport matplotlib.pyplot as plt","metadata":{"execution":{"iopub.execute_input":"2023-03-11T02:43:40.046743Z","iopub.status.busy":"2023-03-11T02:43:40.046398Z","iopub.status.idle":"2023-03-11T02:43:41.079507Z","shell.execute_reply":"2023-03-11T02:43:41.078397Z"},"papermill":{"duration":1.053362,"end_time":"2023-03-11T02:43:41.082043","exception":false,"start_time":"2023-03-11T02:43:40.028681","status":"completed"},"tags":[]},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"train['event_name'].unique","metadata":{"execution":{"iopub.execute_input":"2023-03-11T02:43:41.117173Z","iopub.status.busy":"2023-03-11T02:43:41.116754Z","iopub.status.idle":"2023-03-11T02:43:41.125737Z","shell.execute_reply":"2023-03-11T02:43:41.124856Z"},"papermill":{"duration":0.032278,"end_time":"2023-03-11T02:43:41.130457","exception":false,"start_time":"2023-03-11T02:43:41.098179","status":"completed"},"tags":[]},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"train['event_name'].describe","metadata":{"execution":{"iopub.execute_input":"2023-03-11T02:43:41.177264Z","iopub.status.busy":"2023-03-11T02:43:41.176865Z","iopub.status.idle":"2023-03-11T02:43:41.187463Z","shell.execute_reply":"2023-03-11T02:43:41.185658Z"},"papermill":{"duration":0.036131,"end_time":"2023-03-11T02:43:41.190083","exception":false,"start_time":"2023-03-11T02:43:41.153952","status":"completed"},"tags":[]},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"train['level_group'].unique","metadata":{"execution":{"iopub.execute_input":"2023-03-11T02:43:41.226050Z","iopub.status.busy":"2023-03-11T02:43:41.225472Z","iopub.status.idle":"2023-03-11T02:43:41.234024Z","shell.execute_reply":"2023-03-11T02:43:41.233011Z"},"papermill":{"duration":0.028791,"end_time":"2023-03-11T02:43:41.235936","exception":false,"start_time":"2023-03-11T02:43:41.207145","status":"completed"},"tags":[]},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"train['level_group'].describe","metadata":{"execution":{"iopub.execute_input":"2023-03-11T02:43:41.270788Z","iopub.status.busy":"2023-03-11T02:43:41.270114Z","iopub.status.idle":"2023-03-11T02:43:41.277109Z","shell.execute_reply":"2023-03-11T02:43:41.276149Z"},"papermill":{"duration":0.027016,"end_time":"2023-03-11T02:43:41.279456","exception":false,"start_time":"2023-03-11T02:43:41.252440","status":"completed"},"tags":[]},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"- there was 2 type of main even auto navigation and manualy click \n- level for finish the game from 0 until 22 like [0-4 stage ] - [13-22 stage]","metadata":{"papermill":{"duration":0.016507,"end_time":"2023-03-11T02:43:41.312806","exception":false,"start_time":"2023-03-11T02:43:41.296299","status":"completed"},"tags":[]}},{"cell_type":"code","source":"train['session_id'].describe","metadata":{"execution":{"iopub.execute_input":"2023-03-11T02:43:41.348412Z","iopub.status.busy":"2023-03-11T02:43:41.348022Z","iopub.status.idle":"2023-03-11T02:43:41.355384Z","shell.execute_reply":"2023-03-11T02:43:41.354528Z"},"papermill":{"duration":0.027396,"end_time":"2023-03-11T02:43:41.357186","exception":false,"start_time":"2023-03-11T02:43:41.329790","status":"completed"},"tags":[]},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"## check valuable columns and missing value","metadata":{"papermill":{"duration":0.01719,"end_time":"2023-03-11T02:43:41.391141","exception":false,"start_time":"2023-03-11T02:43:41.373951","status":"completed"},"tags":[]}},{"cell_type":"code","source":"import missingno as msno","metadata":{"execution":{"iopub.execute_input":"2023-03-11T02:43:41.426893Z","iopub.status.busy":"2023-03-11T02:43:41.426368Z","iopub.status.idle":"2023-03-11T02:43:41.435165Z","shell.execute_reply":"2023-03-11T02:43:41.434088Z"},"papermill":{"duration":0.029411,"end_time":"2023-03-11T02:43:41.437382","exception":false,"start_time":"2023-03-11T02:43:41.407971","status":"completed"},"tags":[]},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"msno.bar(train)","metadata":{"execution":{"iopub.execute_input":"2023-03-11T02:43:41.473173Z","iopub.status.busy":"2023-03-11T02:43:41.472799Z","iopub.status.idle":"2023-03-11T02:43:45.889148Z","shell.execute_reply":"2023-03-11T02:43:45.888360Z"},"papermill":{"duration":4.437179,"end_time":"2023-03-11T02:43:45.891593","exception":false,"start_time":"2023-03-11T02:43:41.454414","status":"completed"},"tags":[]},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"msno.bar(test)","metadata":{"execution":{"iopub.execute_input":"2023-03-11T02:43:45.930499Z","iopub.status.busy":"2023-03-11T02:43:45.929971Z","iopub.status.idle":"2023-03-11T02:43:47.013038Z","shell.execute_reply":"2023-03-11T02:43:47.012364Z"},"papermill":{"duration":1.104799,"end_time":"2023-03-11T02:43:47.014846","exception":false,"start_time":"2023-03-11T02:43:45.910047","status":"completed"},"tags":[]},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"- there was no value at all for column fullscrene hq music so we doesn't need this data because can't representative  the data ","metadata":{"papermill":{"duration":0.019217,"end_time":"2023-03-11T02:43:47.053727","exception":false,"start_time":"2023-03-11T02:43:47.034510","status":"completed"},"tags":[]}},{"cell_type":"code","source":"test.columns","metadata":{"execution":{"iopub.execute_input":"2023-03-11T02:43:47.098078Z","iopub.status.busy":"2023-03-11T02:43:47.097427Z","iopub.status.idle":"2023-03-11T02:43:47.103268Z","shell.execute_reply":"2023-03-11T02:43:47.102367Z"},"papermill":{"duration":0.031717,"end_time":"2023-03-11T02:43:47.105162","exception":false,"start_time":"2023-03-11T02:43:47.073445","status":"completed"},"tags":[]},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"test = test[['session_id', 'index', 'elapsed_time', 'event_name', 'name', 'level',\n       'page', 'room_coor_x', 'room_coor_y', 'screen_coor_x', 'screen_coor_y',\n       'hover_duration', 'text', 'fqid', 'room_fqid', 'text_fqid','level_group', 'session_level']]","metadata":{"execution":{"iopub.execute_input":"2023-03-11T02:43:47.146625Z","iopub.status.busy":"2023-03-11T02:43:47.146225Z","iopub.status.idle":"2023-03-11T02:43:47.153248Z","shell.execute_reply":"2023-03-11T02:43:47.151705Z"},"papermill":{"duration":0.030998,"end_time":"2023-03-11T02:43:47.155772","exception":false,"start_time":"2023-03-11T02:43:47.124774","status":"completed"},"tags":[]},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"msno.bar(test)","metadata":{"execution":{"iopub.execute_input":"2023-03-11T02:43:47.211589Z","iopub.status.busy":"2023-03-11T02:43:47.210974Z","iopub.status.idle":"2023-03-11T02:43:48.137129Z","shell.execute_reply":"2023-03-11T02:43:48.136381Z"},"papermill":{"duration":0.960993,"end_time":"2023-03-11T02:43:48.138925","exception":false,"start_time":"2023-03-11T02:43:47.177932","status":"completed"},"tags":[]},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"msno.bar(train)","metadata":{"execution":{"iopub.execute_input":"2023-03-11T02:43:48.183964Z","iopub.status.busy":"2023-03-11T02:43:48.183457Z","iopub.status.idle":"2023-03-11T02:43:52.559000Z","shell.execute_reply":"2023-03-11T02:43:52.557647Z"},"papermill":{"duration":4.400761,"end_time":"2023-03-11T02:43:52.561009","exception":false,"start_time":"2023-03-11T02:43:48.160248","status":"completed"},"tags":[]},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"train.columns","metadata":{"execution":{"iopub.execute_input":"2023-03-11T02:43:52.606676Z","iopub.status.busy":"2023-03-11T02:43:52.606286Z","iopub.status.idle":"2023-03-11T02:43:52.612831Z","shell.execute_reply":"2023-03-11T02:43:52.611977Z"},"papermill":{"duration":0.031632,"end_time":"2023-03-11T02:43:52.614630","exception":false,"start_time":"2023-03-11T02:43:52.582998","status":"completed"},"tags":[]},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"train = train[['session_id', 'index', 'elapsed_time', 'event_name', 'name', 'level',\n       'page', 'room_coor_x', 'room_coor_y', 'screen_coor_x', 'screen_coor_y',\n       'hover_duration', 'text', 'fqid', 'room_fqid', 'text_fqid','level_group']]","metadata":{"execution":{"iopub.execute_input":"2023-03-11T02:43:52.661029Z","iopub.status.busy":"2023-03-11T02:43:52.660685Z","iopub.status.idle":"2023-03-11T02:43:53.605098Z","shell.execute_reply":"2023-03-11T02:43:53.604369Z"},"papermill":{"duration":0.970144,"end_time":"2023-03-11T02:43:53.606762","exception":false,"start_time":"2023-03-11T02:43:52.636618","status":"completed"},"tags":[]},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"msno.bar(train)","metadata":{"execution":{"iopub.execute_input":"2023-03-11T02:43:53.653338Z","iopub.status.busy":"2023-03-11T02:43:53.652998Z","iopub.status.idle":"2023-03-11T02:43:57.893230Z","shell.execute_reply":"2023-03-11T02:43:57.892292Z"},"papermill":{"duration":4.265991,"end_time":"2023-03-11T02:43:57.895229","exception":false,"start_time":"2023-03-11T02:43:53.629238","status":"completed"},"tags":[]},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"# preprocessing","metadata":{"papermill":{"duration":0.023352,"end_time":"2023-03-11T02:43:57.942869","exception":false,"start_time":"2023-03-11T02:43:57.919517","status":"completed"},"tags":[]}},{"cell_type":"code","source":"\n\n#visualization \nimport matplotlib.pyplot as plt\nimport seaborn as sns \n\n\n","metadata":{"execution":{"iopub.execute_input":"2023-03-11T02:43:57.992971Z","iopub.status.busy":"2023-03-11T02:43:57.992641Z","iopub.status.idle":"2023-03-11T02:43:57.997169Z","shell.execute_reply":"2023-03-11T02:43:57.995684Z"},"papermill":{"duration":0.032849,"end_time":"2023-03-11T02:43:57.999871","exception":false,"start_time":"2023-03-11T02:43:57.967022","status":"completed"},"tags":[]},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"test.columns","metadata":{"execution":{"iopub.execute_input":"2023-03-11T02:43:58.048755Z","iopub.status.busy":"2023-03-11T02:43:58.048438Z","iopub.status.idle":"2023-03-11T02:43:58.054859Z","shell.execute_reply":"2023-03-11T02:43:58.053819Z"},"papermill":{"duration":0.033026,"end_time":"2023-03-11T02:43:58.056809","exception":false,"start_time":"2023-03-11T02:43:58.023783","status":"completed"},"tags":[]},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"test['index'].unique","metadata":{"execution":{"iopub.execute_input":"2023-03-11T02:43:58.106570Z","iopub.status.busy":"2023-03-11T02:43:58.105352Z","iopub.status.idle":"2023-03-11T02:43:58.113770Z","shell.execute_reply":"2023-03-11T02:43:58.112399Z"},"papermill":{"duration":0.035386,"end_time":"2023-03-11T02:43:58.115619","exception":false,"start_time":"2023-03-11T02:43:58.080233","status":"completed"},"tags":[]},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"- visualisation student","metadata":{"papermill":{"duration":0.023902,"end_time":"2023-03-11T02:43:58.163282","exception":false,"start_time":"2023-03-11T02:43:58.139380","status":"completed"},"tags":[]}},{"cell_type":"code","source":"import plotly.graph_objects as go\nfrom plotly.subplots import make_subplots","metadata":{"execution":{"iopub.execute_input":"2023-03-11T02:43:58.213275Z","iopub.status.busy":"2023-03-11T02:43:58.212660Z","iopub.status.idle":"2023-03-11T02:43:58.303558Z","shell.execute_reply":"2023-03-11T02:43:58.302192Z"},"papermill":{"duration":0.118349,"end_time":"2023-03-11T02:43:58.305913","exception":false,"start_time":"2023-03-11T02:43:58.187564","status":"completed"},"tags":[]},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"test.columns","metadata":{"execution":{"iopub.execute_input":"2023-03-11T02:43:58.357115Z","iopub.status.busy":"2023-03-11T02:43:58.356758Z","iopub.status.idle":"2023-03-11T02:43:58.363931Z","shell.execute_reply":"2023-03-11T02:43:58.362850Z"},"papermill":{"duration":0.034991,"end_time":"2023-03-11T02:43:58.365935","exception":false,"start_time":"2023-03-11T02:43:58.330944","status":"completed"},"tags":[]},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"train_label.columns","metadata":{"execution":{"iopub.execute_input":"2023-03-11T02:43:58.417870Z","iopub.status.busy":"2023-03-11T02:43:58.417507Z","iopub.status.idle":"2023-03-11T02:43:58.423419Z","shell.execute_reply":"2023-03-11T02:43:58.422704Z"},"papermill":{"duration":0.034315,"end_time":"2023-03-11T02:43:58.425290","exception":false,"start_time":"2023-03-11T02:43:58.390975","status":"completed"},"tags":[]},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"fig,ax =plt.subplots (figsize = (15,15))\nsns.heatmap(train.corr(),annot = True , cmap = 'YlGnBu', linewidths= 5 , ax=ax)","metadata":{"execution":{"iopub.execute_input":"2023-03-11T02:43:58.477882Z","iopub.status.busy":"2023-03-11T02:43:58.475504Z","iopub.status.idle":"2023-03-11T02:44:01.816269Z","shell.execute_reply":"2023-03-11T02:44:01.815377Z"},"papermill":{"duration":3.368512,"end_time":"2023-03-11T02:44:01.818484","exception":false,"start_time":"2023-03-11T02:43:58.449972","status":"completed"},"tags":[]},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"plt.figure(figsize=(5,5))\nplt.title('Correct_rate')\n(train_label['correct'].value_counts(normalize=True)*100).plot.pie(labels = [\"correct\", \"false\"], autopct='%1.1f%%')","metadata":{"execution":{"iopub.execute_input":"2023-03-11T02:44:01.872582Z","iopub.status.busy":"2023-03-11T02:44:01.872012Z","iopub.status.idle":"2023-03-11T02:44:01.977290Z","shell.execute_reply":"2023-03-11T02:44:01.976529Z"},"papermill":{"duration":0.135274,"end_time":"2023-03-11T02:44:01.979639","exception":false,"start_time":"2023-03-11T02:44:01.844365","status":"completed"},"tags":[]},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"mean correct question from all the student who play this game was 70 % ","metadata":{"papermill":{"duration":0.037132,"end_time":"2023-03-11T02:44:02.054169","exception":false,"start_time":"2023-03-11T02:44:02.017037","status":"completed"},"tags":[]}},{"cell_type":"code","source":"sns.barplot(x='page',y='index',data=X)","metadata":{"execution":{"iopub.execute_input":"2023-03-11T02:44:02.113894Z","iopub.status.busy":"2023-03-11T02:44:02.113397Z","iopub.status.idle":"2023-03-11T02:44:05.701800Z","shell.execute_reply":"2023-03-11T02:44:05.700994Z"},"papermill":{"duration":3.621027,"end_time":"2023-03-11T02:44:05.703721","exception":false,"start_time":"2023-03-11T02:44:02.082694","status":"completed"},"tags":[]},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"sns.barplot (x='name',y='index',data=X)","metadata":{"execution":{"iopub.execute_input":"2023-03-11T02:44:05.759930Z","iopub.status.busy":"2023-03-11T02:44:05.759421Z","iopub.status.idle":"2023-03-11T02:47:55.697832Z","shell.execute_reply":"2023-03-11T02:47:55.697026Z"},"papermill":{"duration":229.968896,"end_time":"2023-03-11T02:47:55.699828","exception":false,"start_time":"2023-03-11T02:44:05.730932","status":"completed"},"tags":[]},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"sns.barplot(x='name',y='index',data=test)","metadata":{"execution":{"iopub.execute_input":"2023-03-11T02:47:55.759335Z","iopub.status.busy":"2023-03-11T02:47:55.758963Z","iopub.status.idle":"2023-03-11T02:47:56.024671Z","shell.execute_reply":"2023-03-11T02:47:56.023878Z"},"papermill":{"duration":0.296986,"end_time":"2023-03-11T02:47:56.026680","exception":false,"start_time":"2023-03-11T02:47:55.729694","status":"completed"},"tags":[]},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"from diagram we can see sample data from students doesnt care about their naem at the game ","metadata":{"papermill":{"duration":0.027448,"end_time":"2023-03-11T02:47:56.084701","exception":false,"start_time":"2023-03-11T02:47:56.057253","status":"completed"},"tags":[]}},{"cell_type":"code","source":"sns.barplot(x='index',y='event_name',data=test)","metadata":{"execution":{"iopub.execute_input":"2023-03-11T02:47:56.143558Z","iopub.status.busy":"2023-03-11T02:47:56.142991Z","iopub.status.idle":"2023-03-11T02:47:56.588336Z","shell.execute_reply":"2023-03-11T02:47:56.587541Z"},"papermill":{"duration":0.47764,"end_time":"2023-03-11T02:47:56.590651","exception":false,"start_time":"2023-03-11T02:47:56.113011","status":"completed"},"tags":[]},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"from prespective data many students back to checkpoint also students atrractive with map we can see the map click and map hover rate above 500 + ","metadata":{"papermill":{"duration":0.028279,"end_time":"2023-03-11T02:47:56.648149","exception":false,"start_time":"2023-03-11T02:47:56.619870","status":"completed"},"tags":[]}},{"cell_type":"code","source":"sns.barplot(x='level',y='elapsed_time',data=test)\n","metadata":{"execution":{"iopub.execute_input":"2023-03-11T02:47:56.706415Z","iopub.status.busy":"2023-03-11T02:47:56.706031Z","iopub.status.idle":"2023-03-11T02:47:57.438629Z","shell.execute_reply":"2023-03-11T02:47:57.437286Z"},"papermill":{"duration":0.764007,"end_time":"2023-03-11T02:47:57.440561","exception":false,"start_time":"2023-03-11T02:47:56.676554","status":"completed"},"tags":[]},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"- from the diagram we can see that the audience or player can complete lv 1 with shorten time and take more time to complete lv 19 ","metadata":{"papermill":{"duration":0.027787,"end_time":"2023-03-11T02:47:57.496753","exception":false,"start_time":"2023-03-11T02:47:57.468966","status":"completed"},"tags":[]}},{"cell_type":"code","source":"score= train_label['correct'].sort_values( ascending=True)","metadata":{"execution":{"iopub.execute_input":"2023-03-11T02:47:57.555940Z","iopub.status.busy":"2023-03-11T02:47:57.555595Z","iopub.status.idle":"2023-03-11T02:47:57.565194Z","shell.execute_reply":"2023-03-11T02:47:57.564280Z"},"papermill":{"duration":0.041109,"end_time":"2023-03-11T02:47:57.567111","exception":false,"start_time":"2023-03-11T02:47:57.526002","status":"completed"},"tags":[]},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"fig = make_subplots(rows=1, cols=1)\nfig.append_trace(go.Bar(\n    x=test[\"level\"],\n    y=test[\"index\"],\n    name=\"trial and error\",\n), row=1, col=1)\nfig.update_layout(height=600, width=900, title_text=\"Trial and error at every level\")\nfig.update_layout(\npaper_bgcolor = \" #f2f2f2\",\nplot_bgcolor = \" yellowgreen\",\nfont=dict(family='sans-serif',\n                  color='black',\n                  size=10),)\nfig.show()","metadata":{"execution":{"iopub.execute_input":"2023-03-11T02:47:57.625716Z","iopub.status.busy":"2023-03-11T02:47:57.625359Z","iopub.status.idle":"2023-03-11T02:47:57.982849Z","shell.execute_reply":"2023-03-11T02:47:57.981769Z"},"papermill":{"duration":0.389855,"end_time":"2023-03-11T02:47:57.985354","exception":false,"start_time":"2023-03-11T02:47:57.595499","status":"completed"},"tags":[]},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"- from diagram we can see that the easyiest level that they can conquer at level 4 many player doesnt need trial and eror at this level but in other hand the hardest level was at lv 18 because many player try another chance for complete this level ","metadata":{"papermill":{"duration":0.028731,"end_time":"2023-03-11T02:47:58.042981","exception":false,"start_time":"2023-03-11T02:47:58.014250","status":"completed"},"tags":[]}},{"cell_type":"code","source":"train_label","metadata":{"execution":{"iopub.execute_input":"2023-03-11T02:47:58.102675Z","iopub.status.busy":"2023-03-11T02:47:58.102268Z","iopub.status.idle":"2023-03-11T02:47:58.114544Z","shell.execute_reply":"2023-03-11T02:47:58.113550Z"},"papermill":{"duration":0.044051,"end_time":"2023-03-11T02:47:58.116219","exception":false,"start_time":"2023-03-11T02:47:58.072168","status":"completed"},"tags":[]},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"train_label['question'] = train_label['session_id'].apply(lambda x: int(x.split('_')[1][1:]))\n","metadata":{"execution":{"iopub.execute_input":"2023-03-11T02:47:58.176631Z","iopub.status.busy":"2023-03-11T02:47:58.176273Z","iopub.status.idle":"2023-03-11T02:47:58.334970Z","shell.execute_reply":"2023-03-11T02:47:58.333951Z"},"papermill":{"duration":0.19222,"end_time":"2023-03-11T02:47:58.337457","exception":false,"start_time":"2023-03-11T02:47:58.145237","status":"completed"},"tags":[]},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"train_label","metadata":{"execution":{"iopub.execute_input":"2023-03-11T02:47:58.400667Z","iopub.status.busy":"2023-03-11T02:47:58.399856Z","iopub.status.idle":"2023-03-11T02:47:58.412994Z","shell.execute_reply":"2023-03-11T02:47:58.412027Z"},"papermill":{"duration":0.047532,"end_time":"2023-03-11T02:47:58.415184","exception":false,"start_time":"2023-03-11T02:47:58.367652","status":"completed"},"tags":[]},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"mean_correct = train_label['correct'].sum()/212022","metadata":{"execution":{"iopub.execute_input":"2023-03-11T02:47:58.475989Z","iopub.status.busy":"2023-03-11T02:47:58.475641Z","iopub.status.idle":"2023-03-11T02:47:58.480461Z","shell.execute_reply":"2023-03-11T02:47:58.479378Z"},"papermill":{"duration":0.038059,"end_time":"2023-03-11T02:47:58.482170","exception":false,"start_time":"2023-03-11T02:47:58.444111","status":"completed"},"tags":[]},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"mean_correct","metadata":{"execution":{"iopub.execute_input":"2023-03-11T02:47:58.542183Z","iopub.status.busy":"2023-03-11T02:47:58.541822Z","iopub.status.idle":"2023-03-11T02:47:58.548201Z","shell.execute_reply":"2023-03-11T02:47:58.546851Z"},"papermill":{"duration":0.039284,"end_time":"2023-03-11T02:47:58.550250","exception":false,"start_time":"2023-03-11T02:47:58.510966","status":"completed"},"tags":[]},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"- the avarage of student that answer the question was 70 % ","metadata":{"papermill":{"duration":0.028743,"end_time":"2023-03-11T02:47:58.607862","exception":false,"start_time":"2023-03-11T02:47:58.579119","status":"completed"},"tags":[]}},{"cell_type":"code","source":"sns.barplot(x='question',y='correct', data=train_label)","metadata":{"execution":{"iopub.execute_input":"2023-03-11T02:47:58.667924Z","iopub.status.busy":"2023-03-11T02:47:58.667349Z","iopub.status.idle":"2023-03-11T02:48:01.268432Z","shell.execute_reply":"2023-03-11T02:48:01.267363Z"},"papermill":{"duration":2.633415,"end_time":"2023-03-11T02:48:01.270295","exception":false,"start_time":"2023-03-11T02:47:58.636880","status":"completed"},"tags":[]},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"- from this diagram we can see that the question 13 was dificult for student because only 20 % STUDENT was correct at this question maybe if question number 13 must be include at the game for the tips we can replace to question 18 for the anticlimacs ","metadata":{"papermill":{"duration":0.029009,"end_time":"2023-03-11T02:48:01.328367","exception":false,"start_time":"2023-03-11T02:48:01.299358","status":"completed"},"tags":[]}},{"cell_type":"code","source":"train['text']","metadata":{"execution":{"iopub.execute_input":"2023-03-11T02:48:01.388760Z","iopub.status.busy":"2023-03-11T02:48:01.388432Z","iopub.status.idle":"2023-03-11T02:48:01.396483Z","shell.execute_reply":"2023-03-11T02:48:01.395465Z"},"papermill":{"duration":0.040483,"end_time":"2023-03-11T02:48:01.398185","exception":false,"start_time":"2023-03-11T02:48:01.357702","status":"completed"},"tags":[]},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"from sklearn.feature_extraction.text import CountVectorizer","metadata":{"execution":{"iopub.execute_input":"2023-03-11T02:48:01.458750Z","iopub.status.busy":"2023-03-11T02:48:01.458413Z","iopub.status.idle":"2023-03-11T02:48:01.626438Z","shell.execute_reply":"2023-03-11T02:48:01.624889Z"},"papermill":{"duration":0.201411,"end_time":"2023-03-11T02:48:01.628864","exception":false,"start_time":"2023-03-11T02:48:01.427453","status":"completed"},"tags":[]},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"word_sample = ['fun learn fun ' , 'car do all day' , 'hate feel ']\nvect = CountVectorizer()\nvect.fit(word_sample)","metadata":{"execution":{"iopub.execute_input":"2023-03-11T02:48:01.691301Z","iopub.status.busy":"2023-03-11T02:48:01.690242Z","iopub.status.idle":"2023-03-11T02:48:01.704712Z","shell.execute_reply":"2023-03-11T02:48:01.703412Z"},"papermill":{"duration":0.047764,"end_time":"2023-03-11T02:48:01.706747","exception":false,"start_time":"2023-03-11T02:48:01.658983","status":"completed"},"tags":[]},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"from sklearn.feature_extraction.text import TfidfVectorizer","metadata":{"execution":{"iopub.execute_input":"2023-03-11T02:48:01.767652Z","iopub.status.busy":"2023-03-11T02:48:01.767304Z","iopub.status.idle":"2023-03-11T02:48:01.772444Z","shell.execute_reply":"2023-03-11T02:48:01.770896Z"},"papermill":{"duration":0.038388,"end_time":"2023-03-11T02:48:01.774758","exception":false,"start_time":"2023-03-11T02:48:01.736370","status":"completed"},"tags":[]},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"def kamus(check):\n    check = check.str.extractall('([a-zA_Z]+)')\n    check.columns = ['check']\n    b = check.reset_index(drop=True)\n    check = b['check'].value_counts()\n\n    kamus = {'word':check.index,'freq':check.values}\n    kamus = pd.DataFrame(kamus)\n    kamus.index = kamus['word']\n    kamus.drop('word', axis = 1, inplace = True)\n    kamus.sort_values('freq',ascending=False,inplace=True)\n    \n    return kamus","metadata":{"execution":{"iopub.execute_input":"2023-03-11T02:48:01.836015Z","iopub.status.busy":"2023-03-11T02:48:01.835643Z","iopub.status.idle":"2023-03-11T02:48:01.842469Z","shell.execute_reply":"2023-03-11T02:48:01.841489Z"},"papermill":{"duration":0.039625,"end_time":"2023-03-11T02:48:01.844361","exception":false,"start_time":"2023-03-11T02:48:01.804736","status":"completed"},"tags":[]},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"train['text']","metadata":{"execution":{"iopub.execute_input":"2023-03-11T02:48:01.905167Z","iopub.status.busy":"2023-03-11T02:48:01.904842Z","iopub.status.idle":"2023-03-11T02:48:01.912604Z","shell.execute_reply":"2023-03-11T02:48:01.911852Z"},"papermill":{"duration":0.040303,"end_time":"2023-03-11T02:48:01.914298","exception":false,"start_time":"2023-03-11T02:48:01.873995","status":"completed"},"tags":[]},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df_kamus = kamus(test['text'])","metadata":{"execution":{"iopub.execute_input":"2023-03-11T02:48:01.975486Z","iopub.status.busy":"2023-03-11T02:48:01.975138Z","iopub.status.idle":"2023-03-11T02:48:02.001679Z","shell.execute_reply":"2023-03-11T02:48:02.000327Z"},"papermill":{"duration":0.060131,"end_time":"2023-03-11T02:48:02.004080","exception":false,"start_time":"2023-03-11T02:48:01.943949","status":"completed"},"tags":[]},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df_kamus[:20].plot(kind='barh')","metadata":{"execution":{"iopub.execute_input":"2023-03-11T02:48:02.065855Z","iopub.status.busy":"2023-03-11T02:48:02.065534Z","iopub.status.idle":"2023-03-11T02:48:02.311746Z","shell.execute_reply":"2023-03-11T02:48:02.310651Z"},"papermill":{"duration":0.279629,"end_time":"2023-03-11T02:48:02.313764","exception":false,"start_time":"2023-03-11T02:48:02.034135","status":"completed"},"tags":[]},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"# there was frequens from students chat by text at sample ","metadata":{"papermill":{"duration":0.030464,"end_time":"2023-03-11T02:48:02.374931","exception":false,"start_time":"2023-03-11T02:48:02.344467","status":"completed"},"tags":[]}},{"cell_type":"code","source":"\n\ndef plot_cloud(wordcloud):\n    # Set figure size\n    plt.figure(figsize=(20, 10))\n    # Display image\n    plt.imshow(wordcloud) \n    # No axis details\n    plt.axis(\"off\")","metadata":{"execution":{"iopub.execute_input":"2023-03-11T02:48:02.437586Z","iopub.status.busy":"2023-03-11T02:48:02.437175Z","iopub.status.idle":"2023-03-11T02:48:02.442729Z","shell.execute_reply":"2023-03-11T02:48:02.441541Z"},"papermill":{"duration":0.039619,"end_time":"2023-03-11T02:48:02.444793","exception":false,"start_time":"2023-03-11T02:48:02.405174","status":"completed"},"tags":[]},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"from wordcloud import WordCloud","metadata":{"execution":{"iopub.execute_input":"2023-03-11T02:48:02.507432Z","iopub.status.busy":"2023-03-11T02:48:02.507069Z","iopub.status.idle":"2023-03-11T02:48:02.532819Z","shell.execute_reply":"2023-03-11T02:48:02.531523Z"},"papermill":{"duration":0.059591,"end_time":"2023-03-11T02:48:02.535047","exception":false,"start_time":"2023-03-11T02:48:02.475456","status":"completed"},"tags":[]},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"word_cloud = WordCloud().generate(str(test['text']))\nplot_cloud(word_cloud)","metadata":{"execution":{"iopub.execute_input":"2023-03-11T02:48:02.597432Z","iopub.status.busy":"2023-03-11T02:48:02.597079Z","iopub.status.idle":"2023-03-11T02:48:02.833857Z","shell.execute_reply":"2023-03-11T02:48:02.832474Z"},"papermill":{"duration":0.270697,"end_time":"2023-03-11T02:48:02.836184","exception":false,"start_time":"2023-03-11T02:48:02.565487","status":"completed"},"tags":[]},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"-from the immage the bigger text was the most frequens at sample test students text at the game","metadata":{"papermill":{"duration":0.030565,"end_time":"2023-03-11T02:48:02.897737","exception":false,"start_time":"2023-03-11T02:48:02.867172","status":"completed"},"tags":[]}}]}