{"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)\n\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":"2022-03-04T10:58:12.434473Z","iopub.execute_input":"2022-03-04T10:58:12.434812Z","iopub.status.idle":"2022-03-04T10:58:12.457454Z","shell.execute_reply.started":"2022-03-04T10:58:12.434778Z","shell.execute_reply":"2022-03-04T10:58:12.456776Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"****This notebook contains EDA of train data.Here,I done some analysis on each features to understand the distribution of data.I had created some features like percentage,minutes in order to get understand the performace of each user and also difficulty level of content.Up to my knowledge I tried to explore more ways to analyse the feature to get clear picture of dataset**\n \n**As the datset is too large,so I had reduced the datset by changing the datatype of feature based on its range and created a dataset which i used here.******","metadata":{}},{"cell_type":"code","source":"import warnings \nwarnings.filterwarnings('ignore')","metadata":{"execution":{"iopub.status.busy":"2022-03-04T12:38:28.188968Z","iopub.execute_input":"2022-03-04T12:38:28.189353Z","iopub.status.idle":"2022-03-04T12:38:28.216484Z","shell.execute_reply.started":"2022-03-04T12:38:28.189266Z","shell.execute_reply":"2022-03-04T12:38:28.215860Z"},"trusted":true},"execution_count":null,"outputs":[]},{"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 seaborn as sns\nimport matplotlib.pyplot as plt","metadata":{"execution":{"iopub.status.busy":"2022-03-04T10:59:20.370207Z","iopub.execute_input":"2022-03-04T10:59:20.371134Z","iopub.status.idle":"2022-03-04T10:59:21.445398Z","shell.execute_reply.started":"2022-03-04T10:59:20.371074Z","shell.execute_reply":"2022-03-04T10:59:21.444402Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"","metadata":{},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"data=pd.read_pickle('../input/riiid-reduced-dataset/reduced.pkl.gzip')\ndata.head()","metadata":{"execution":{"iopub.status.busy":"2022-03-04T10:59:43.019376Z","iopub.execute_input":"2022-03-04T10:59:43.019679Z","iopub.status.idle":"2022-03-04T11:00:09.343206Z","shell.execute_reply.started":"2022-03-04T10:59:43.019646Z","shell.execute_reply":"2022-03-04T11:00:09.342602Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"data.shape","metadata":{"execution":{"iopub.status.busy":"2022-03-04T11:01:11.327531Z","iopub.execute_input":"2022-03-04T11:01:11.329128Z","iopub.status.idle":"2022-03-04T11:01:11.337642Z","shell.execute_reply.started":"2022-03-04T11:01:11.329075Z","shell.execute_reply":"2022-03-04T11:01:11.336791Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":" **Some basic eda on features**","metadata":{}},{"cell_type":"code","source":"sns.countplot(x='content_type_id',hue='answered_correctly',data=data)","metadata":{"execution":{"iopub.status.busy":"2022-03-04T05:10:32.587366Z","iopub.execute_input":"2022-03-04T05:10:32.588306Z","iopub.status.idle":"2022-03-04T05:10:58.256224Z","shell.execute_reply.started":"2022-03-04T05:10:32.588260Z","shell.execute_reply":"2022-03-04T05:10:58.255011Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"sns.countplot(x='answered_correctly',data=data)","metadata":{"execution":{"iopub.status.busy":"2022-03-04T05:11:52.149429Z","iopub.execute_input":"2022-03-04T05:11:52.149836Z","iopub.status.idle":"2022-03-04T05:12:02.018439Z","shell.execute_reply.started":"2022-03-04T05:11:52.149788Z","shell.execute_reply":"2022-03-04T05:12:02.017403Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"sns.countplot(x='user_answer',data=data)","metadata":{"execution":{"iopub.status.busy":"2022-03-04T05:13:17.616510Z","iopub.execute_input":"2022-03-04T05:13:17.616949Z","iopub.status.idle":"2022-03-04T05:13:27.128694Z","shell.execute_reply.started":"2022-03-04T05:13:17.616913Z","shell.execute_reply":"2022-03-04T05:13:27.127653Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"sns.countplot(x='user_answer',hue='answered_correctly',data=data)","metadata":{"execution":{"iopub.status.busy":"2022-03-04T05:13:27.130360Z","iopub.execute_input":"2022-03-04T05:13:27.130644Z","iopub.status.idle":"2022-03-04T05:13:47.382675Z","shell.execute_reply.started":"2022-03-04T05:13:27.130608Z","shell.execute_reply":"2022-03-04T05:13:47.381512Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"**Observation:**\n\n1.In given data,there are more content related to questions than lecture\n\n2.And there are more users who answered correctly for attempted questions\n\n","metadata":{}},{"cell_type":"code","source":"#separating the data of users who attempted only questions\nnew=data[data['content_type_id']==0]\nnew.shape","metadata":{"execution":{"iopub.status.busy":"2022-03-04T11:02:41.687574Z","iopub.execute_input":"2022-03-04T11:02:41.688260Z","iopub.status.idle":"2022-03-04T11:02:47.583815Z","shell.execute_reply.started":"2022-03-04T11:02:41.688222Z","shell.execute_reply":"2022-03-04T11:02:47.583181Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"#grouuping the user_od and checking how many of them given correct answer (by using sum)\n#and also counting no of questions they attempted (by using count)\n\ng=new[['user_id','answered_correctly','prior_question_elapsed_time']].groupby('user_id').sum().reset_index()\ng_=new[['user_id','answered_correctly']].groupby('user_id').count().reset_index()\n\n#g.sort_values('answered_correctly',inplace=True,ascending=False)\ng.head()","metadata":{"execution":{"iopub.status.busy":"2022-03-04T11:03:31.191340Z","iopub.execute_input":"2022-03-04T11:03:31.191872Z","iopub.status.idle":"2022-03-04T11:03:40.693414Z","shell.execute_reply.started":"2022-03-04T11:03:31.191838Z","shell.execute_reply":"2022-03-04T11:03:40.692788Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"#now adding count column to main datagrame i.e g \n#and also finding the succes ratio of each user i.e no of crct answers/total no of question attempted\n\ng['total']=g_['answered_correctly']\ng['per']=np.round((g['answered_correctly']/g['total'])*100)\nsort=g.sort_values('per',ascending=False)\nsort.head()","metadata":{"execution":{"iopub.status.busy":"2022-03-04T11:05:47.967656Z","iopub.execute_input":"2022-03-04T11:05:47.968606Z","iopub.status.idle":"2022-03-04T11:05:48.085751Z","shell.execute_reply.started":"2022-03-04T11:05:47.968556Z","shell.execute_reply":"2022-03-04T11:05:48.084925Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"Above dataframe tells the user's no of correct answers to his total attempted question and also the percentage of his performance","metadata":{}},{"cell_type":"code","source":"def percentage_answer(type):\n    \n    plt.figure(figsize=(15,5))\n    plt.xlabel('each users performance on their examination in terms of percentage')\n    plt.ylabel('no of students')\n    if type=='desc':\n        per=g['per'].value_counts().sort_index(ascending=False)\n        sns.barplot(x=per.index[:25],y=per.values[:25].astype('int'),order=per.index[:25].astype('int'))\n        plt.title('top percentage of students who perfomed very well in exam')\n\n        \n    elif type=='asc':\n        per=g['per'].value_counts().sort_index(ascending=True)\n        sns.barplot(x=per.index[:25],y=per.values[:25].astype('int'),order=per.index[:25].astype('int'))  \n        plt.title('least percentage of students who performed bad in exam')\n    elif type=='top':\n        per=g['per'].value_counts()\n        sns.barplot(x=per.index[:25],y=per.values[:25].astype('int'),order=per.index[:25].astype('int'))\n        plt.title('highest percentage of students who answered correctly')\n","metadata":{"execution":{"iopub.status.busy":"2022-03-04T05:35:05.163757Z","iopub.execute_input":"2022-03-04T05:35:05.164151Z","iopub.status.idle":"2022-03-04T05:35:05.174002Z","shell.execute_reply.started":"2022-03-04T05:35:05.164113Z","shell.execute_reply":"2022-03-04T05:35:05.173256Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"percentage_answer('asc')\nprint()\npercentage_answer('desc')\npercentage_answer('top')","metadata":{"execution":{"iopub.status.busy":"2022-03-04T05:36:02.520359Z","iopub.execute_input":"2022-03-04T05:36:02.520718Z","iopub.status.idle":"2022-03-04T05:36:03.737953Z","shell.execute_reply.started":"2022-03-04T05:36:02.520681Z","shell.execute_reply":"2022-03-04T05:36:03.736915Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"#above plot is about the distribution of students/users falling on each percentage i.e performance\n\nThere are no higher number of users who got 100 percentage in exams ,so only few users falled below 90 percentage in exam\n\nComing to poor performance,only few users got very less percentage\n\nAnd in whole examination,lot of users got only 50 percent sucess rate and almost lot of users fallen in between 40 to 60 percentage\n","metadata":{}},{"cell_type":"code","source":"#checking the no of users falling in percentage\n\n\n\nplt.figure(figsize=(20,8))\nplt.ticklabel_format(style='plain', axis='y')\nsns.countplot(x='per',data=g,order=g['per'].value_counts().sort_index().index)\nplt.title('distribution of performace of users in terms of percentage')\nplt.xticks(rotation=90)\nplt.show()","metadata":{"execution":{"iopub.status.busy":"2022-03-04T05:52:11.509224Z","iopub.execute_input":"2022-03-04T05:52:11.509643Z","iopub.status.idle":"2022-03-04T05:52:12.929221Z","shell.execute_reply.started":"2022-03-04T05:52:11.509604Z","shell.execute_reply":"2022-03-04T05:52:12.928465Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"plt.figure(figsize=(10,5))\nplt.ticklabel_format(style='plain', axis='y')\nplt.ticklabel_format(style='plain', axis='y')\nsns.distplot(g['per'].values,color='black',hist=False)\nplt.xticks(rotation=90)\nplt.show()","metadata":{"execution":{"iopub.status.busy":"2022-03-04T07:38:37.290281Z","iopub.execute_input":"2022-03-04T07:38:37.290724Z","iopub.status.idle":"2022-03-04T07:38:39.149365Z","shell.execute_reply.started":"2022-03-04T07:38:37.290657Z","shell.execute_reply":"2022-03-04T07:38:39.145652Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"Interestingly,the performace of all users has gaussian distribution i.e lot of users fallen in atmost 40 to 80 percentage\nand very few users had performed worst and viceversa\n\n","metadata":{}},{"cell_type":"code","source":"plt.figure(figsize=(35,8))\nper=g['per'].value_counts()\nsns.barplot(x=per.index.astype('int'),y=per.values,order=per.index.astype('int'))\nplt.title('success percentage of students ')\nplt.xlabel('success percentage i.e correctly answer to total questions attempted')\nplt.ylabel('no of students')","metadata":{"execution":{"iopub.status.busy":"2022-03-04T05:35:24.200728Z","iopub.execute_input":"2022-03-04T05:35:24.201303Z","iopub.status.idle":"2022-03-04T05:35:25.652125Z","shell.execute_reply.started":"2022-03-04T05:35:24.201250Z","shell.execute_reply":"2022-03-04T05:35:25.650951Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"From this plot,it clear that lot of users got 50 percentage in the exams and very least users got 99 percenatge","metadata":{}},{"cell_type":"markdown","source":"**Top 20 students who answered correctly**","metadata":{}},{"cell_type":"code","source":"\ntp_20=g.sort_values('answered_correctly',ascending=False)[:25]\n\nplt.figure(figsize=(15,5))\nsns.barplot(x='user_id',y='answered_correctly',data=tp_20,order=tp_20['user_id'])\nplt.title('students who given more no of correct answers')\nplt.xlabel('students')\nplt.ylabel('no of correct answers')\nplt.xticks(rotation=90)\nplt.show()","metadata":{"execution":{"iopub.status.busy":"2022-03-04T05:59:39.745723Z","iopub.execute_input":"2022-03-04T05:59:39.746804Z","iopub.status.idle":"2022-03-04T05:59:40.217708Z","shell.execute_reply.started":"2022-03-04T05:59:39.746743Z","shell.execute_reply":"2022-03-04T05:59:40.216702Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"**Top 20 cotent mostly seen by students**","metadata":{}},{"cell_type":"code","source":"contnt=data['content_id'].value_counts()[:25]\nprint('total no of unique content:',len(contnt))\n\nplt.figure(figsize=(15,5))\nsns.barplot(x=contnt.index,y=contnt.values,order=contnt.index)\nplt.title('top 25 contents mostly watched by students ')\nplt.xlabel('content_id')\nplt.ylabel('no of students watched')\nplt.xticks(rotation=90)\nplt.show()","metadata":{"execution":{"iopub.status.busy":"2022-03-04T06:00:27.891555Z","iopub.execute_input":"2022-03-04T06:00:27.892334Z","iopub.status.idle":"2022-03-04T06:00:28.816549Z","shell.execute_reply.started":"2022-03-04T06:00:27.892272Z","shell.execute_reply":"2022-03-04T06:00:28.815607Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"**Analysis on time taken by users**","metadata":{}},{"cell_type":"code","source":"g.head()","metadata":{"execution":{"iopub.status.busy":"2022-03-04T06:01:13.463985Z","iopub.execute_input":"2022-03-04T06:01:13.464330Z","iopub.status.idle":"2022-03-04T06:01:13.483647Z","shell.execute_reply.started":"2022-03-04T06:01:13.464299Z","shell.execute_reply":"2022-03-04T06:01:13.482594Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"#adding mintue column to data,so that it tells the time taken by each user in minutes\ng['mintues']=np.round(g['prior_question_elapsed_time']/60000)\ng.head()","metadata":{"execution":{"iopub.status.busy":"2022-03-04T11:06:05.237422Z","iopub.execute_input":"2022-03-04T11:06:05.237768Z","iopub.status.idle":"2022-03-04T11:06:05.256111Z","shell.execute_reply.started":"2022-03-04T11:06:05.237731Z","shell.execute_reply":"2022-03-04T11:06:05.255121Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"plt.figure(figsize=(15,6))\nsns.distplot(g['mintues'].values,hist=False)\nplt.ticklabel_format(style='plain', axis='y')\nplt.ticklabel_format(style='plain', axis='x')\nplt.title('no of minutes spent by each users')\nplt.xlabel('time')\nplt.show()","metadata":{"execution":{"iopub.status.busy":"2022-03-04T06:03:08.838834Z","iopub.execute_input":"2022-03-04T06:03:08.839177Z","iopub.status.idle":"2022-03-04T06:03:10.468746Z","shell.execute_reply.started":"2022-03-04T06:03:08.839145Z","shell.execute_reply":"2022-03-04T06:03:10.467773Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"**Observation:**\n\nThe distribution of  time spent by all users seems to be right skewed i.e there are only few users who took more time than others\nso it is skewed and there are lot os users who took almost same time\n\nBut Above chart is not showing clear picture,so trying to take only less data to see the clear distribution of time","metadata":{}},{"cell_type":"code","source":"g['mintues'].mean(),g['mintues'].min(),g['mintues'].max(),np.percentile(g['mintues'].values,99),len(np.unique(g['mintues'].values))","metadata":{"execution":{"iopub.status.busy":"2022-03-04T06:05:40.541727Z","iopub.execute_input":"2022-03-04T06:05:40.542120Z","iopub.status.idle":"2022-03-04T06:05:40.582497Z","shell.execute_reply.started":"2022-03-04T06:05:40.542085Z","shell.execute_reply":"2022-03-04T06:05:40.581425Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"From above code,it is clear that 99 of users took time below 1519 but in data max time took by user is 17383,so there are few users who  took lot of time than ususal which seems to be rare","metadata":{}},{"cell_type":"code","source":"# below function takes data based on given condition \ndef dist_of_minutes(index,type):\n    if type=='most':\n        user_tim=g['mintues'].value_counts()[:index]  ##taking data in descending order of time spent by all users i.e gives mintues\n                                                        #where most of users spent\n        small_d=g['mintues'][g['mintues'].isin(user_tim.index)]\n        plt.figure(figsize=(15,6.5))\n        sns.distplot(small_d.values)\n        plt.ticklabel_format(style='plain', axis='y')\n        plt.ticklabel_format(style='plain', axis='x')\n        plt.title('no of minutes spent by most of users')\n        plt.show()\n        \n    elif type=='rare':\n        user_tim=g['mintues'].value_counts().sort_values() #taking data in ascedning order of time spent by all users i.e gives mintues\n                                                            #where most of users spent very less\n        small_d=g['mintues'][g['mintues'].isin(user_tim.index[:index])]\n        plt.figure(figsize=(15,6.5))\n        sns.distplot(small_d.values)\n        plt.ticklabel_format(style='plain', axis='y')\n        plt.ticklabel_format(style='plain', axis='x')\n        plt.title('no of minutes spent by very few users')\n        plt.show()","metadata":{"execution":{"iopub.status.busy":"2022-03-04T06:16:09.263832Z","iopub.execute_input":"2022-03-04T06:16:09.264243Z","iopub.status.idle":"2022-03-04T06:16:09.275129Z","shell.execute_reply.started":"2022-03-04T06:16:09.264204Z","shell.execute_reply":"2022-03-04T06:16:09.273790Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"dist_of_minutes(1000,type='most')","metadata":{"execution":{"iopub.status.busy":"2022-03-04T06:16:12.530203Z","iopub.execute_input":"2022-03-04T06:16:12.530591Z","iopub.status.idle":"2022-03-04T06:16:14.378538Z","shell.execute_reply.started":"2022-03-04T06:16:12.530537Z","shell.execute_reply":"2022-03-04T06:16:14.377099Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"dist_of_minutes(100,type='most')","metadata":{"execution":{"iopub.status.busy":"2022-03-04T06:16:19.613068Z","iopub.execute_input":"2022-03-04T06:16:19.613443Z","iopub.status.idle":"2022-03-04T06:16:21.253524Z","shell.execute_reply.started":"2022-03-04T06:16:19.613402Z","shell.execute_reply":"2022-03-04T06:16:21.252247Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"From above two graphs,it is clear that in most of users spent more time in between 0 to 20 mins \n\nAnd the very few users falling into the bin as the time increases..in precise lot of users spending very less time and very few users \nspending lot of time\n\n","metadata":{}},{"cell_type":"code","source":"dist_of_minutes(100,type='rare')","metadata":{"execution":{"iopub.status.busy":"2022-03-04T06:19:42.218333Z","iopub.execute_input":"2022-03-04T06:19:42.218734Z","iopub.status.idle":"2022-03-04T06:19:42.509708Z","shell.execute_reply.started":"2022-03-04T06:19:42.218700Z","shell.execute_reply":"2022-03-04T06:19:42.508667Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"And there are very few users who spending lot of time as shown above","metadata":{}},{"cell_type":"code","source":"g.head()","metadata":{"execution":{"iopub.status.busy":"2022-03-04T06:20:38.553830Z","iopub.execute_input":"2022-03-04T06:20:38.554223Z","iopub.status.idle":"2022-03-04T06:20:38.571478Z","shell.execute_reply.started":"2022-03-04T06:20:38.554188Z","shell.execute_reply":"2022-03-04T06:20:38.570403Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"val=g['mintues'].value_counts()\nplt.figure(figsize=(14,5))\nsns.barplot(x=val.index[:35],y=val.values[:35],order=val.index[:35])\nplt.title('Time spent by most of users')\nplt.xlabel('time ')\nplt.ylabel('No of users')\nplt.show()","metadata":{"execution":{"iopub.status.busy":"2022-03-04T06:21:58.856349Z","iopub.execute_input":"2022-03-04T06:21:58.856709Z","iopub.status.idle":"2022-03-04T06:21:59.646376Z","shell.execute_reply.started":"2022-03-04T06:21:58.856670Z","shell.execute_reply":"2022-03-04T06:21:59.645612Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"**Observation:**\n\nMost of users spent 10 minutes in exam/content and almost lot of users spent time in between 10 to 25 minutes","metadata":{}},{"cell_type":"code","source":"plt.figure(figsize=(30,8))\nsns.barplot(x=val.index[-60:],y=val.values[-60:],order=val.index[-60:])\nplt.xticks(rotation=90)\nplt.title('Time spent by very less no of users')\nplt.xlabel('time ')\nplt.ylabel('No of users')\nplt.show()\n","metadata":{"execution":{"iopub.status.busy":"2022-03-04T06:25:28.633713Z","iopub.execute_input":"2022-03-04T06:25:28.634838Z","iopub.status.idle":"2022-03-04T06:25:29.914691Z","shell.execute_reply.started":"2022-03-04T06:25:28.634686Z","shell.execute_reply":"2022-03-04T06:25:29.913602Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"**Observation:**\n\nVery few users spent more time and that too every indiviudal user had unique time which is more","metadata":{}},{"cell_type":"markdown","source":"**Most time spent by all users and their performance**","metadata":{}},{"cell_type":"code","source":"\nmin_10=g[g['mintues']==10.0]\n\nplt.figure(figsize=(25,8))\nsns.countplot(x='per',data=min_10,order=min_10['per'].value_counts().index)\nplt.xticks(rotation=90)\nplt.show()","metadata":{"execution":{"iopub.status.busy":"2022-03-04T07:00:56.927179Z","iopub.execute_input":"2022-03-04T07:00:56.927508Z","iopub.status.idle":"2022-03-04T07:00:59.033631Z","shell.execute_reply.started":"2022-03-04T07:00:56.927477Z","shell.execute_reply":"2022-03-04T07:00:59.032486Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"**Observation:**\n\nAs 10.00 mintues is time spent by most of users in examination,so above plot gives the percentage result of those users who spent 10mins in exam\n\nSo,it is clear that most of users who spent 10min had got only 50 percentage followed by 33 percent i.e not good performance","metadata":{}},{"cell_type":"markdown","source":"**time spend by user who answered very correctly i.e top 20 users who given more correct answer**","metadata":{}},{"cell_type":"code","source":"def addlabels(x,y):\n    for i in range(len(x)):\n        plt.text(i, y[i], y[i], ha = 'center')","metadata":{"execution":{"iopub.status.busy":"2022-03-04T07:03:08.911939Z","iopub.execute_input":"2022-03-04T07:03:08.912905Z","iopub.status.idle":"2022-03-04T07:03:08.919080Z","shell.execute_reply.started":"2022-03-04T07:03:08.912855Z","shell.execute_reply":"2022-03-04T07:03:08.918278Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"sort_ans=g.sort_values('answered_correctly',ascending=False)[:20]\nsort_ans.shape\n\nplt.figure(figsize=(12,6))\nsns.barplot(x='answered_correctly',y='mintues',data=sort_ans,order=sort_ans['answered_correctly'])\n\nplt.xticks(range(len(sort_ans)),sort_ans['user_id'])\nplt.xticks(rotation=90)\naddlabels(sort_ans['user_id'].values,sort_ans['mintues'].values)\n\n\n\nplt.show()\n","metadata":{"execution":{"iopub.status.busy":"2022-03-04T07:09:37.181416Z","iopub.execute_input":"2022-03-04T07:09:37.182396Z","iopub.status.idle":"2022-03-04T07:09:37.838341Z","shell.execute_reply.started":"2022-03-04T07:09:37.182352Z","shell.execute_reply":"2022-03-04T07:09:37.837183Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"**Average time spend by user who got top percentage in exam**","metadata":{}},{"cell_type":"code","source":"grp_per=g.groupby(['per']).sum().round().reset_index().sort_values('per')\n\nplt.figure(figsize=(40,15))\nsns.barplot(x='per',y='mintues',data=grp_per,order=grp_per['per'])\nplt.xticks(rotation=90)\nplt.show()\n\n#addlabels(grp_per['per'].values,grp_per['mintues'].values)","metadata":{"execution":{"iopub.status.busy":"2022-03-04T07:40:04.739206Z","iopub.execute_input":"2022-03-04T07:40:04.740172Z","iopub.status.idle":"2022-03-04T07:40:07.832083Z","shell.execute_reply.started":"2022-03-04T07:40:04.740108Z","shell.execute_reply":"2022-03-04T07:40:07.830768Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"**Observation:**\n\nSuprisingly, based on performace percentage the time spent by each set of user for particualar percentage follows gaussain distribution\nit means that lot of time is spent by users who had mid range percentage i.e 55 to 80\n\nAnd users who had 69 percentage spent more time on content","metadata":{}},{"cell_type":"code","source":"from sklearn.preprocessing import MinMaxScaler\nscaler = MinMaxScaler()\n\n\ng[['norm_ans','norm_total','norm_min']]=scaler.fit_transform(g[['answered_correctly','total','mintues']])\ng.head()","metadata":{"execution":{"iopub.status.busy":"2022-03-04T11:06:36.603144Z","iopub.execute_input":"2022-03-04T11:06:36.603858Z","iopub.status.idle":"2022-03-04T11:06:36.828573Z","shell.execute_reply.started":"2022-03-04T11:06:36.603791Z","shell.execute_reply":"2022-03-04T11:06:36.827519Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"s=g.sort_values('total',ascending=True)  #sorting the data based on total question attempoted by each user\ns.head()","metadata":{"execution":{"iopub.status.busy":"2022-03-04T11:06:40.167693Z","iopub.execute_input":"2022-03-04T11:06:40.168017Z","iopub.status.idle":"2022-03-04T11:06:40.275468Z","shell.execute_reply.started":"2022-03-04T11:06:40.167976Z","shell.execute_reply":"2022-03-04T11:06:40.274426Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"\nplt.figure(figsize=(25,8))\n\n\nplt.plot(range(len(s)),s['mintues'].values,label='min',color='orange')\n\nplt.plot(range(len(s)),s['total'].values,label='total',color='black')\nplt.plot(range(len(s)),s['answered_correctly'].values,label='answered_corectly',color='red')\n\nplt.title('distribution of time and correct_answers wrt total questions ')\nplt.xlabel('No of Total questions')\nplt.legend()\nplt.show()","metadata":{"execution":{"iopub.status.busy":"2022-03-04T07:35:52.422980Z","iopub.execute_input":"2022-03-04T07:35:52.423626Z","iopub.status.idle":"2022-03-04T07:35:54.045353Z","shell.execute_reply.started":"2022-03-04T07:35:52.423555Z","shell.execute_reply":"2022-03-04T07:35:54.043973Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"**Observation:**\n\nIt seems like a pareto distribution i.e lot of users who attempted very less questions and very less users attempted more questions\nand times also following the same pattern of total questions,as questions increasing time also increasing ","metadata":{}},{"cell_type":"code","source":"plt.figure(figsize=(15,8))\nsns.distplot(s['total'].values,hist=False,label='total')\nsns.distplot(s['mintues'].values,hist=False,label='minutes')\nsns.distplot(s['answered_correctly'].values,hist=False,label='answered corectly')\nplt.legend()\nplt.show()","metadata":{"execution":{"iopub.status.busy":"2022-03-04T07:27:34.379401Z","iopub.execute_input":"2022-03-04T07:27:34.380510Z","iopub.status.idle":"2022-03-04T07:27:38.898112Z","shell.execute_reply.started":"2022-03-04T07:27:34.380445Z","shell.execute_reply":"2022-03-04T07:27:38.896989Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"**Observation:**\n\nAnd three features follows the same dsitribution i.e total questions and corect answers and time are related to each other","metadata":{}},{"cell_type":"code","source":"grp_per.head()","metadata":{"execution":{"iopub.status.busy":"2022-03-04T07:40:20.213784Z","iopub.execute_input":"2022-03-04T07:40:20.214260Z","iopub.status.idle":"2022-03-04T07:40:20.232427Z","shell.execute_reply.started":"2022-03-04T07:40:20.214226Z","shell.execute_reply":"2022-03-04T07:40:20.231649Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"plt.figure(figsize=(30,12))\nplt.ticklabel_format(style='plain', axis='y')\nsns.barplot(x='per',y='total',data=grp_per,color='red')\nsns.barplot(x='per',y='answered_correctly',data=grp_per,color='blue')\nsns.barplot(x='per',y='mintues',data=grp_per,color='black')\nplt.xticks(rotation=90)\nplt.show()","metadata":{"execution":{"iopub.status.busy":"2022-03-04T07:43:45.756696Z","iopub.execute_input":"2022-03-04T07:43:45.757107Z","iopub.status.idle":"2022-03-04T07:43:49.283150Z","shell.execute_reply.started":"2022-03-04T07:43:45.757067Z","shell.execute_reply":"2022-03-04T07:43:49.282033Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"**Observation:**\n\nTotal Question,answered_corecctly and time follows the gaussain distribution when percantge of users is considered\n\nAs we know percentage/performance of users following the gausaiin distribution,so the total question attempted by each percentage users also follwong the gaussian vibes and interestly out of total questions ,the correct answers are also folling gaussain\n\nAnd as we come to know that time is dependnt on total questions,so based on questions distribution ,time distribution is also matching \n\nIn final,there lot of questions/time spent by the users who got percentage of 50 to 80 range and rest of them have very less contribution of questions ,so time also low","metadata":{}},{"cell_type":"markdown","source":"**Finding the level of content i.e easy ,medium and hard**\n\nThere may be case like for some x content, 1000 users attempted and only 20 given correct answers\nso that we get to know that x conetnt is very tough to students","metadata":{}},{"cell_type":"code","source":"new.head()","metadata":{"execution":{"iopub.status.busy":"2022-03-04T11:06:47.105804Z","iopub.execute_input":"2022-03-04T11:06:47.106615Z","iopub.status.idle":"2022-03-04T11:06:47.120260Z","shell.execute_reply.started":"2022-03-04T11:06:47.106564Z","shell.execute_reply":"2022-03-04T11:06:47.119574Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"cont=new[['content_id','answered_correctly','prior_question_elapsed_time']].groupby('content_id').sum().reset_index()\ncont_=new[['content_id','answered_correctly']].groupby('content_id').count().reset_index()\ncont['tot_ques']=cont_['answered_correctly'].values\ncont['min']=np.round(cont['prior_question_elapsed_time']/60000)\ncont['per']=np.round((cont['answered_correctly']/cont['tot_ques'])*100)\ncont.head()","metadata":{"execution":{"iopub.status.busy":"2022-03-04T11:07:47.824297Z","iopub.execute_input":"2022-03-04T11:07:47.825072Z","iopub.status.idle":"2022-03-04T11:07:56.434385Z","shell.execute_reply.started":"2022-03-04T11:07:47.825025Z","shell.execute_reply":"2022-03-04T11:07:56.433473Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"plt.figure(figsize=(25,10))\nplt.ticklabel_format(style='plain', axis='y')\nsns.barplot(x=cont['per'].value_counts().index,y=cont['per'].value_counts().values)\nplt.xticks(rotation=90)\nplt.show()","metadata":{"execution":{"iopub.status.busy":"2022-03-04T11:08:03.749639Z","iopub.execute_input":"2022-03-04T11:08:03.749971Z","iopub.status.idle":"2022-03-04T11:08:05.048291Z","shell.execute_reply.started":"2022-03-04T11:08:03.749940Z","shell.execute_reply":"2022-03-04T11:08:05.047485Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"**Observation:**\n\nTher percentage of answer question with respect to each contents also follows slightly gaussian distributiion","metadata":{}},{"cell_type":"code","source":"\ncont['diff']=cont['tot_ques']-cont['answered_correctly']\nnew_con=cont[cont['diff']>0]\nnew_con.head()","metadata":{"execution":{"iopub.status.busy":"2022-03-04T11:08:17.415511Z","iopub.execute_input":"2022-03-04T11:08:17.415849Z","iopub.status.idle":"2022-03-04T11:08:17.439233Z","shell.execute_reply.started":"2022-03-04T11:08:17.415818Z","shell.execute_reply":"2022-03-04T11:08:17.438414Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"**contents/questions that are very tough i.e among all users who attempted ,only few users given correct answer**","metadata":{}},{"cell_type":"code","source":"plt.figure(figsize=(25,8))\ntough=new_con.sort_values('diff',ascending=False)[:100]  #more the diff btn total question attempted and correctly asnweres\n                                                        #it means that very less users had answered it out of total users attemoted\nsns.barplot(x='content_id',y='diff',data=tough,order=tough['content_id'])\nplt.title('Content id Which attempted by users but only few users given correct answers ot of total users')\nplt.xticks(rotation=90)\nplt.show()","metadata":{"execution":{"iopub.status.busy":"2022-03-04T08:53:18.758298Z","iopub.execute_input":"2022-03-04T08:53:18.759116Z","iopub.status.idle":"2022-03-04T08:53:20.171305Z","shell.execute_reply.started":"2022-03-04T08:53:18.759073Z","shell.execute_reply":"2022-03-04T08:53:20.170348Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"**Observation:**\n\n\nAbove graphs shows some content id which seems very tough to users i.e. only few user given correct answers out of total users attempted.\n\nGraphs is plotted by taking difference between total question attempted and correctly answered out of it for each content,so it may be case that more the diff more the tough the content was.\n\n\n","metadata":{}},{"cell_type":"markdown","source":"**Contents which recevied lot of correct answers irrespective of total attempted on it (purely focusing on correct answers)**\n","metadata":{}},{"cell_type":"code","source":"plt.figure(figsize=(25,8))\neasy=new_con.sort_values('answered_correctly',ascending=False)[:100]\nsns.barplot(x='content_id',y='answered_correctly',data=easy,order=easy['content_id'])\n\nplt.title('Conetnts which recevied lot of correct answers')\nplt.xticks(rotation=90)\nplt.show()","metadata":{"execution":{"iopub.status.busy":"2022-03-04T08:55:18.331137Z","iopub.execute_input":"2022-03-04T08:55:18.331510Z","iopub.status.idle":"2022-03-04T08:55:19.720033Z","shell.execute_reply.started":"2022-03-04T08:55:18.331451Z","shell.execute_reply":"2022-03-04T08:55:19.719118Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"**Contents which out of all users who attempted this,every one given correct answers(100% success ratio of that content)**","metadata":{}},{"cell_type":"code","source":"zero=cont[cont['diff']==0]\nzero.head()","metadata":{"execution":{"iopub.status.busy":"2022-03-04T11:23:18.331659Z","iopub.execute_input":"2022-03-04T11:23:18.332504Z","iopub.status.idle":"2022-03-04T11:23:18.349104Z","shell.execute_reply.started":"2022-03-04T11:23:18.332468Z","shell.execute_reply":"2022-03-04T11:23:18.348431Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"print('content with 100% success ratio:')\n      \nprint(zero['content_id'].values)","metadata":{"execution":{"iopub.status.busy":"2022-03-04T11:26:09.286879Z","iopub.execute_input":"2022-03-04T11:26:09.287841Z","iopub.status.idle":"2022-03-04T11:26:09.293519Z","shell.execute_reply.started":"2022-03-04T11:26:09.287801Z","shell.execute_reply":"2022-03-04T11:26:09.292757Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"Above content seems easy so that each user who attempted given correct answer","metadata":{}},{"cell_type":"markdown","source":"**About lecture content**","metadata":{}},{"cell_type":"code","source":"lec=data[data['content_type_id']==1]\nlec.head()","metadata":{"execution":{"iopub.status.busy":"2022-03-04T11:27:12.614761Z","iopub.execute_input":"2022-03-04T11:27:12.615312Z","iopub.status.idle":"2022-03-04T11:27:13.047810Z","shell.execute_reply.started":"2022-03-04T11:27:12.615274Z","shell.execute_reply":"2022-03-04T11:27:13.046971Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"lec.shape","metadata":{"execution":{"iopub.status.busy":"2022-03-04T11:27:15.151196Z","iopub.execute_input":"2022-03-04T11:27:15.151504Z","iopub.status.idle":"2022-03-04T11:27:15.157284Z","shell.execute_reply.started":"2022-03-04T11:27:15.151470Z","shell.execute_reply":"2022-03-04T11:27:15.156572Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"**User who watched more lectures**","metadata":{}},{"cell_type":"code","source":"def count(length,feature,typee,title):\n    if typee=='top':\n        val=lec[feature].value_counts()[:length]\n        plt.figure(figsize=(8,5))\n        sns.barplot(x=val.index,y=val.values,order=val.index)\n        plt.xlabel(feature)\n        plt.title(title)\n        plt.ylabel('count')\n        plt.xticks(rotation=90)\n        plt.show()\n    elif typee=='least':\n        val=lec[feature].value_counts().sort_values()[:length]\n        plt.figure(figsize=(8,5))\n        sns.barplot(x=val.index,y=val.values,order=val.index)\n        plt.xlabel(feature)\n        plt.title(title)\n        plt.ylabel('count')\n        plt.xticks(rotation=90)\n        plt.show()      ","metadata":{"execution":{"iopub.status.busy":"2022-03-04T11:34:48.067513Z","iopub.execute_input":"2022-03-04T11:34:48.067862Z","iopub.status.idle":"2022-03-04T11:34:48.077447Z","shell.execute_reply.started":"2022-03-04T11:34:48.067823Z","shell.execute_reply":"2022-03-04T11:34:48.076336Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"count(25,'user_id',typee='top',title='Top 25 users who seen more lectures')","metadata":{"execution":{"iopub.status.busy":"2022-03-04T11:34:48.508425Z","iopub.execute_input":"2022-03-04T11:34:48.508740Z","iopub.status.idle":"2022-03-04T11:34:48.927764Z","shell.execute_reply.started":"2022-03-04T11:34:48.508692Z","shell.execute_reply":"2022-03-04T11:34:48.927020Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"count(35,'user_id',typee='least',title='least 35 users who seen more lectures')","metadata":{"execution":{"iopub.status.busy":"2022-03-04T11:34:54.353690Z","iopub.execute_input":"2022-03-04T11:34:54.354147Z","iopub.status.idle":"2022-03-04T11:34:54.836875Z","shell.execute_reply.started":"2022-03-04T11:34:54.354115Z","shell.execute_reply":"2022-03-04T11:34:54.835982Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"count(25,'content_id',typee='top',title='Top 25 contents moslty viewed')","metadata":{"execution":{"iopub.status.busy":"2022-03-04T11:35:00.268824Z","iopub.execute_input":"2022-03-04T11:35:00.269112Z","iopub.status.idle":"2022-03-04T11:35:00.646694Z","shell.execute_reply.started":"2022-03-04T11:35:00.269084Z","shell.execute_reply":"2022-03-04T11:35:00.645749Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"count(25,'content_id',typee='least',title='least 25 contents rarely viewed')","metadata":{"execution":{"iopub.status.busy":"2022-03-04T11:35:05.424581Z","iopub.execute_input":"2022-03-04T11:35:05.424914Z","iopub.status.idle":"2022-03-04T11:35:05.796060Z","shell.execute_reply.started":"2022-03-04T11:35:05.424878Z","shell.execute_reply":"2022-03-04T11:35:05.795187Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"#total no of uniqye contents\n\nlength=len(lec['content_id'].value_counts())\nlength","metadata":{"execution":{"iopub.status.busy":"2022-03-04T11:35:09.480727Z","iopub.execute_input":"2022-03-04T11:35:09.481767Z","iopub.status.idle":"2022-03-04T11:35:09.496989Z","shell.execute_reply.started":"2022-03-04T11:35:09.481723Z","shell.execute_reply":"2022-03-04T11:35:09.496222Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"**lets check question and lecture dataset******","metadata":{}},{"cell_type":"code","source":"lecture=pd.read_csv('../input/riiid-test-answer-prediction/lectures.csv')\nlecture.head()","metadata":{"execution":{"iopub.status.busy":"2022-03-04T11:40:58.859108Z","iopub.execute_input":"2022-03-04T11:40:58.859435Z","iopub.status.idle":"2022-03-04T11:40:58.892729Z","shell.execute_reply.started":"2022-03-04T11:40:58.859405Z","shell.execute_reply":"2022-03-04T11:40:58.892110Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"lecture.shape","metadata":{"execution":{"iopub.status.busy":"2022-03-04T11:41:01.861778Z","iopub.execute_input":"2022-03-04T11:41:01.862644Z","iopub.status.idle":"2022-03-04T11:41:01.868787Z","shell.execute_reply.started":"2022-03-04T11:41:01.862604Z","shell.execute_reply":"2022-03-04T11:41:01.867812Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"**Exploring the lecture datset**","metadata":{}},{"cell_type":"code","source":"plt.figure(figsize=(10,5))\nsns.countplot(x='tag',data=lecture,order=lecture['tag'].value_counts().iloc[:25].index)\n\nplt.title('tags present in data')\nplt.xticks(rotation=90)\nplt.show()  ","metadata":{"execution":{"iopub.status.busy":"2022-03-04T11:41:04.661219Z","iopub.execute_input":"2022-03-04T11:41:04.661682Z","iopub.status.idle":"2022-03-04T11:41:04.986830Z","shell.execute_reply.started":"2022-03-04T11:41:04.661649Z","shell.execute_reply":"2022-03-04T11:41:04.985766Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"plt.figure(figsize=(10,5))\nsns.countplot(x='type_of',data=lecture,order=lecture['type_of'].value_counts().index)\nplt.title('typpes of lectures')\nplt.xticks(rotation=90)\nplt.show()  ","metadata":{"execution":{"iopub.status.busy":"2022-03-04T11:41:31.214195Z","iopub.execute_input":"2022-03-04T11:41:31.214506Z","iopub.status.idle":"2022-03-04T11:41:31.396772Z","shell.execute_reply.started":"2022-03-04T11:41:31.214467Z","shell.execute_reply":"2022-03-04T11:41:31.395888Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"plt.figure(figsize=(10,5))\nsns.countplot(x='part',data=lecture,order=lecture['part'].value_counts().index)\nplt.title('typpes of parts present in data')\nplt.xticks(rotation=90)\nplt.show()  ","metadata":{"execution":{"iopub.status.busy":"2022-03-04T11:42:26.786386Z","iopub.execute_input":"2022-03-04T11:42:26.786749Z","iopub.status.idle":"2022-03-04T11:42:26.992830Z","shell.execute_reply.started":"2022-03-04T11:42:26.786712Z","shell.execute_reply":"2022-03-04T11:42:26.992038Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"plt.figure(figsize=(10,5))\nsns.countplot(x='part',data=lecture,hue='type_of',order=lecture['part'].value_counts().index)\nplt.title('typpes of lectures')\nplt.xticks(rotation=90)\nplt.show()  ","metadata":{"execution":{"iopub.status.busy":"2022-03-04T11:42:32.144976Z","iopub.execute_input":"2022-03-04T11:42:32.145750Z","iopub.status.idle":"2022-03-04T11:42:32.461734Z","shell.execute_reply.started":"2022-03-04T11:42:32.145712Z","shell.execute_reply":"2022-03-04T11:42:32.460755Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"**Observation:**\n\nLectures are more related to concepts and soliving questions\n\nAnd in each part,most of content is related concept and solving questions but except part 2 and part 1 every part has more concept realted lectures than solving questions","metadata":{}},{"cell_type":"markdown","source":"**Understanding the questions data**","metadata":{}},{"cell_type":"code","source":"question=pd.read_csv('../input/riiid-test-answer-prediction/questions.csv')\nquestion.head()","metadata":{"execution":{"iopub.status.busy":"2022-03-04T11:45:34.424177Z","iopub.execute_input":"2022-03-04T11:45:34.424628Z","iopub.status.idle":"2022-03-04T11:45:34.464116Z","shell.execute_reply.started":"2022-03-04T11:45:34.424577Z","shell.execute_reply":"2022-03-04T11:45:34.463203Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"question.shape","metadata":{"execution":{"iopub.status.busy":"2022-03-04T11:45:37.878089Z","iopub.execute_input":"2022-03-04T11:45:37.878861Z","iopub.status.idle":"2022-03-04T11:45:37.883879Z","shell.execute_reply.started":"2022-03-04T11:45:37.878821Z","shell.execute_reply":"2022-03-04T11:45:37.883107Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"plt.figure(figsize=(10,5))\nsns.countplot(x='part',data=question,order=question['part'].value_counts().index)\nplt.title('typs of parts in questions')\nplt.xticks(rotation=90)\nplt.show()  ","metadata":{"execution":{"iopub.status.busy":"2022-03-04T11:45:40.284779Z","iopub.execute_input":"2022-03-04T11:45:40.285600Z","iopub.status.idle":"2022-03-04T11:45:40.480034Z","shell.execute_reply.started":"2022-03-04T11:45:40.285550Z","shell.execute_reply":"2022-03-04T11:45:40.479479Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"plt.figure(figsize=(10,5))\nsns.countplot(x='tags',data=question,order=question['tags'].value_counts().iloc[:25].index)\nplt.title('most used tags in questions')\nplt.xticks(rotation=90)\nplt.show()  ","metadata":{"execution":{"iopub.status.busy":"2022-03-04T11:46:06.027582Z","iopub.execute_input":"2022-03-04T11:46:06.027945Z","iopub.status.idle":"2022-03-04T11:46:06.379550Z","shell.execute_reply.started":"2022-03-04T11:46:06.027910Z","shell.execute_reply":"2022-03-04T11:46:06.378661Z"},"trusted":true},"execution_count":null,"outputs":[]}]}