{"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\n\nKindly upvote the notebook if you like","metadata":{"_uuid":"8f2839f25d086af736a60e9eeb907d3b93b6e0e5","_cell_guid":"b1076dfc-b9ad-4769-8c92-a6c4dae69d19"}},{"cell_type":"code","source":"import plotly.express as px\nimport matplotlib.pyplot as plt\nimport seaborn as sns\nimport missingno as msno\nimport pandas as pd\nimport numpy as np\nimport matplotlib\nfrom plotly.subplots import make_subplots\nimport plotly.graph_objects as go\n%matplotlib inline\n\nimport warnings\nwarnings.filterwarnings(\"ignore\")","metadata":{"execution":{"iopub.status.busy":"2023-03-05T19:42:17.636221Z","iopub.execute_input":"2023-03-05T19:42:17.637003Z","iopub.status.idle":"2023-03-05T19:42:20.249072Z","shell.execute_reply.started":"2023-03-05T19:42:17.636955Z","shell.execute_reply":"2023-03-05T19:42:20.247926Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"### Reading Dataset and Loading it ","metadata":{}},{"cell_type":"code","source":"train = pd.read_csv(\"/kaggle/input/predict-student-performance-from-game-play/train.csv\")\ntrain_labels = pd.read_csv(\"/kaggle/input/predict-student-performance-from-game-play/train_labels.csv\")\ntest=pd.read_csv(\"/kaggle/input/predict-student-performance-from-game-play/test.csv\")\n","metadata":{"execution":{"iopub.status.busy":"2023-03-05T19:42:28.485832Z","iopub.execute_input":"2023-03-05T19:42:28.486266Z","iopub.status.idle":"2023-03-05T19:43:13.083931Z","shell.execute_reply.started":"2023-03-05T19:42:28.486228Z","shell.execute_reply":"2023-03-05T19:43:13.082712Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"### Basic Understanding of the dataset and presence of null values","metadata":{}},{"cell_type":"code","source":"train.info()","metadata":{"execution":{"iopub.status.busy":"2023-03-05T19:43:13.085977Z","iopub.execute_input":"2023-03-05T19:43:13.086822Z","iopub.status.idle":"2023-03-05T19:43:13.100188Z","shell.execute_reply.started":"2023-03-05T19:43:13.086783Z","shell.execute_reply":"2023-03-05T19:43:13.099025Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"train.head()","metadata":{"execution":{"iopub.status.busy":"2023-03-05T19:43:13.101862Z","iopub.execute_input":"2023-03-05T19:43:13.102202Z","iopub.status.idle":"2023-03-05T19:43:13.136231Z","shell.execute_reply.started":"2023-03-05T19:43:13.102170Z","shell.execute_reply":"2023-03-05T19:43:13.135056Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"train_labels.head()","metadata":{"execution":{"iopub.status.busy":"2023-03-05T19:43:13.138537Z","iopub.execute_input":"2023-03-05T19:43:13.138919Z","iopub.status.idle":"2023-03-05T19:43:13.147950Z","shell.execute_reply.started":"2023-03-05T19:43:13.138884Z","shell.execute_reply":"2023-03-05T19:43:13.146993Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"train.isnull().sum()","metadata":{"execution":{"iopub.status.busy":"2023-03-05T19:43:13.149324Z","iopub.execute_input":"2023-03-05T19:43:13.149984Z","iopub.status.idle":"2023-03-05T19:43:17.578139Z","shell.execute_reply.started":"2023-03-05T19:43:13.149948Z","shell.execute_reply":"2023-03-05T19:43:17.577015Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"## Visualization\n### Using plotly library for understanding the distribution of different data parameters:","metadata":{}},{"cell_type":"code","source":"event_count = train['fqid'].value_counts().reset_index()\nevent_count.loc[event_count['fqid'] < 1.e1, 'index'] = 'Others' \nevent_count=event_count.head(10)\nfig=px.pie(event_count,values='fqid',names='index',template=\"plotly_dark\",\n           title=\"Analysis and Comparison of different fqid across index\")\nfig.show()","metadata":{"execution":{"iopub.status.busy":"2023-03-05T19:49:24.436825Z","iopub.execute_input":"2023-03-05T19:49:24.437766Z","iopub.status.idle":"2023-03-05T19:49:25.232884Z","shell.execute_reply.started":"2023-03-05T19:49:24.437720Z","shell.execute_reply":"2023-03-05T19:49:25.231806Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"event_count = train['level_group'].value_counts().reset_index()\nevent_count.columns = ['level_group', 'count']\n\nfig = px.bar(event_count, x='level_group', y='count', color='count', title=\"Count the number of occurrences of each level group\",\n            hover_data=event_count,template=\"plotly_dark\")\nfig.show()\n","metadata":{"execution":{"iopub.status.busy":"2023-03-05T19:37:36.664972Z","iopub.execute_input":"2023-03-05T19:37:36.666132Z","iopub.status.idle":"2023-03-05T19:37:37.577275Z","shell.execute_reply.started":"2023-03-05T19:37:36.666085Z","shell.execute_reply":"2023-03-05T19:37:37.576309Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"page_count = train['event_name'].value_counts().reset_index()\npage_count.columns = ['event_name', 'count']\n\nfig = px.bar(page_count, x='event_name', y='count', color='count', title=\"Count the number of occurrences of each Event\",\n            template=\"plotly_dark\")\nfig.show()","metadata":{"execution":{"iopub.status.busy":"2023-03-05T19:19:58.520461Z","iopub.execute_input":"2023-03-05T19:19:58.521551Z","iopub.status.idle":"2023-03-05T19:19:59.436920Z","shell.execute_reply.started":"2023-03-05T19:19:58.521502Z","shell.execute_reply":"2023-03-05T19:19:59.435838Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"events_in_session = pd.DataFrame(train.groupby('room_fqid').size())\nevents_in_session.columns = [\"room_fqid\"]\n\nfig = px.histogram(events_in_session, x=\"room_fqid\", title=\"Types of room_fqid in dataset\",\n                  template=\"plotly_dark\")\nfig.update_layout(bargap=0.2)\nfig.show()","metadata":{"execution":{"iopub.status.busy":"2023-03-05T19:25:38.100277Z","iopub.execute_input":"2023-03-05T19:25:38.100690Z","iopub.status.idle":"2023-03-05T19:25:39.507502Z","shell.execute_reply.started":"2023-03-05T19:25:38.100654Z","shell.execute_reply":"2023-03-05T19:25:39.506450Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"events_in_session = pd.DataFrame(train.groupby('session_id').size())\nevents_in_session.columns = [\"n_of_events\"]\nfig = px.histogram(events_in_session, x=\"n_of_events\", title=\"Types of events in dataset\",\n                  template=\"plotly_dark\")\nfig.show()","metadata":{"execution":{"iopub.status.busy":"2023-03-05T19:26:15.119202Z","iopub.execute_input":"2023-03-05T19:26:15.119675Z","iopub.status.idle":"2023-03-05T19:26:15.471309Z","shell.execute_reply.started":"2023-03-05T19:26:15.119635Z","shell.execute_reply":"2023-03-05T19:26:15.470265Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"fig = px.bar(train[\"event_name\"].value_counts(), text_auto=True, title=\"Types of events in dataset\"\n            ,template=\"plotly_dark\")\nfig.show()","metadata":{"execution":{"iopub.status.busy":"2023-03-05T19:27:20.119283Z","iopub.execute_input":"2023-03-05T19:27:20.119707Z","iopub.status.idle":"2023-03-05T19:27:21.027345Z","shell.execute_reply.started":"2023-03-05T19:27:20.119668Z","shell.execute_reply":"2023-03-05T19:27:21.026294Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"## Machine Learning Models\n\n### On going","metadata":{}}]}