├── Correlation.png ├── Data_Preprocessing.ipynb ├── Data_Visualization.ipynb ├── EDA ├── .ipynb_checkpoints │ └── Data_Visualization_and_Feature_Extraction-checkpoint.ipynb ├── Correlation.png ├── Data_Visualization_and_Feature_Extraction.ipynb ├── Data_Visualization_and_Feature_Extraction.py ├── Family_support_plot.png ├── Going_out_plot.png ├── Grade_Age.png ├── Grade_Failure_status.png ├── Grade_Parental_status.png ├── Grade_Relationshipstatus.png ├── Grade_family support.png ├── Grade_fathers_edu.png ├── Grade_fathers_job.png ├── Grade_freetime_status.png ├── Grade_gender.png ├── Grade_going_out.png ├── Grade_internet_status.png ├── Grade_location.png ├── Grade_mhigher_education_status.png ├── Grade_mothers_edu.png ├── Grade_mothers_fathers_edu.png ├── Grade_mothers_fathers_job.png ├── Grade_mothers_job.png ├── Grade_overall_health.png ├── Grade_regularity.png ├── Grade_study_time.png ├── Grade_weekend_alchol.png ├── Grade_workday_alchol.png ├── Guardian_plot.png ├── Parent_Education_plot.png ├── Parent_Job_plot.png ├── Pstatus_plot.png ├── Reason_plot.png ├── Study_time_plot.png ├── address_plot.png ├── age_plot.png ├── alcohol_consumption_plot.png ├── attend_nursery_plot.png ├── extracurricular_plot.png ├── failures_plot.png ├── fam_relationship_plot.png ├── family_plot.png ├── free_time_plot.png ├── gender.png ├── higher_education_plot.png ├── internet_plot.png ├── paid_claases_plot.png ├── rom_relationship_plot.png ├── school.png ├── school_support_plot.png └── travel_time_plot.png ├── Evaluation.txt ├── Family_support_plot.png ├── Feature_Engineering.png ├── Going_out_plot.png ├── Grade_Parental_status.png ├── Grade_Relationshipstatus.png ├── Grade_fathers_edu.png ├── Grade_fathers_job.png ├── Grade_gender.png ├── Grade_going_out.png ├── Grade_internet_status.png ├── Grade_location.png ├── Grade_mhigher_education_status.png ├── Grade_mothers_edu.png ├── Grade_mothers_job.png ├── Grade_overall_health.png ├── Grade_regularity.png ├── Grade_study_time.png ├── Grade_weekend_alchol.png ├── Grade_workday_alchol.png ├── Guardian_plot.png ├── ML PROJECT REPORT (2).pdf ├── Model.ipynb ├── Model_prediction.ipynb ├── Model_prediction.py ├── PROJECT REPORT.pdf ├── Parent_Education_plot.png ├── Parent_Job_plot.png ├── Pstatus_plot.png ├── README.md ├── ROC1.png ├── ROC2.png ├── ROC3.png ├── ROC4.png ├── Reason_plot.png ├── STUDENT_GRADE.ipynb ├── STUDENT_GRADE_LABEL_ENCODING.ipynb ├── STUDENT_GRADE_ONE_HOT_ENCODING.ipynb ├── Student_Performance_Prediction_Model.ipynb ├── Study_time_plot.png ├── Untitled.ipynb ├── address_plot.png ├── age_plot.png ├── alcohol_consumption_plot.png ├── attend_nursery_plot.png ├── confusion_matrix.png ├── correlation_plot.png ├── extracurricular_plot.png ├── failures_plot.png ├── fam_relationship_plot.png ├── family_plot.png ├── features.csv ├── free_time_plot.png ├── gender.png ├── gender_plot.png ├── grades.png ├── higher_education_plot.png ├── input ├── features.csv ├── student-mat.csv ├── student-por.csv └── students.csv ├── internet_plot.png ├── model_evaluation.ipynb ├── model_evaluation_ver2.ipynb ├── model_xgb ├── paid_claases_plot.png ├── pickle ├── model_ada.pkl ├── model_dt.pkl ├── model_lr.pkl ├── model_rf.pkl ├── model_svm.pkl └── model_xgb.pkl ├── rom_relationship_plot.png ├── school.png ├── school_plot.png ├── school_support_plot.png ├── student-mat.csv ├── student-por.csv ├── student.csv ├── students.csv └── travel_time_plot.png /Correlation.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RohithYogi/Student-Performance-Prediction/7ab64a53718481cdcbd2b917d646cea25b833082/Correlation.png -------------------------------------------------------------------------------- /Data_Preprocessing.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "code", 5 | "execution_count": null, 6 | "metadata": {}, 7 | "outputs": [], 8 | "source": [] 9 | } 10 | ], 11 | "metadata": { 12 | "kernelspec": { 13 | "display_name": "Python 3", 14 | "language": "python", 15 | "name": "python3" 16 | }, 17 | "language_info": { 18 | "codemirror_mode": { 19 | "name": "ipython", 20 | "version": 3 21 | }, 22 | "file_extension": ".py", 23 | "mimetype": "text/x-python", 24 | "name": "python", 25 | "nbconvert_exporter": "python", 26 | "pygments_lexer": "ipython3", 27 | "version": "3.6.6" 28 | } 29 | }, 30 | "nbformat": 4, 31 | "nbformat_minor": 2 32 | } 33 | -------------------------------------------------------------------------------- /EDA/Correlation.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RohithYogi/Student-Performance-Prediction/7ab64a53718481cdcbd2b917d646cea25b833082/EDA/Correlation.png -------------------------------------------------------------------------------- /EDA/Data_Visualization_and_Feature_Extraction.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # coding: utf-8 3 | 4 | # # Data Visualization 5 | 6 | # In[217]: 7 | 8 | 9 | import numpy as np 10 | import pandas as pd 11 | import sklearn 12 | import matplotlib.pyplot as plt 13 | import seaborn as sns 14 | 15 | 16 | # In[218]: 17 | 18 | 19 | train_por = pd.read_csv('../input/student-por.csv') 20 | train_mat = pd.read_csv('../input/student-mat.csv') 21 | 22 | 23 | # In[219]: 24 | 25 | 26 | train_por.head() 27 | 28 | 29 | # In[220]: 30 | 31 | 32 | train_mat.head() 33 | 34 | 35 | # In[221]: 36 | 37 | 38 | train_por.shape 39 | 40 | 41 | # In[222]: 42 | 43 | 44 | train_por.dropna().shape #no null values in train_por 45 | 46 | 47 | # In[223]: 48 | 49 | 50 | train_mat.shape 51 | 52 | 53 | # In[224]: 54 | 55 | 56 | train_mat.dropna().shape #no null values in train_mat 57 | 58 | 59 | # In[225]: 60 | 61 | 62 | subset=train_por.columns 63 | 64 | 65 | # In[226]: 66 | 67 | 68 | train_por=train_por.drop_duplicates(subset=None, keep='first', inplace=False) 69 | train_por.shape #no duplicates in train_por 70 | 71 | 72 | # In[227]: 73 | 74 | 75 | subset=train_mat.columns 76 | 77 | 78 | # In[228]: 79 | 80 | 81 | train_mat=train_mat.drop_duplicates(subset=None, keep='first', inplace=False) 82 | train_mat.shape #no duplicates in train_mat 83 | 84 | 85 | # In[229]: 86 | 87 | 88 | train_por['subject']='Portuguese' 89 | 90 | 91 | # In[230]: 92 | 93 | 94 | train_mat['subject']='Maths' 95 | 96 | 97 | # In[231]: 98 | 99 | 100 | train=pd.concat([train_por, train_mat], axis=0) #combining two data files with subject as discriminant column to distinguish columns 101 | 102 | 103 | # In[232]: 104 | 105 | 106 | train.head() 107 | 108 | 109 | # In[233]: 110 | 111 | 112 | train.to_csv('../input/students.csv', index=False) 113 | 114 | 115 | # In[234]: 116 | 117 | 118 | # contains all the merged data 119 | data = pd.read_csv('../input/students.csv') 120 | 121 | 122 | # In[235]: 123 | 124 | 125 | def correlation(df): 126 | corr = df.corr() 127 | fig, ax = plt.subplots(figsize=(20, 15)) 128 | colormap = sns.diverging_palette(150,50, as_cmap=True) 129 | sns.heatmap(corr, cmap=colormap, annot=True, fmt=".2f") 130 | plt.xticks(range(len(corr.columns)), corr.columns); 131 | plt.yticks(range(len(corr.columns)), corr.columns) 132 | plt.savefig('Correlation.png', bbox_inches='tight') 133 | plt.show() 134 | 135 | 136 | # In[236]: 137 | 138 | 139 | correlation(data) 140 | 141 | 142 | # In[237]: 143 | 144 | 145 | data.columns 146 | 147 | 148 | # In[238]: 149 | 150 | 151 | f, ax = plt.subplots() 152 | figure = sns.countplot(x = 'school', data=data, order=['GP','MS']) 153 | ax = ax.set(ylabel="Count", xlabel="school") 154 | figure.grid(False) 155 | plt.title('School Distribution') 156 | plt.savefig('school.png', bbox_inches='tight') 157 | 158 | 159 | # In[239]: 160 | 161 | 162 | f, ax = plt.subplots() 163 | figure = sns.countplot(x = 'sex', data=data, order=['M','F']) 164 | ax = ax.set(ylabel="Count", xlabel="gender") 165 | figure.grid(False) 166 | plt.title('Gender Distribution') 167 | plt.savefig('gender.png', bbox_inches='tight') 168 | 169 | 170 | # In[240]: 171 | 172 | 173 | data['age'].max() 174 | 175 | 176 | # In[241]: 177 | 178 | 179 | data['age'].min() 180 | 181 | 182 | # In[242]: 183 | 184 | 185 | f, ax = plt.subplots() 186 | figure = sns.countplot(x = 'age', data=data, order=[15,16,17,18,19,20,21,22]) 187 | ax = ax.set(ylabel="Count", xlabel="age") 188 | figure.grid(False) 189 | plt.title('Age Distribution') 190 | plt.savefig('age_plot.png', bbox_inches='tight') 191 | 192 | 193 | # In[243]: 194 | 195 | 196 | f, ax = plt.subplots() 197 | figure = sns.countplot(x = 'address', data=data, order=['U','R']) 198 | ax = ax.set(ylabel="Count", xlabel="address") 199 | figure.grid(False) 200 | plt.title('Address Distribution') 201 | plt.savefig('address_plot.png', bbox_inches='tight') 202 | 203 | 204 | # In[244]: 205 | 206 | 207 | data['famsize'].unique() 208 | 209 | 210 | # In[245]: 211 | 212 | 213 | f, ax = plt.subplots() 214 | figure = sns.countplot(x = 'famsize', data=data, order=['GT3','LE3']) 215 | ax = ax.set(ylabel="Count", xlabel="famsize") 216 | figure.grid(False) 217 | plt.title('Family Distribution') 218 | plt.savefig('family_plot.png', bbox_inches='tight') 219 | 220 | 221 | # In[ ]: 222 | 223 | 224 | 225 | 226 | 227 | # In[246]: 228 | 229 | 230 | f, ax = plt.subplots() 231 | figure = sns.countplot(x = 'Pstatus', data=data, order=['A','T']) 232 | ax = ax.set(ylabel="Count", xlabel="status") 233 | figure.grid(False) 234 | plt.title('Parents status Distribution') 235 | plt.savefig('Pstatus_plot.png', bbox_inches='tight') 236 | 237 | 238 | # In[247]: 239 | 240 | 241 | #(numeric: 0 - none, 1 - primary education (4th grade), 2 - 5th to 9th grade, 3 - secondary education or 4 - higher education) 242 | f, ax = plt.subplots() 243 | figure = sns.countplot(x = 'Medu', data=data, order=[0,1,2,3,4]) 244 | ax = ax.set(ylabel="Count", xlabel="Mother Education") 245 | figure.grid(False) 246 | plt.title('Parent Education Distribution') 247 | f, ax = plt.subplots() 248 | figure = sns.countplot(x = 'Fedu', data=data, order=[0,1,2,3,4]) 249 | ax = ax.set(ylabel="Count", xlabel="Father Education") 250 | figure.grid(False) 251 | plt.savefig('Parent_Education_plot.png', bbox_inches='tight') 252 | 253 | 254 | # In[248]: 255 | 256 | 257 | # (nominal: 'teacher', 'health' care related, civil 'services' (e.g. administrative or police), 'at_home' or 'other') 258 | f, ax = plt.subplots() 259 | figure = sns.countplot(x = 'Mjob', data=data, order=['teacher','health','services','at_home','other']) 260 | ax = ax.set(ylabel="Count", xlabel="Mother Job") 261 | figure.grid(False) 262 | plt.title('Parent Job Distribution') 263 | f, ax = plt.subplots() 264 | figure = sns.countplot(x = 'Fjob', data=data, order=['teacher','health','services','at_home','other']) 265 | ax = ax.set(ylabel="Count", xlabel="Father Job") 266 | figure.grid(False) 267 | plt.savefig('Parent_Job_plot.png', bbox_inches='tight') 268 | 269 | 270 | # In[249]: 271 | 272 | 273 | #(nominal: close to 'home', school 'reputation', 'course' preference or 'other') 274 | f, ax = plt.subplots() 275 | figure = sns.countplot(x = 'reason', data=data, order=['home','reputation','course','other']) 276 | ax = ax.set(ylabel="Count", xlabel="reason to chose this school") 277 | figure.grid(False) 278 | plt.title('Reason Distribution') 279 | plt.savefig('Reason_plot.png', bbox_inches='tight') 280 | 281 | 282 | # In[250]: 283 | 284 | 285 | #(nominal: 'mother', 'father' or 'other') 286 | f, ax = plt.subplots() 287 | figure = sns.countplot(x = 'guardian', data=data, order=['mother','father','other']) 288 | ax = ax.set(ylabel="Count", xlabel="Guardian") 289 | figure.grid(False) 290 | plt.title('Guardian Distribution') 291 | plt.savefig('Guardian_plot.png', bbox_inches='tight') 292 | 293 | 294 | # In[251]: 295 | 296 | 297 | # (numeric: 1 - <15 min., 2 - 15 to 30 min., 3 - 30 min. to 1 hour, or 4 - >1 hour) 298 | f, ax = plt.subplots() 299 | figure = sns.countplot(x = 'traveltime', data=data, order=[1,2,3,4]) 300 | ax = ax.set(ylabel="Count", xlabel="travel time") 301 | figure.grid(False) 302 | plt.title('Travel Time Distribution') 303 | plt.savefig('travel_time_plot.png', bbox_inches='tight') 304 | 305 | 306 | # In[252]: 307 | 308 | 309 | # (numeric: 1 - <2 hours, 2 - 2 to 5 hours, 3 - 5 to 10 hours, or 4 - >10 hours) 310 | f, ax = plt.subplots() 311 | figure = sns.countplot(x = 'studytime', data=data, order=[1,2,3,4]) 312 | ax = ax.set(ylabel="Count", xlabel="study time") 313 | figure.grid(False) 314 | plt.title('Study Time Distribution') 315 | plt.savefig('Study_time_plot.png', bbox_inches='tight') 316 | 317 | 318 | # In[253]: 319 | 320 | 321 | #(numeric: n if 1<=n<3, else 4) 322 | f, ax = plt.subplots() 323 | figure = sns.countplot(x = 'failures', data=data, order=[0,1,2,3]) 324 | ax = ax.set(ylabel="Count", xlabel="failures") 325 | figure.grid(False) 326 | plt.title('failures Distribution') 327 | plt.savefig('failures_plot.png', bbox_inches='tight') 328 | 329 | 330 | # In[254]: 331 | 332 | 333 | f, ax = plt.subplots() 334 | figure = sns.countplot(x = 'schoolsup', data=data, order=['yes','no']) 335 | ax = ax.set(ylabel="Count", xlabel="School Support") 336 | figure.grid(False) 337 | plt.title('School Support Distribution') 338 | plt.savefig('school_support_plot.png', bbox_inches='tight') 339 | 340 | 341 | # In[255]: 342 | 343 | 344 | f, ax = plt.subplots() 345 | figure = sns.countplot(x = 'famsup', data=data, order=['yes','no']) 346 | ax = ax.set(ylabel="Count", xlabel="Family Support") 347 | figure.grid(False) 348 | plt.title('Family Support Distribution') 349 | plt.savefig('Family_support_plot.png', bbox_inches='tight') 350 | 351 | 352 | # In[256]: 353 | 354 | 355 | f, ax = plt.subplots() 356 | figure = sns.countplot(x = 'paid', data=data, order=['yes','no']) 357 | ax = ax.set(ylabel="Count", xlabel="extra paid classes") 358 | figure.grid(False) 359 | plt.title('Extra paid classes Distribution') 360 | plt.savefig('paid_claases_plot.png', bbox_inches='tight') 361 | 362 | 363 | # In[257]: 364 | 365 | 366 | f, ax = plt.subplots() 367 | figure = sns.countplot(x = 'activities', data=data, order=['yes','no']) 368 | ax = ax.set(ylabel="Count", xlabel="extra-curricular activities") 369 | figure.grid(False) 370 | plt.title('extra-curricular activities Distribution') 371 | plt.savefig('extracurricular_plot.png', bbox_inches='tight') 372 | 373 | 374 | # In[258]: 375 | 376 | 377 | f, ax = plt.subplots() 378 | figure = sns.countplot(x = 'nursery', data=data, order=['yes','no']) 379 | ax = ax.set(ylabel="Count", xlabel="attended nursery") 380 | figure.grid(False) 381 | plt.title('attended nursery Distribution') 382 | plt.savefig('attend_nursery_plot.png', bbox_inches='tight') 383 | 384 | 385 | # In[259]: 386 | 387 | 388 | f, ax = plt.subplots() 389 | figure = sns.countplot(x = 'higher', data=data, order=['yes','no']) 390 | ax = ax.set(ylabel="Count", xlabel="wants to take higher education") 391 | figure.grid(False) 392 | plt.title('Students who want to take higher education Distribution') 393 | plt.savefig('higher_education_plot.png', bbox_inches='tight') 394 | 395 | 396 | # In[260]: 397 | 398 | 399 | f, ax = plt.subplots() 400 | figure = sns.countplot(x = 'internet', data=data, order=['yes','no']) 401 | ax = ax.set(ylabel="Count", xlabel="Internet access at home") 402 | figure.grid(False) 403 | plt.title('Internet access at home Distribution') 404 | plt.savefig('school_support_plot.png', bbox_inches='tight') 405 | plt.savefig('internet_plot.png', bbox_inches='tight') 406 | 407 | 408 | # In[261]: 409 | 410 | 411 | f, ax = plt.subplots() 412 | figure = sns.countplot(x = 'romantic', data=data, order=['yes','no']) 413 | ax = ax.set(ylabel="Count", xlabel="With a romantic relationship") 414 | figure.grid(False) 415 | plt.title('Students with a romantic relationship Distribution') 416 | plt.savefig('rom_relationship_plot.png', bbox_inches='tight') 417 | 418 | 419 | # In[262]: 420 | 421 | 422 | f, ax = plt.subplots() 423 | figure = sns.countplot(x = 'famrel', data=data, order=[1,2,3,4,5]) 424 | ax = ax.set(ylabel="Count", xlabel="family relationship") 425 | figure.grid(False) 426 | plt.title('family relationship Distribution') 427 | plt.savefig('fam_relationship_plot.png', bbox_inches='tight') 428 | 429 | 430 | # In[263]: 431 | 432 | 433 | f, ax = plt.subplots() 434 | figure = sns.countplot(x = 'freetime', data=data, order=[1,2,3,4,5]) 435 | ax = ax.set(ylabel="Count", xlabel="Freetime") 436 | figure.grid(False) 437 | plt.title('Free time Distribution') 438 | plt.savefig('free_time_plot.png', bbox_inches='tight') 439 | 440 | 441 | # In[264]: 442 | 443 | 444 | f, ax = plt.subplots() 445 | figure = sns.countplot(x = 'goout', data=data, order=[1,2,3,4,5]) 446 | ax = ax.set(ylabel="Count", xlabel="Going Out") 447 | figure.grid(False) 448 | plt.title('Going Out Distribution') 449 | plt.savefig('Going_out_plot.png', bbox_inches='tight') 450 | 451 | 452 | # In[265]: 453 | 454 | 455 | f, ax = plt.subplots() 456 | figure = sns.countplot(x = 'Dalc', data=data, order=[1,2,3,4,5]) 457 | ax = ax.set(ylabel="Count", xlabel="Working") 458 | figure.grid(False) 459 | plt.title('Working day alcohol consumption Distribution') 460 | f, ax = plt.subplots() 461 | figure = sns.countplot(x = 'Walc', data=data, order=[1,2,3,4,5]) 462 | ax = ax.set(ylabel="Count", xlabel="Weekends") 463 | figure.grid(False) 464 | plt.title('Weekend alcohol consumption Distribution') 465 | plt.savefig('alcohol_consumption_plot.png', bbox_inches='tight') 466 | 467 | 468 | # In[266]: 469 | 470 | 471 | # convert finalscore to categorical variable 472 | data = pd.read_csv('../input/students.csv') 473 | data.head() 474 | data['FinalGrade'] = 'na' 475 | data.loc[(data.G3 >= 18) & (data.G3 <= 20), 'FinalGrade'] = 'Excellent' 476 | data.loc[(data.G3 >= 15) & (data.G3 <= 17), 'FinalGrade'] = 'Good' 477 | data.loc[(data.G3 >= 11) & (data.G3 <= 14), 'FinalGrade'] = 'Satisfactory' 478 | data.loc[(data.G3 >= 6) & (data.G3 <= 10), 'FinalGrade'] = 'Poor' 479 | data.loc[(data.G3 >= 0) & (data.G3 <= 5), 'FinalGrade'] = 'Failure' 480 | data.head(5) 481 | 482 | # data.drop(['Grade'],axis=1) 483 | 484 | 485 | # In[267]: 486 | 487 | 488 | # relationship status 489 | perc = (lambda col: col/col.sum()) 490 | index = ['Failure','Poor','Satisfactory','Good','Excellent'] 491 | relationship_index = pd.crosstab(index=data.FinalGrade, columns=data.romantic) 492 | romantic_index = relationship_index.apply(perc).reindex(index) 493 | romantic_index.plot.bar(fontsize=16, figsize=(14,8)) 494 | plt.title('Grade By Relationship Status', fontsize=20) 495 | plt.ylabel('Percentage of Students', fontsize=16) 496 | plt.xlabel('Final Grade', fontsize=16) 497 | plt.savefig('Grade_Relationshipstatus.png', bbox_inches='tight') 498 | plt.show() 499 | 500 | 501 | # In[268]: 502 | 503 | 504 | # relationship status 505 | perc = (lambda col: col/col.sum()) 506 | index = ['Failure','Poor','Satisfactory','Good','Excellent'] 507 | relationship_index = pd.crosstab(index=data.FinalGrade, columns=data.famsup) 508 | romantic_index = relationship_index.apply(perc).reindex(index) 509 | romantic_index.plot.bar(fontsize=16, figsize=(14,8)) 510 | plt.title('Grade By family support Status', fontsize=20) 511 | plt.ylabel('Percentage of Students', fontsize=16) 512 | plt.xlabel('Final Grade', fontsize=16) 513 | plt.savefig('Grade_family support.png', bbox_inches='tight') 514 | plt.show() 515 | 516 | 517 | # In[269]: 518 | 519 | 520 | # relationship status 521 | perc = (lambda col: col/col.sum()) 522 | index = ['Failure','Poor','Satisfactory','Good','Excellent'] 523 | relationship_index = pd.crosstab(index=data.FinalGrade, columns=data.age) 524 | romantic_index = relationship_index.apply(perc).reindex(index) 525 | romantic_index.plot.bar(fontsize=16, figsize=(14,8)) 526 | plt.title('Grade By age ', fontsize=20) 527 | plt.ylabel('Percentage of Students', fontsize=16) 528 | plt.xlabel('Final Grade', fontsize=16) 529 | plt.savefig('Grade_Age.png', bbox_inches='tight') 530 | plt.show() 531 | 532 | 533 | # In[270]: 534 | 535 | 536 | # Dalc - workday alcohol consumption 537 | alcohol_index = pd.crosstab(index=data.FinalGrade, columns=data.Dalc) 538 | workday_alcohol_index = alcohol_index.apply(perc).reindex(index) 539 | workday_alcohol_index.plot.bar(fontsize=16, figsize=(14,8)) 540 | plt.title('Grade By workday alcohol Consumption', fontsize=20) 541 | plt.ylabel('Percentage of Students ', fontsize=16) 542 | plt.xlabel('Final Grade', fontsize=16) 543 | plt.savefig('Grade_workday_alchol.png', bbox_inches='tight') 544 | plt.show() 545 | 546 | 547 | # In[271]: 548 | 549 | 550 | # Walc - weekday alcohol consumption 551 | alcohol_index = pd.crosstab(index=data.FinalGrade, columns=data.Walc) 552 | weekend_alcohol_index = alcohol_index.apply(perc).reindex(index) 553 | 554 | weekend_alcohol_index.plot.bar(colormap='winter',fontsize=16, figsize=(14,8)) 555 | plt.title('Grade By weekend alcohol Consumption', fontsize=20) 556 | plt.ylabel('Percentage of Students ', fontsize=16) 557 | plt.xlabel('Final Grade', fontsize=16) 558 | plt.savefig('Grade_weekend_alchol.png', bbox_inches='tight') 559 | plt.show() 560 | 561 | 562 | # In[272]: 563 | 564 | 565 | # health - current health status 566 | health_index = pd.crosstab(index=data.FinalGrade, columns=data.health) 567 | Overall_health_index = health_index.apply(perc).reindex(index) 568 | 569 | Overall_health_index.plot.bar(colormap='summer',fontsize=16, figsize=(14,8)) 570 | plt.title('Grade By Overall health', fontsize=20) 571 | plt.ylabel('Percentage of Students ', fontsize=16) 572 | plt.xlabel('Final Grade', fontsize=16) 573 | plt.savefig('Grade_overall_health.png', bbox_inches='tight') 574 | plt.show() 575 | 576 | 577 | # In[273]: 578 | 579 | 580 | # goout - going out with friends (numeric: from 1 - very low to 5 - very high) 581 | goout_index = pd.crosstab(index=data.FinalGrade, columns=data.goout) 582 | Overall_goout_index = goout_index.apply(perc).reindex(index) 583 | Overall_goout_index.plot.bar(colormap='jet',fontsize=16, figsize=(14,8)) 584 | plt.title('Grade By Going Out frequency', fontsize=20) 585 | plt.ylabel('Percentage of Students ', fontsize=16) 586 | plt.xlabel('Final Grade', fontsize=16) 587 | plt.savefig('Grade_going_out.png', bbox_inches='tight') 588 | plt.show() 589 | 590 | 591 | # In[274]: 592 | 593 | 594 | #absences - number of school absences (numeric: from 0 to 93) 595 | data.head() 596 | data['Regularity'] = 'na' 597 | data.loc[(data.absences >= 0) & (data.absences <= 9), 'Regularity'] = 'Always Regular' 598 | data.loc[(data.absences >= 10) & (data.absences <= 29), 'Regularity'] = 'Mostly Regular' 599 | data.loc[(data.absences >= 30) & (data.absences <= 49), 'Regularity'] = 'Regular' 600 | data.loc[(data.absences >= 50) & (data.absences <= 79), 'Regularity'] = 'Irregular' 601 | data.loc[(data.absences >= 80)& (data.absences <= 93), 'Regularity'] = 'Highly Irregular' 602 | data.head() 603 | 604 | 605 | # In[275]: 606 | 607 | 608 | index = ['Failure','Poor','Satisfactory','Good','Excellent'] 609 | absences = pd.crosstab(index=data.FinalGrade, columns=data.Regularity) 610 | absences = perc(absences) 611 | absences.plot.bar(fontsize=16, figsize=(14,8)) 612 | plt.title('Grade by students regularity', fontsize=20) 613 | plt.ylabel('Percentage of Students', fontsize=16) 614 | plt.xlabel('Final Grade', fontsize=16) 615 | plt.savefig('Grade_regularity.png', bbox_inches='tight') 616 | plt.show() 617 | 618 | 619 | 620 | # In[276]: 621 | 622 | 623 | # 31 G1 - first period grade (numeric: from 0 to 20) 624 | # 31 G2 - second period grade (numeric: from 0 to 20) 625 | # 32 G3 - final grade (numeric: from 0 to 20, output target) 626 | 627 | 628 | # In[277]: 629 | 630 | 631 | data['Grade1'] = 'na' 632 | data.loc[(data.G1 >= 18) & (data.G1 <= 20), 'Grade1'] = 'Excellent' 633 | data.loc[(data.G1 >= 15) & (data.G1 <= 17), 'Grade1'] = 'Good' 634 | data.loc[(data.G1 >= 11) & (data.G1 <= 14), 'Grade1'] = 'Satisfactory' 635 | data.loc[(data.G1 >= 6) & (data.G1 <= 10), 'Grade1'] = 'Poor' 636 | data.loc[(data.G1 >= 0) & (data.G1 <= 5), 'Grade1'] = 'Failure' 637 | 638 | data['Grade2'] = 'na' 639 | data.loc[(data.G2 >= 18) & (data.G2 <= 20), 'Grade2'] = 'Excellent' 640 | data.loc[(data.G2 >= 15) & (data.G2 <= 17), 'Grade2'] = 'Good' 641 | data.loc[(data.G2 >= 11) & (data.G2 <= 14), 'Grade2'] = 'Satisfactory' 642 | data.loc[(data.G2 >= 6) & (data.G2 <= 10), 'Grade2'] = 'Poor' 643 | data.loc[(data.G2 >= 0) & (data.G2 <= 5), 'Grade2'] = 'Failure' 644 | 645 | data.head(5) 646 | 647 | 648 | # In[278]: 649 | 650 | 651 | index = ['Failure','Poor','Satisfactory','Good','Excellent'] 652 | internet_index = pd.crosstab(index=data.FinalGrade, columns=data.internet) 653 | internet_index = internet_index.apply(perc).reindex(index) 654 | internet_index.plot.bar(fontsize=16, figsize=(14,8)) 655 | plt.title('Grade By internet Status', fontsize=20) 656 | plt.ylabel('Percentage of Students', fontsize=16) 657 | plt.xlabel('Final Grade', fontsize=16) 658 | plt.savefig('Grade_internet_status.png', bbox_inches='tight') 659 | 660 | plt.show() 661 | 662 | 663 | # In[279]: 664 | 665 | 666 | index = ['Failure','Poor','Satisfactory','Good','Excellent'] 667 | studytime_index = pd.crosstab(index=data.FinalGrade, columns=data.studytime) 668 | studytime_index = studytime_index.apply(perc).reindex(index) 669 | studytime_index.plot.bar(fontsize=16, figsize=(14,8)) 670 | plt.title('Grade By Study Time', fontsize=20) 671 | plt.ylabel('Percentage of Students', fontsize=16) 672 | plt.xlabel('Final Grade', fontsize=16) 673 | plt.savefig('Grade_study_time.png', bbox_inches='tight') 674 | 675 | plt.show() 676 | 677 | 678 | # In[280]: 679 | 680 | 681 | index = ['Failure','Poor','Satisfactory','Good','Excellent'] 682 | gender_index = pd.crosstab(index=data.FinalGrade, columns=data.sex) 683 | gender_index = gender_index.apply(perc).reindex(index) 684 | gender_index.plot.bar(fontsize=16, figsize=(14,8)) 685 | plt.title('Grade By gender', fontsize=20) 686 | plt.ylabel('Percentage of Students', fontsize=16) 687 | plt.xlabel('Final Grade', fontsize=16) 688 | plt.savefig('Grade_gender.png', bbox_inches='tight') 689 | 690 | plt.show() 691 | 692 | 693 | # In[281]: 694 | 695 | 696 | index = ['Failure','Poor','Satisfactory','Good','Excellent'] 697 | Location_index = pd.crosstab(index=data.FinalGrade, columns=data.address) 698 | Location_index = Location_index.apply(perc).reindex(index) 699 | Location_index.plot.bar(fontsize=16, figsize=(14,8)) 700 | plt.title('Grade By Location', fontsize=20) 701 | plt.ylabel('Percentage of Students', fontsize=16) 702 | plt.xlabel('Final Grade', fontsize=16) 703 | plt.savefig('Grade_location.png', bbox_inches='tight') 704 | 705 | plt.show() 706 | 707 | 708 | # In[282]: 709 | 710 | 711 | index = ['Failure','Poor','Satisfactory','Good','Excellent'] 712 | Mothers_index = pd.crosstab(index=data.FinalGrade, columns=data.Mjob) 713 | Mothers_index = Mothers_index.apply(perc).reindex(index) 714 | Mothers_index.plot.bar(fontsize=16, figsize=(14,8)) 715 | plt.title('Grade By Mothers Job', fontsize=20) 716 | plt.ylabel('Percentage of Students', fontsize=16) 717 | plt.xlabel('Final Grade', fontsize=16) 718 | plt.show() 719 | 720 | index = ['Failure','Poor','Satisfactory','Good','Excellent'] 721 | Fathers_index = pd.crosstab(index=data.FinalGrade, columns=data.Fjob) 722 | Fathers_index = Fathers_index.apply(perc).reindex(index) 723 | Fathers_index.plot.bar(fontsize=16, figsize=(14,8)) 724 | plt.title('Grade By Fathers Job', fontsize=20) 725 | plt.ylabel('Percentage of Students', fontsize=16) 726 | plt.xlabel('Final Grade', fontsize=16) 727 | plt.savefig('Grade_mothers_fathers_job.png', bbox_inches='tight') 728 | 729 | plt.show() 730 | 731 | 732 | # In[283]: 733 | 734 | 735 | index = ['Failure','Poor','Satisfactory','Good','Excellent'] 736 | Mothers_index = pd.crosstab(index=data.FinalGrade, columns=data.Medu) 737 | Mothers_index = Mothers_index.apply(perc).reindex(index) 738 | Mothers_index.plot.bar(fontsize=16, figsize=(14,8)) 739 | plt.title('Grade By Mothers Education', fontsize=20) 740 | plt.ylabel('Percentage of Students', fontsize=16) 741 | plt.xlabel('Final Grade', fontsize=16) 742 | plt.show() 743 | 744 | index = ['Failure','Poor','Satisfactory','Good','Excellent'] 745 | Fathers_index = pd.crosstab(index=data.FinalGrade, columns=data.Fedu) 746 | Fathers_index = Fathers_index.apply(perc).reindex(index) 747 | Fathers_index.plot.bar(fontsize=16, figsize=(14,8)) 748 | plt.title('Grade By Fathers Education', fontsize=20) 749 | plt.ylabel('Percentage of Students', fontsize=16) 750 | plt.xlabel('Final Grade', fontsize=16) 751 | plt.savefig('Grade_mothers_fathers_edu.png', bbox_inches='tight') 752 | 753 | plt.show() 754 | 755 | 756 | # In[284]: 757 | 758 | 759 | index = ['Failure','Poor','Satisfactory','Good','Excellent'] 760 | higher_index = pd.crosstab(index=data.FinalGrade, columns=data.higher) 761 | higher_index = higher_index.apply(perc).reindex(index) 762 | higher_index.plot.bar(fontsize=16, figsize=(14,8)) 763 | plt.title('Grade By higher education Status', fontsize=20) 764 | plt.ylabel('Percentage of Students', fontsize=16) 765 | plt.xlabel('Final Grade', fontsize=16) 766 | plt.savefig('Grade_mhigher_education_status.png', bbox_inches='tight') 767 | 768 | plt.show() 769 | 770 | 771 | # In[285]: 772 | 773 | 774 | index = ['Failure','Poor','Satisfactory','Good','Excellent'] 775 | status_index = pd.crosstab(index=data.FinalGrade, columns=data.Pstatus) 776 | status_index = status_index.apply(perc).reindex(index) 777 | status_index.plot.bar(fontsize=16, figsize=(14,8)) 778 | plt.title('Grade By Parental Status', fontsize=20) 779 | plt.ylabel('Percentage of Students', fontsize=16) 780 | plt.xlabel('Final Grade', fontsize=16) 781 | plt.savefig('Grade_Parental_status.png', bbox_inches='tight') 782 | 783 | plt.show() 784 | 785 | 786 | # In[286]: 787 | 788 | 789 | index = ['Failure','Poor','Satisfactory','Good','Excellent'] 790 | status_index = pd.crosstab(index=data.FinalGrade, columns=data.failures) 791 | status_index = status_index.apply(perc).reindex(index) 792 | status_index.plot.bar(fontsize=16, figsize=(14,8)) 793 | plt.title('Grade By failures', fontsize=20) 794 | plt.ylabel('Percentage of Students', fontsize=16) 795 | plt.xlabel('Final Grade', fontsize=16) 796 | plt.savefig('Grade_Failure_status.png', bbox_inches='tight') 797 | 798 | plt.show() 799 | 800 | 801 | # In[287]: 802 | 803 | 804 | index = ['Failure','Poor','Satisfactory','Good','Excellent'] 805 | status_index = pd.crosstab(index=data.FinalGrade, columns=data.freetime) 806 | status_index = status_index.apply(perc).reindex(index) 807 | status_index.plot.bar(fontsize=16, figsize=(14,8)) 808 | plt.title('Grade By freetime', fontsize=20) 809 | plt.ylabel('Percentage of Students', fontsize=16) 810 | plt.xlabel('Final Grade', fontsize=16) 811 | plt.savefig('Grade_freetime_status.png', bbox_inches='tight') 812 | 813 | plt.show() 814 | 815 | 816 | # In[288]: 817 | 818 | 819 | data.head() 820 | 821 | 822 | # In[289]: 823 | 824 | 825 | data.columns 826 | 827 | 828 | # In[290]: 829 | 830 | 831 | data.shape 832 | 833 | 834 | # In[291]: 835 | 836 | 837 | data.to_csv('../input/features.csv', index=False) 838 | 839 | 840 | # In[ ]: 841 | 842 | 843 | 844 | 845 | 846 | # In[ ]: 847 | 848 | 849 | 850 | 851 | 852 | # In[ ]: 853 | 854 | 855 | 856 | 857 | 858 | # In[ ]: 859 | 860 | 861 | 862 | 863 | 864 | # In[ ]: 865 | 866 | 867 | 868 | 869 | 870 | # In[ ]: 871 | 872 | 873 | 874 | 875 | -------------------------------------------------------------------------------- /EDA/Family_support_plot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RohithYogi/Student-Performance-Prediction/7ab64a53718481cdcbd2b917d646cea25b833082/EDA/Family_support_plot.png -------------------------------------------------------------------------------- /EDA/Going_out_plot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RohithYogi/Student-Performance-Prediction/7ab64a53718481cdcbd2b917d646cea25b833082/EDA/Going_out_plot.png -------------------------------------------------------------------------------- /EDA/Grade_Age.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RohithYogi/Student-Performance-Prediction/7ab64a53718481cdcbd2b917d646cea25b833082/EDA/Grade_Age.png -------------------------------------------------------------------------------- /EDA/Grade_Failure_status.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RohithYogi/Student-Performance-Prediction/7ab64a53718481cdcbd2b917d646cea25b833082/EDA/Grade_Failure_status.png -------------------------------------------------------------------------------- /EDA/Grade_Parental_status.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RohithYogi/Student-Performance-Prediction/7ab64a53718481cdcbd2b917d646cea25b833082/EDA/Grade_Parental_status.png -------------------------------------------------------------------------------- /EDA/Grade_Relationshipstatus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RohithYogi/Student-Performance-Prediction/7ab64a53718481cdcbd2b917d646cea25b833082/EDA/Grade_Relationshipstatus.png -------------------------------------------------------------------------------- /EDA/Grade_family support.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RohithYogi/Student-Performance-Prediction/7ab64a53718481cdcbd2b917d646cea25b833082/EDA/Grade_family support.png -------------------------------------------------------------------------------- /EDA/Grade_fathers_edu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RohithYogi/Student-Performance-Prediction/7ab64a53718481cdcbd2b917d646cea25b833082/EDA/Grade_fathers_edu.png -------------------------------------------------------------------------------- /EDA/Grade_fathers_job.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RohithYogi/Student-Performance-Prediction/7ab64a53718481cdcbd2b917d646cea25b833082/EDA/Grade_fathers_job.png -------------------------------------------------------------------------------- /EDA/Grade_freetime_status.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RohithYogi/Student-Performance-Prediction/7ab64a53718481cdcbd2b917d646cea25b833082/EDA/Grade_freetime_status.png -------------------------------------------------------------------------------- /EDA/Grade_gender.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RohithYogi/Student-Performance-Prediction/7ab64a53718481cdcbd2b917d646cea25b833082/EDA/Grade_gender.png -------------------------------------------------------------------------------- /EDA/Grade_going_out.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RohithYogi/Student-Performance-Prediction/7ab64a53718481cdcbd2b917d646cea25b833082/EDA/Grade_going_out.png -------------------------------------------------------------------------------- /EDA/Grade_internet_status.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RohithYogi/Student-Performance-Prediction/7ab64a53718481cdcbd2b917d646cea25b833082/EDA/Grade_internet_status.png -------------------------------------------------------------------------------- /EDA/Grade_location.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RohithYogi/Student-Performance-Prediction/7ab64a53718481cdcbd2b917d646cea25b833082/EDA/Grade_location.png -------------------------------------------------------------------------------- /EDA/Grade_mhigher_education_status.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RohithYogi/Student-Performance-Prediction/7ab64a53718481cdcbd2b917d646cea25b833082/EDA/Grade_mhigher_education_status.png -------------------------------------------------------------------------------- /EDA/Grade_mothers_edu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RohithYogi/Student-Performance-Prediction/7ab64a53718481cdcbd2b917d646cea25b833082/EDA/Grade_mothers_edu.png -------------------------------------------------------------------------------- /EDA/Grade_mothers_fathers_edu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RohithYogi/Student-Performance-Prediction/7ab64a53718481cdcbd2b917d646cea25b833082/EDA/Grade_mothers_fathers_edu.png -------------------------------------------------------------------------------- /EDA/Grade_mothers_fathers_job.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RohithYogi/Student-Performance-Prediction/7ab64a53718481cdcbd2b917d646cea25b833082/EDA/Grade_mothers_fathers_job.png -------------------------------------------------------------------------------- /EDA/Grade_mothers_job.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RohithYogi/Student-Performance-Prediction/7ab64a53718481cdcbd2b917d646cea25b833082/EDA/Grade_mothers_job.png -------------------------------------------------------------------------------- /EDA/Grade_overall_health.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RohithYogi/Student-Performance-Prediction/7ab64a53718481cdcbd2b917d646cea25b833082/EDA/Grade_overall_health.png -------------------------------------------------------------------------------- /EDA/Grade_regularity.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RohithYogi/Student-Performance-Prediction/7ab64a53718481cdcbd2b917d646cea25b833082/EDA/Grade_regularity.png -------------------------------------------------------------------------------- /EDA/Grade_study_time.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RohithYogi/Student-Performance-Prediction/7ab64a53718481cdcbd2b917d646cea25b833082/EDA/Grade_study_time.png -------------------------------------------------------------------------------- /EDA/Grade_weekend_alchol.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RohithYogi/Student-Performance-Prediction/7ab64a53718481cdcbd2b917d646cea25b833082/EDA/Grade_weekend_alchol.png -------------------------------------------------------------------------------- /EDA/Grade_workday_alchol.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RohithYogi/Student-Performance-Prediction/7ab64a53718481cdcbd2b917d646cea25b833082/EDA/Grade_workday_alchol.png -------------------------------------------------------------------------------- /EDA/Guardian_plot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RohithYogi/Student-Performance-Prediction/7ab64a53718481cdcbd2b917d646cea25b833082/EDA/Guardian_plot.png -------------------------------------------------------------------------------- /EDA/Parent_Education_plot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RohithYogi/Student-Performance-Prediction/7ab64a53718481cdcbd2b917d646cea25b833082/EDA/Parent_Education_plot.png -------------------------------------------------------------------------------- /EDA/Parent_Job_plot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RohithYogi/Student-Performance-Prediction/7ab64a53718481cdcbd2b917d646cea25b833082/EDA/Parent_Job_plot.png -------------------------------------------------------------------------------- /EDA/Pstatus_plot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RohithYogi/Student-Performance-Prediction/7ab64a53718481cdcbd2b917d646cea25b833082/EDA/Pstatus_plot.png -------------------------------------------------------------------------------- /EDA/Reason_plot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RohithYogi/Student-Performance-Prediction/7ab64a53718481cdcbd2b917d646cea25b833082/EDA/Reason_plot.png -------------------------------------------------------------------------------- /EDA/Study_time_plot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RohithYogi/Student-Performance-Prediction/7ab64a53718481cdcbd2b917d646cea25b833082/EDA/Study_time_plot.png -------------------------------------------------------------------------------- /EDA/address_plot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RohithYogi/Student-Performance-Prediction/7ab64a53718481cdcbd2b917d646cea25b833082/EDA/address_plot.png -------------------------------------------------------------------------------- /EDA/age_plot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RohithYogi/Student-Performance-Prediction/7ab64a53718481cdcbd2b917d646cea25b833082/EDA/age_plot.png -------------------------------------------------------------------------------- /EDA/alcohol_consumption_plot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RohithYogi/Student-Performance-Prediction/7ab64a53718481cdcbd2b917d646cea25b833082/EDA/alcohol_consumption_plot.png -------------------------------------------------------------------------------- /EDA/attend_nursery_plot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RohithYogi/Student-Performance-Prediction/7ab64a53718481cdcbd2b917d646cea25b833082/EDA/attend_nursery_plot.png -------------------------------------------------------------------------------- /EDA/extracurricular_plot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RohithYogi/Student-Performance-Prediction/7ab64a53718481cdcbd2b917d646cea25b833082/EDA/extracurricular_plot.png -------------------------------------------------------------------------------- /EDA/failures_plot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RohithYogi/Student-Performance-Prediction/7ab64a53718481cdcbd2b917d646cea25b833082/EDA/failures_plot.png -------------------------------------------------------------------------------- /EDA/fam_relationship_plot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RohithYogi/Student-Performance-Prediction/7ab64a53718481cdcbd2b917d646cea25b833082/EDA/fam_relationship_plot.png -------------------------------------------------------------------------------- /EDA/family_plot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RohithYogi/Student-Performance-Prediction/7ab64a53718481cdcbd2b917d646cea25b833082/EDA/family_plot.png -------------------------------------------------------------------------------- /EDA/free_time_plot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RohithYogi/Student-Performance-Prediction/7ab64a53718481cdcbd2b917d646cea25b833082/EDA/free_time_plot.png -------------------------------------------------------------------------------- /EDA/gender.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RohithYogi/Student-Performance-Prediction/7ab64a53718481cdcbd2b917d646cea25b833082/EDA/gender.png -------------------------------------------------------------------------------- /EDA/higher_education_plot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RohithYogi/Student-Performance-Prediction/7ab64a53718481cdcbd2b917d646cea25b833082/EDA/higher_education_plot.png -------------------------------------------------------------------------------- /EDA/internet_plot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RohithYogi/Student-Performance-Prediction/7ab64a53718481cdcbd2b917d646cea25b833082/EDA/internet_plot.png -------------------------------------------------------------------------------- /EDA/paid_claases_plot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RohithYogi/Student-Performance-Prediction/7ab64a53718481cdcbd2b917d646cea25b833082/EDA/paid_claases_plot.png -------------------------------------------------------------------------------- /EDA/rom_relationship_plot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RohithYogi/Student-Performance-Prediction/7ab64a53718481cdcbd2b917d646cea25b833082/EDA/rom_relationship_plot.png -------------------------------------------------------------------------------- /EDA/school.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RohithYogi/Student-Performance-Prediction/7ab64a53718481cdcbd2b917d646cea25b833082/EDA/school.png -------------------------------------------------------------------------------- /EDA/school_support_plot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RohithYogi/Student-Performance-Prediction/7ab64a53718481cdcbd2b917d646cea25b833082/EDA/school_support_plot.png -------------------------------------------------------------------------------- /EDA/travel_time_plot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RohithYogi/Student-Performance-Prediction/7ab64a53718481cdcbd2b917d646cea25b833082/EDA/travel_time_plot.png -------------------------------------------------------------------------------- /Evaluation.txt: -------------------------------------------------------------------------------- 1 | F-measure; 2 | Confusion matrix; 3 | True/False Positives (TP) and (FP); 4 | True/False Negatives (TN) and (FN); 5 | Precision; 6 | Accuracy; 7 | Specificity; 8 | Sensitivity; 9 | ROC; 10 | Recall score; 11 | Classification Report; -------------------------------------------------------------------------------- /Family_support_plot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RohithYogi/Student-Performance-Prediction/7ab64a53718481cdcbd2b917d646cea25b833082/Family_support_plot.png -------------------------------------------------------------------------------- /Feature_Engineering.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RohithYogi/Student-Performance-Prediction/7ab64a53718481cdcbd2b917d646cea25b833082/Feature_Engineering.png -------------------------------------------------------------------------------- /Going_out_plot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RohithYogi/Student-Performance-Prediction/7ab64a53718481cdcbd2b917d646cea25b833082/Going_out_plot.png -------------------------------------------------------------------------------- /Grade_Parental_status.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RohithYogi/Student-Performance-Prediction/7ab64a53718481cdcbd2b917d646cea25b833082/Grade_Parental_status.png -------------------------------------------------------------------------------- /Grade_Relationshipstatus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RohithYogi/Student-Performance-Prediction/7ab64a53718481cdcbd2b917d646cea25b833082/Grade_Relationshipstatus.png -------------------------------------------------------------------------------- /Grade_fathers_edu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RohithYogi/Student-Performance-Prediction/7ab64a53718481cdcbd2b917d646cea25b833082/Grade_fathers_edu.png -------------------------------------------------------------------------------- /Grade_fathers_job.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RohithYogi/Student-Performance-Prediction/7ab64a53718481cdcbd2b917d646cea25b833082/Grade_fathers_job.png -------------------------------------------------------------------------------- /Grade_gender.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RohithYogi/Student-Performance-Prediction/7ab64a53718481cdcbd2b917d646cea25b833082/Grade_gender.png -------------------------------------------------------------------------------- /Grade_going_out.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RohithYogi/Student-Performance-Prediction/7ab64a53718481cdcbd2b917d646cea25b833082/Grade_going_out.png -------------------------------------------------------------------------------- /Grade_internet_status.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RohithYogi/Student-Performance-Prediction/7ab64a53718481cdcbd2b917d646cea25b833082/Grade_internet_status.png -------------------------------------------------------------------------------- /Grade_location.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RohithYogi/Student-Performance-Prediction/7ab64a53718481cdcbd2b917d646cea25b833082/Grade_location.png -------------------------------------------------------------------------------- /Grade_mhigher_education_status.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RohithYogi/Student-Performance-Prediction/7ab64a53718481cdcbd2b917d646cea25b833082/Grade_mhigher_education_status.png -------------------------------------------------------------------------------- /Grade_mothers_edu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RohithYogi/Student-Performance-Prediction/7ab64a53718481cdcbd2b917d646cea25b833082/Grade_mothers_edu.png -------------------------------------------------------------------------------- /Grade_mothers_job.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RohithYogi/Student-Performance-Prediction/7ab64a53718481cdcbd2b917d646cea25b833082/Grade_mothers_job.png -------------------------------------------------------------------------------- /Grade_overall_health.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RohithYogi/Student-Performance-Prediction/7ab64a53718481cdcbd2b917d646cea25b833082/Grade_overall_health.png -------------------------------------------------------------------------------- /Grade_regularity.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RohithYogi/Student-Performance-Prediction/7ab64a53718481cdcbd2b917d646cea25b833082/Grade_regularity.png -------------------------------------------------------------------------------- /Grade_study_time.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RohithYogi/Student-Performance-Prediction/7ab64a53718481cdcbd2b917d646cea25b833082/Grade_study_time.png -------------------------------------------------------------------------------- /Grade_weekend_alchol.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RohithYogi/Student-Performance-Prediction/7ab64a53718481cdcbd2b917d646cea25b833082/Grade_weekend_alchol.png -------------------------------------------------------------------------------- /Grade_workday_alchol.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RohithYogi/Student-Performance-Prediction/7ab64a53718481cdcbd2b917d646cea25b833082/Grade_workday_alchol.png -------------------------------------------------------------------------------- /Guardian_plot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RohithYogi/Student-Performance-Prediction/7ab64a53718481cdcbd2b917d646cea25b833082/Guardian_plot.png -------------------------------------------------------------------------------- /ML PROJECT REPORT (2).pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RohithYogi/Student-Performance-Prediction/7ab64a53718481cdcbd2b917d646cea25b833082/ML PROJECT REPORT (2).pdf -------------------------------------------------------------------------------- /Model.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "code", 5 | "execution_count": 1, 6 | "metadata": {}, 7 | "outputs": [], 8 | "source": [ 9 | "import numpy as np\n", 10 | "import pandas as pd\n", 11 | "import sklearn\n", 12 | "from sklearn import preprocessing\n", 13 | "from matplotlib import pyplot as plt\n", 14 | "from sklearn.model_selection import train_test_split\n", 15 | "from sklearn.linear_model import LogisticRegression\n", 16 | "from sklearn.metrics import mean_squared_error\n", 17 | "from sklearn.metrics import log_loss,roc_auc_score,accuracy_score,confusion_matrix\n", 18 | "import seaborn as sns \n", 19 | "from sklearn.ensemble import RandomForestClassifier\n", 20 | "from sklearn.svm import SVC\n", 21 | "from sklearn.tree import DecisionTreeClassifier\n", 22 | "from sklearn.ensemble import AdaBoostClassifier\n", 23 | "from itertools import cycle\n", 24 | "from sklearn import svm, datasets\n", 25 | "from sklearn.metrics import roc_curve, auc\n", 26 | "from sklearn.preprocessing import label_binarize\n", 27 | "from sklearn.multiclass import OneVsRestClassifier\n", 28 | "from scipy import interp" 29 | ] 30 | }, 31 | { 32 | "cell_type": "code", 33 | "execution_count": null, 34 | "metadata": {}, 35 | "outputs": [], 36 | "source": [] 37 | } 38 | ], 39 | "metadata": { 40 | "kernelspec": { 41 | "display_name": "Python 3", 42 | "language": "python", 43 | "name": "python3" 44 | }, 45 | "language_info": { 46 | "codemirror_mode": { 47 | "name": "ipython", 48 | "version": 3 49 | }, 50 | "file_extension": ".py", 51 | "mimetype": "text/x-python", 52 | "name": "python", 53 | "nbconvert_exporter": "python", 54 | "pygments_lexer": "ipython3", 55 | "version": "3.6.6" 56 | } 57 | }, 58 | "nbformat": 4, 59 | "nbformat_minor": 2 60 | } 61 | -------------------------------------------------------------------------------- /Model_prediction.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # coding: utf-8 3 | 4 | # # Student Performance Analysis Model 5 | 6 | # # Attributes 7 | # 8 | # 1 school - student's school (binary: 'GP' - Gabriel Pereira or 'MS' - Mousinho da Silveira) 9 | # 10 | # 2 sex - student's sex (binary: 'F' - female or 'M' - male) 11 | # 12 | # 3 age - student's age (numeric: from 15 to 22) 13 | # 14 | # 4 address - student's home address type (binary: 'U' - urban or 'R' - rural) 15 | # 16 | # 5 famsize - family size (binary: 'LE3' - less or equal to 3 or 'GT3' - greater than 3) 17 | # 18 | # 6 Pstatus - parent's cohabitation status (binary: 'T' - living together or 'A' - apart) 19 | # 20 | # 7 Medu - mother's education (numeric: 0 - none, 1 - primary education (4th grade), 2 – 5th to 9th grade, 3 – secondary education or 4 – higher education) 21 | # 22 | # 8 Fedu - father's education (numeric: 0 - none, 1 - primary education (4th grade), 2 – 5th to 9th grade, 3 – secondary education or 4 – higher education) 23 | # 24 | # 9 Mjob - mother's job (nominal: 'teacher', 'health' care related, civil 'services' (e.g. administrative or police), 'at_home' or 'other') 25 | # 26 | # 10 Fjob - father's job (nominal: 'teacher', 'health' care related, civil 'services' (e.g. administrative or police), 'at_home' or 'other') 27 | # 28 | # 11 reason - reason to choose this school (nominal: close to 'home', school 'reputation', 'course' preference or 'other') 29 | # 12 guardian - student's guardian (nominal: 'mother', 'father' or 'other') 30 | # 31 | # 13 traveltime - home to school travel time (numeric: 1 - <15 min., 2 - 15 to 30 min., 3 - 30 min. to 1 hour, or 4 - >1 hour) 32 | # 33 | # 14 studytime - weekly study time (numeric: 1 - <2 hours, 2 - 2 to 5 hours, 3 - 5 to 10 hours, or 4 - >10 hours) 34 | # 35 | # 15 failures - number of past class failures (numeric: n if 1<=n<3, else 4) 36 | # 37 | # 16 schoolsup - extra educational support (binary: yes or no) 38 | # 39 | # 17 famsup - family educational support (binary: yes or no) 40 | # 41 | # 18 paid - extra paid classes within the course subject (Math or Portuguese) (binary: yes or no) 42 | # 43 | # 19 activities - extra-curricular activities (binary: yes or no) 44 | # 45 | # 20 nursery - attended nursery school (binary: yes or no) 46 | # 47 | # 21 higher - wants to take higher education (binary: yes or no) 48 | # 49 | # 22 internet - Internet access at home (binary: yes or no) 50 | # 51 | # 23 romantic - with a romantic relationship (binary: yes or no) 52 | # 53 | # 24 famrel - quality of family relationships (numeric: from 1 - very bad to 5 - excellent) 54 | # 55 | # 25 freetime - free time after school (numeric: from 1 - very low to 5 - very high) 56 | # 57 | # 26 goout - going out with friends (numeric: from 1 - very low to 5 - very high) 58 | # 59 | # 27 Dalc - workday alcohol consumption (numeric: from 1 - very low to 5 - very high) 60 | # 61 | # 28 Walc - weekend alcohol consumption (numeric: from 1 - very low to 5 - very high) 62 | # 63 | # 29 health - current health status (numeric: from 1 - very bad to 5 - very good) 64 | # 65 | # 30 absences - number of school absences (numeric: from 0 to 93) 66 | # 67 | # 68 | # # Grades 69 | # 70 | # 31 G1 - first period grade (numeric: from 0 to 20) 71 | # 72 | # 31 G2 - second period grade (numeric: from 0 to 20) 73 | # 74 | # 32 G3 - final grade (numeric: from 0 to 20, output target) 75 | # 76 | 77 | # In[291]: 78 | 79 | 80 | import numpy as np 81 | import pandas as pd 82 | from matplotlib import pyplot as plt 83 | import seaborn as sns 84 | import sklearn 85 | from sklearn import preprocessing 86 | from sklearn.model_selection import train_test_split 87 | from sklearn.linear_model import LogisticRegression 88 | from sklearn.metrics import mean_squared_error 89 | from sklearn.metrics import log_loss,roc_auc_score,accuracy_score,confusion_matrix 90 | from sklearn.ensemble import RandomForestClassifier 91 | from sklearn.model_selection import KFold 92 | from sklearn.model_selection import cross_val_score 93 | from sklearn.svm import SVC 94 | from sklearn.tree import DecisionTreeClassifier 95 | from sklearn.ensemble import AdaBoostClassifier 96 | from sklearn import svm, datasets 97 | from sklearn.metrics import roc_curve, auc 98 | from sklearn.preprocessing import label_binarize 99 | from sklearn.multiclass import OneVsRestClassifier 100 | from scipy import interp 101 | from sklearn.metrics import f1_score, recall_score, classification_report 102 | from sklearn.metrics import fbeta_score 103 | from sklearn.datasets import make_classification 104 | from sklearn.ensemble import ExtraTreesClassifier 105 | from xgboost import XGBClassifier 106 | from xgboost import plot_importance 107 | from itertools import cycle 108 | import pickle 109 | 110 | 111 | # In[292]: 112 | 113 | 114 | train1 = pd.read_csv('input/features.csv') 115 | train1.head() 116 | 117 | 118 | # # Correlation Plot 119 | 120 | # In[293]: 121 | 122 | 123 | def correlation(df): 124 | corr = df.corr() 125 | fig, ax = plt.subplots(figsize=(20, 15)) 126 | colormap = sns.diverging_palette(220, 10, as_cmap=True) 127 | sns.heatmap(corr, cmap=colormap, annot=True, fmt=".2f") 128 | plt.xticks(range(len(corr.columns)), corr.columns); 129 | plt.yticks(range(len(corr.columns)), corr.columns) 130 | plt.savefig('Correlation.png', bbox_inches='tight') 131 | plt.show() 132 | 133 | 134 | # In[294]: 135 | 136 | 137 | correlation(train1) 138 | 139 | 140 | # In[295]: 141 | 142 | 143 | from pandas.plotting import scatter_matrix 144 | grades = train1[['G1','G2','G3']] 145 | scatter_matrix(grades) 146 | plt.savefig('grades.png', bbox_inches='tight') 147 | plt.show() 148 | 149 | 150 | # # One Hot Encoding on Final Grade 151 | 152 | # In[296]: 153 | 154 | 155 | le=preprocessing.LabelEncoder() 156 | 157 | 158 | # In[297]: 159 | 160 | 161 | le.fit(train1['FinalGrade']) 162 | train1['FinalGrade']=le.transform(train1['FinalGrade']) 163 | y=train1['FinalGrade'] 164 | # train1 = train1.drop(labels=['Regularity','Grade1','Grade2'],axis=1) 165 | 166 | 167 | # In[298]: 168 | 169 | 170 | train1 = pd.get_dummies(train1) 171 | 172 | 173 | # In[299]: 174 | 175 | 176 | train1.head(10) 177 | 178 | 179 | # # Feature Drop 180 | 181 | # In[300]: 182 | 183 | 184 | # y=train1.FinalGrade 185 | train1 = train1.drop(labels=['G3','FinalGrade','Fjob_at_home','Fjob_teacher','Pstatus_A','Pstatus_T'],axis=1) 186 | train1.head() 187 | 188 | 189 | # # SPLIT DATA 190 | 191 | # In[301]: 192 | 193 | 194 | x_train,x_val,y_train,y_val = train_test_split(train1,y,random_state=0) 195 | print(x_train.shape) 196 | print(y_train.shape) 197 | print(x_val.shape) 198 | print(y_val.shape) 199 | 200 | 201 | # # Confusion Matrix 202 | 203 | # In[302]: 204 | 205 | 206 | def confusionmatrix(y_val,y_pred): 207 | labels = list(range(0,5)) 208 | cm=confusion_matrix(y_val,y_pred) 209 | a4_dims = (11.7, 8.27) 210 | fig, ax = plt.subplots(figsize=a4_dims) 211 | ax= plt.subplot() 212 | sns.heatmap(cm, annot=True, ax = ax); #annot=True to annotate cells 213 | # labels, title and ticks 214 | ax.set_xlabel('Predicted labels'); 215 | ax.set_ylabel('True labels'); 216 | ax.set_title('Confusion Matrix'); 217 | ax.xaxis.set_ticklabels(labels); 218 | ax.yaxis.set_ticklabels(labels); 219 | plt.savefig('confusion_matrix.png', bbox_inches='tight') 220 | 221 | FP = cm.sum(axis=0) - np.diag(cm) 222 | FN = cm.sum(axis=1) - np.diag(cm) 223 | TP = np.diag(cm) 224 | TN = cm.sum() - (FP + FN + TP) 225 | 226 | total = lambda x : x.sum()/5 227 | # Sensitivity, hit rate, recall, or true positive rate 228 | TPR = TP/(TP+FN) 229 | print('percentage of sensitivity = '+str(total(TPR)*100)) 230 | 231 | # Specificity or true negative rate 232 | TNR = TN/(TN+FP) 233 | 234 | # Precision or positive predictive value 235 | PPV = TP/(TP+FP) 236 | print('percentage of precision = '+str(total(PPV)*100)) 237 | # Negative predictive value 238 | NPV = TN/(TN+FN) 239 | 240 | # Fall out or false positive rate 241 | FPR = FP/(FP+TN) 242 | 243 | # False negative rate 244 | FNR = FN/(TP+FN) 245 | 246 | # False discovery rate 247 | FDR = FP/(TP+FP) 248 | 249 | # Overall accuracy 250 | ACC = (TP+TN)/(TP+FP+FN+TN) 251 | print('Accuracy percentage = '+str(total(ACC)*100)) 252 | 253 | 254 | # # ROC plot 255 | 256 | # In[303]: 257 | 258 | 259 | def ROC_plot(x_train,x_val,model): 260 | train = pd.read_csv('features.csv') 261 | train.head() 262 | y=train[['FinalGrade']] 263 | train = train.drop(['G3'],axis=1); 264 | train = train.drop(['FinalGrade'],axis=1); 265 | train = train.drop(['G2'],axis=1); 266 | train = train.drop(['G1'],axis=1); 267 | y = label_binarize(y, classes=['Failure','Poor','Satisfactory','Good','Excellent']) 268 | n_classes = y.shape[1] 269 | 270 | X_train, X_test, y_train, y_test = train_test_split(train,y,random_state=0) 271 | 272 | classifier = OneVsRestClassifier(model) 273 | y_score = classifier.fit(x_train, y_train).decision_function(x_val) 274 | y_score.shape 275 | 276 | fpr = dict() 277 | tpr = dict() 278 | roc_auc = dict() 279 | for i in range(n_classes): 280 | fpr[i], tpr[i], _ = roc_curve(y_test[:,i], y_score[:,i]) 281 | roc_auc[i] = auc(fpr[i], tpr[i]) 282 | 283 | # Compute micro-average ROC curve and ROC area 284 | fpr["micro"], tpr["micro"], _ = roc_curve(y_test.ravel(), y_score.ravel()) 285 | roc_auc["micro"] = auc(fpr["micro"], tpr["micro"]) 286 | 287 | 288 | # Individual ROC 289 | plt.figure() 290 | lw = 2 291 | for i in (0,1): 292 | plt.subplot(1,2,i+1) 293 | plt.plot(fpr[i], tpr[i], color='darkorange', 294 | lw=lw, label='ROC curve (area = %0.2f)' % roc_auc[i]) 295 | plt.plot([0, 1], [0, 1], color='navy', lw=lw, linestyle='--') 296 | plt.xlim([0.0, 1.0]) 297 | plt.ylim([0.0, 1.05]) 298 | plt.xlabel('False Positive Rate') 299 | plt.ylabel('True Positive Rate') 300 | plt.title('Receiver operating characteristic label'+str(i)) 301 | plt.legend(loc="lower right") 302 | plt.savefig('ROC1.png', bbox_inches='tight') 303 | plt.plot() 304 | 305 | plt.figure() 306 | lw = 2 307 | for i in (2,3): 308 | plt.subplot(1,2,i-1) 309 | plt.plot(fpr[i], tpr[i], color='red', 310 | lw=lw, label='ROC curve (area = %0.2f)' % roc_auc[i]) 311 | plt.plot([0, 1], [0, 1], color='navy', lw=lw, linestyle='--') 312 | plt.xlim([0.0, 1.0]) 313 | plt.ylim([0.0, 1.05]) 314 | plt.xlabel('False Positive Rate') 315 | plt.ylabel('True Positive Rate') 316 | plt.title('Receiver operating characteristic label'+str(i)) 317 | plt.legend(loc="lower right") 318 | plt.savefig('ROC2.png', bbox_inches='tight') 319 | plt.plot() 320 | 321 | plt.figure() 322 | lw = 2 323 | plt.subplot(1,2,1) 324 | plt.plot(fpr[4], tpr[4], color='grey', 325 | lw=lw, label='ROC curve (area = %0.2f)' % roc_auc[4]) 326 | plt.plot([0, 1], [0, 1], color='navy', lw=lw, linestyle='--') 327 | plt.xlim([0.0, 1.0]) 328 | plt.ylim([0.0, 1.05]) 329 | plt.xlabel('False Positive Rate') 330 | plt.ylabel('True Positive Rate') 331 | plt.title('Receiver operating characteristic label'+str(4)) 332 | plt.legend(loc="lower right") 333 | plt.savefig('ROC3',box_inches='tight') 334 | plt.plot() 335 | 336 | 337 | # Combined ROC 338 | 339 | # Compute macro-average ROC curve and ROC area 340 | 341 | # First aggregate all false positive rates 342 | all_fpr = np.unique(np.concatenate([fpr[i] for i in range(n_classes)])) 343 | 344 | # Then interpolate all ROC curves at this points 345 | mean_tpr = np.zeros_like(all_fpr) 346 | for i in range(n_classes): 347 | mean_tpr += interp(all_fpr, fpr[i], tpr[i]) 348 | 349 | # Finally average it and compute AUC 350 | mean_tpr /= n_classes 351 | 352 | fpr["macro"] = all_fpr 353 | tpr["macro"] = mean_tpr 354 | roc_auc["macro"] = auc(fpr["macro"], tpr["macro"]) 355 | 356 | # Plot all ROC curves 357 | plt.figure() 358 | plt.plot(fpr["micro"], tpr["micro"], 359 | label='micro-average ROC curve (area = {0:0.2f})' 360 | ''.format(roc_auc["micro"]), 361 | color='deeppink', linestyle=':', linewidth=4) 362 | 363 | plt.plot(fpr["macro"], tpr["macro"], 364 | label='macro-average ROC curve (area = {0:0.2f})' 365 | ''.format(roc_auc["macro"]), 366 | color='navy', linestyle=':', linewidth=4) 367 | 368 | for i in range(n_classes): 369 | plt.plot(fpr[i], tpr[i], lw=2, 370 | label='ROC curve of class {0} (area = {1:0.2f})' 371 | ''.format(i, roc_auc[i])) 372 | print('Area Under the Curve with label '+str(i)+' is '+str(roc_auc[i])) 373 | plt.savefig('ROC4', bbox_inches='tight') 374 | plt.plot([0, 1], [0, 1], 'k--', lw=2) 375 | plt.xlim([0.0, 1.0]) 376 | plt.ylim([0.0, 1.05]) 377 | plt.xlabel('False Positive Rate') 378 | plt.ylabel('True Positive Rate') 379 | plt.title('Some extension of Receiver operating characteristic to multi-class') 380 | plt.legend(loc="lower right") 381 | plt.rcParams["figure.figsize"] = (10,6) 382 | 383 | 384 | # # Fscore 385 | 386 | # In[304]: 387 | 388 | 389 | def Fscore(y_val,y_pred): 390 | print('f score = ' + str(f1_score(y_val, y_pred, average="macro"))) 391 | 392 | 393 | # # Recall 394 | 395 | # In[305]: 396 | 397 | 398 | def recall(y_val,y_pred): 399 | print('percentage of recall score = '+str(recall_score(y_val, y_pred, average="macro"))) 400 | 401 | 402 | # # Classification Report 403 | 404 | # In[306]: 405 | 406 | 407 | def report(y_val,y_pred): 408 | target_names = ['Failure','Poor','Satisfactory','Good','Excellent'] 409 | print('Classification Report') 410 | print(classification_report(y_val, y_pred, target_names=target_names)) 411 | 412 | 413 | # # F Beta score 414 | 415 | # In[307]: 416 | 417 | 418 | def fbeta(y_val,y_pred): 419 | print('Fbeta score = ' + str(fbeta_score(y_val,y_pred,average='macro', beta=0.5))) 420 | 421 | 422 | # # LOGISTIC REGRESSION 423 | 424 | # In[308]: 425 | 426 | 427 | def logistic_regression_model(x_train,y_train,x_val,y_val): 428 | lr = LogisticRegression() 429 | lr.fit(x_train,y_train) 430 | y_pred = lr.predict(x_val) 431 | y_predict = lr.predict_proba(x_val) 432 | print("Log_Loss: ",log_loss(y_val,y_predict)) 433 | print("Accuracy_Score: ",accuracy_score(y_val,y_pred)) 434 | confusionmatrix(y_val,y_pred) 435 | Fscore(y_val,y_pred) 436 | recall(y_val,y_pred) 437 | report(y_val,y_pred) 438 | fbeta(y_val,y_pred) 439 | return lr 440 | 441 | 442 | # In[309]: 443 | 444 | 445 | model =logistic_regression_model(x_train,y_train,x_val,y_val) 446 | ROC_plot(x_train,x_val,model) 447 | 448 | 449 | # In[310]: 450 | 451 | 452 | filename = 'pickle/model_lr.pkl' 453 | outfile = open(filename,'wb') 454 | pickle.dump(model,outfile) 455 | outfile.close() 456 | 457 | 458 | # # RANDOM FOREST 459 | 460 | # In[311]: 461 | 462 | 463 | def random_forest_model(x_train,y_train,x_val,y_val): 464 | random_forest = RandomForestClassifier(n_estimators=28,max_depth=5,random_state=0) 465 | 466 | forest = random_forest.fit(x_train, y_train) 467 | print("Random Forest Train data Score" , ":" , forest.score(x_train, y_train) 468 | , "," ,"Validation data Score" ,":" , forest.score(x_val, y_val)) 469 | Y_pred = random_forest.predict_proba(x_val) 470 | Y_pred1 = random_forest.predict(x_val) 471 | print("Log_Loss: ",log_loss(y_val,Y_pred)) 472 | confusionmatrix(y_val,Y_pred1) 473 | Fscore(y_val,Y_pred1) 474 | recall(y_val,Y_pred1) 475 | report(y_val,Y_pred1) 476 | fbeta(y_val,Y_pred1) 477 | return forest 478 | 479 | 480 | # In[312]: 481 | 482 | 483 | model = random_forest_model(x_train,y_train,x_val,y_val) 484 | 485 | 486 | # In[313]: 487 | 488 | 489 | filename = 'pickle/model_rf.pkl' 490 | outfile = open(filename,'wb') 491 | pickle.dump(model,outfile) 492 | outfile.close() 493 | 494 | 495 | # # SVM 496 | 497 | # In[314]: 498 | 499 | 500 | def SVM_Model(X_train,Y_train,X_test,y_val): 501 | svc = SVC() 502 | svc.fit(X_train, Y_train) 503 | Y_pred = svc.predict(X_test) 504 | print("SVM Train data Score" , ":" , svc.score(X_train, y_train) 505 | , "," ,"Validation data Score" ,":" , svc.score(X_test, y_val)) 506 | confusionmatrix(y_val,Y_pred) 507 | Fscore(y_val,Y_pred) 508 | recall(y_val,Y_pred) 509 | report(y_val,Y_pred) 510 | fbeta(y_val,Y_pred) 511 | return svc 512 | 513 | 514 | # In[315]: 515 | 516 | 517 | model = SVM_Model(x_train,y_train,x_val,y_val) 518 | ROC_plot(x_train,x_val,model) 519 | 520 | 521 | # In[316]: 522 | 523 | 524 | filename = 'pickle/model_svm.pkl' 525 | outfile = open(filename,'wb') 526 | pickle.dump(model,outfile) 527 | outfile.close() 528 | 529 | 530 | # # DECISION TREE 531 | 532 | # In[317]: 533 | 534 | 535 | def Decison_tree_Model(x_train,y_train,x_val,y_val): 536 | tree = DecisionTreeClassifier(min_samples_leaf=9,random_state=0) 537 | tf= tree.fit(x_train, y_train) 538 | y_pred = tf.predict(x_val) 539 | y_predict = tf.predict_proba(x_val) 540 | print("Decisioin Tree Train data Score" , ":" , tf.score(x_train, y_train) 541 | , "," , "Validation data Score" ,":" , tf.score(x_val, y_val)) 542 | confusionmatrix(y_val,y_pred) 543 | print("Log_Loss: ",log_loss(y_val,y_predict)) 544 | Fscore(y_val,y_pred) 545 | recall(y_val,y_pred) 546 | report(y_val,y_pred) 547 | fbeta(y_val,y_pred) 548 | return tree 549 | 550 | 551 | # In[318]: 552 | 553 | 554 | model = Decison_tree_Model(x_train,y_train,x_val,y_val) 555 | 556 | 557 | # In[319]: 558 | 559 | 560 | filename = 'pickle/model_dt.pkl' 561 | outfile = open(filename,'wb') 562 | pickle.dump(model,outfile) 563 | outfile.close() 564 | 565 | 566 | # # ADA BOOST 567 | 568 | # In[320]: 569 | 570 | 571 | def ada_boost_model(x_train,y_train,x_val,y_val): 572 | ada = AdaBoostClassifier(n_estimators=2) 573 | af = ada.fit(x_train, y_train) 574 | y_pred = af.predict(x_val) 575 | y_predict = af.predict_proba(x_val) 576 | print("Ada Boost Train data Score" , ":" , af.score(x_train, y_train) 577 | , "," ,"Validation data Score" ,":" , af.score(x_val, y_val)) 578 | print("Log_Loss: ",log_loss(y_val,y_predict)) 579 | confusionmatrix(y_val,y_pred) 580 | Fscore(y_val,y_pred) 581 | recall(y_val,y_pred) 582 | report(y_val,y_pred) 583 | fbeta(y_val,y_pred) 584 | return ada 585 | 586 | 587 | # In[321]: 588 | 589 | 590 | model = ada_boost_model(x_train,y_train,x_val,y_val) 591 | ROC_plot(x_train,x_val,model) 592 | 593 | 594 | # In[322]: 595 | 596 | 597 | filename = 'pickle/model_ada.pkl' 598 | outfile = open(filename,'wb') 599 | pickle.dump(model,outfile) 600 | outfile.close() 601 | 602 | 603 | # # XGBOOST 604 | 605 | # In[323]: 606 | 607 | 608 | def XGBoost(x_train,y_train,x_val,y_val): 609 | model = XGBClassifier() 610 | model = XGBClassifier(learning_rate=0.1,n_estimators=80) 611 | mf = model.fit(x_train,y_train) 612 | y_pred=model.predict(x_val) 613 | y_predict = mf.predict_proba(x_val) 614 | print("XGBoost Train data Score" , ":" , mf.score(x_train, y_train) 615 | , "," ,"Validation data Score" ,":" , mf.score(x_val, y_val)) 616 | print("Log_Loss: ",log_loss(y_val,y_predict)) 617 | confusionmatrix(y_val,y_pred) 618 | Fscore(y_val,y_pred) 619 | recall(y_val,y_pred) 620 | report(y_val,y_pred) 621 | fbeta(y_val,y_pred) 622 | 623 | 624 | # plot feature importance 625 | fig, ax = plt.subplots(figsize=(10, 20)) 626 | plot_importance(model, ax=ax) 627 | plt.savefig('Feature_Engineering.png', bbox_inches='tight') 628 | plt.show() 629 | return model 630 | 631 | 632 | 633 | 634 | # In[324]: 635 | 636 | 637 | model = XGBoost(x_train,y_train,x_val,y_val) 638 | 639 | 640 | # # K Cross Validations 641 | 642 | # In[325]: 643 | 644 | 645 | def k_cross_validations(x_train,y_train,): 646 | X = x_train 647 | y = y_train 648 | kf = KFold(n_splits=10) # Define the split - into 2 folds 649 | kf.get_n_splits(X) # returns the number of splitting iterations in the cross-validator 650 | print(kf) 651 | KFold(n_splits=10, random_state=None, shuffle=False) 652 | return kf 653 | 654 | 655 | # In[326]: 656 | 657 | 658 | kf = k_cross_validations(x_train,y_train) 659 | classifier = model 660 | cross_val_score(classifier,x_train, y_train, cv=kf, n_jobs=1) 661 | 662 | 663 | # In[327]: 664 | 665 | 666 | def FeatureImportance(): 667 | # Build a classification task using 3 informative features 668 | X, y = make_classification(n_samples=1000, 669 | n_features=10, 670 | n_informative=3, 671 | n_redundant=0, 672 | n_repeated=0, 673 | n_classes=2, 674 | random_state=0, 675 | shuffle=False) 676 | 677 | # Build a forest and compute the feature importances 678 | forest = ExtraTreesClassifier(n_estimators=250,random_state=0) 679 | 680 | forest.fit(X, y) 681 | importances = forest.feature_importances_ 682 | std = np.std([tree.feature_importances_ for tree in forest.estimators_], 683 | axis=0) 684 | indices = np.argsort(importances)[::-1] 685 | 686 | # Print the feature ranking 687 | print("Feature ranking:") 688 | 689 | for f in range(X.shape[1]): 690 | print("%d. feature %d (%f)" % (f + 1, indices[f], importances[indices[f]])) 691 | 692 | # Plot the feature importances of the forest 693 | plt.figure() 694 | plt.title("Feature importances") 695 | plt.bar(range(X.shape[1]), importances[indices], 696 | color="r", yerr=std[indices], align="center") 697 | plt.xticks(range(X.shape[1]), indices) 698 | plt.xlim([-1, X.shape[1]]) 699 | plt.show() 700 | 701 | 702 | # In[328]: 703 | 704 | 705 | FeatureImportance() 706 | 707 | 708 | # # Finally we choose XGBoost Model 709 | # 710 | # # Train data Score : 0.9386973180076629 711 | # 712 | # # Validation data Score : 0.8850574712643678 713 | 714 | # In[329]: 715 | 716 | 717 | filename = 'pickle/model_xgb.pkl' 718 | outfile = open(filename,'wb') 719 | pickle.dump(model,outfile) 720 | outfile.close() 721 | 722 | 723 | # In[ ]: 724 | 725 | 726 | 727 | 728 | -------------------------------------------------------------------------------- /PROJECT REPORT.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RohithYogi/Student-Performance-Prediction/7ab64a53718481cdcbd2b917d646cea25b833082/PROJECT REPORT.pdf -------------------------------------------------------------------------------- /Parent_Education_plot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RohithYogi/Student-Performance-Prediction/7ab64a53718481cdcbd2b917d646cea25b833082/Parent_Education_plot.png -------------------------------------------------------------------------------- /Parent_Job_plot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RohithYogi/Student-Performance-Prediction/7ab64a53718481cdcbd2b917d646cea25b833082/Parent_Job_plot.png -------------------------------------------------------------------------------- /Pstatus_plot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RohithYogi/Student-Performance-Prediction/7ab64a53718481cdcbd2b917d646cea25b833082/Pstatus_plot.png -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Student-Performance-Prediction 2 | 3 | Data Set from 4 | http://archive.ics.uci.edu/ml/datasets/Student+Performance# 5 | 6 | Data Set Information: 7 | 8 | This data approach student achievement in secondary education of two Portuguese schools. 9 | The data attributes include student grades, demographic, social and school related features) and it was collected by using school reports and questionnaires. 10 | Two datasets are provided regarding the performance in two distinct subjects: Mathematics (mat) and Portuguese language (por). In [Cortez and Silva, 2008], the two datasets were modeled under binary/five-level classification and regression tasks. 11 | Important note: the target attribute G3 has a strong correlation with attributes G2 and G1. This occurs because G3 is the final year grade (issued at the 3rd period), while G1 and G2 correspond to the 1st and 2nd period grades. It is more difficult to predict G3 without G2 and G1, but such prediction is much more useful (see paper source for more details). 12 | 13 | 14 | # Attributes 15 | 1 school - student's school (binary: 'GP' - Gabriel Pereira or 'MS' - Mousinho da Silveira) 16 | 17 | 2 sex - student's sex (binary: 'F' - female or 'M' - male) 18 | 19 | 3 age - student's age (numeric: from 15 to 22) 20 | 21 | 4 address - student's home address type (binary: 'U' - urban or 'R' - rural) 22 | 23 | 5 famsize - family size (binary: 'LE3' - less or equal to 3 or 'GT3' - greater than 3) 24 | 25 | 6 Pstatus - parent's cohabitation status (binary: 'T' - living together or 'A' - apart) 26 | 27 | 7 Medu - mother's education (numeric: 0 - none, 1 - primary education (4th grade), 2 – 5th to 9th grade, 3 – secondary education or 4 – higher education) 28 | 29 | 8 Fedu - father's education (numeric: 0 - none, 1 - primary education (4th grade), 2 – 5th to 9th grade, 3 – secondary education or 4 – higher education) 30 | 31 | 9 Mjob - mother's job (nominal: 'teacher', 'health' care related, civil 'services' (e.g. administrative or police), 'at_home' or 'other') 32 | 33 | 10 Fjob - father's job (nominal: 'teacher', 'health' care related, civil 'services' (e.g. administrative or police), 'at_home' or 'other') 34 | 35 | 11 reason - reason to choose this school (nominal: close to 'home', school 'reputation', 'course' preference or 'other') 36 | 37 | 12 guardian - student's guardian (nominal: 'mother', 'father' or 'other') 38 | 39 | 13 traveltime - home to school travel time (numeric: 1 - <15 min., 2 - 15 to 30 min., 3 - 30 min. to 1 hour, or 4 - >1 hour) 40 | 41 | 14 studytime - weekly study time (numeric: 1 - <2 hours, 2 - 2 to 5 hours, 3 - 5 to 10 hours, or 4 - >10 hours) 42 | 43 | 15 failures - number of past class failures (numeric: n if 1<=n<3, else 4) 44 | 45 | 16 schoolsup - extra educational support (binary: yes or no) 46 | 47 | 17 famsup - family educational support (binary: yes or no) 48 | 49 | 18 paid - extra paid classes within the course subject (Math or Portuguese) (binary: yes or no) 50 | 51 | 19 activities - extra-curricular activities (binary: yes or no) 52 | 53 | 20 nursery - attended nursery school (binary: yes or no) 54 | 55 | 21 higher - wants to take higher education (binary: yes or no) 56 | 57 | 22 internet - Internet access at home (binary: yes or no) 58 | 59 | 23 romantic - with a romantic relationship (binary: yes or no) 60 | 61 | 24 famrel - quality of family relationships (numeric: from 1 - very bad to 5 - excellent) 62 | 63 | 25 freetime - free time after school (numeric: from 1 - very low to 5 - very high) 64 | 65 | 26 goout - going out with friends (numeric: from 1 - very low to 5 - very high) 66 | 67 | 27 Dalc - workday alcohol consumption (numeric: from 1 - very low to 5 - very high) 68 | 69 | 28 Walc - weekend alcohol consumption (numeric: from 1 - very low to 5 - very high) 70 | 71 | 29 health - current health status (numeric: from 1 - very bad to 5 - very good) 72 | 73 | 30 absences - number of school absences (numeric: from 0 to 93) 74 | 75 | 76 | # Grades 77 | 78 | 31 G1 - first period grade (numeric: from 0 to 20) 79 | 80 | 31 G2 - second period grade (numeric: from 0 to 20) 81 | 82 | 32 G3 - final grade (numeric: from 0 to 20, output target) 83 | 84 | # Correlation Plot 85 | 86 |  87 | -------------------------------------------------------------------------------- /ROC1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RohithYogi/Student-Performance-Prediction/7ab64a53718481cdcbd2b917d646cea25b833082/ROC1.png -------------------------------------------------------------------------------- /ROC2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RohithYogi/Student-Performance-Prediction/7ab64a53718481cdcbd2b917d646cea25b833082/ROC2.png -------------------------------------------------------------------------------- /ROC3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RohithYogi/Student-Performance-Prediction/7ab64a53718481cdcbd2b917d646cea25b833082/ROC3.png -------------------------------------------------------------------------------- /ROC4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RohithYogi/Student-Performance-Prediction/7ab64a53718481cdcbd2b917d646cea25b833082/ROC4.png -------------------------------------------------------------------------------- /Reason_plot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RohithYogi/Student-Performance-Prediction/7ab64a53718481cdcbd2b917d646cea25b833082/Reason_plot.png -------------------------------------------------------------------------------- /STUDENT_GRADE.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "code", 5 | "execution_count": 29, 6 | "metadata": {}, 7 | "outputs": [], 8 | "source": [ 9 | "import numpy as np\n", 10 | "import pandas as pd\n", 11 | "import sklearn\n", 12 | "from sklearn import preprocessing" 13 | ] 14 | }, 15 | { 16 | "cell_type": "code", 17 | "execution_count": 30, 18 | "metadata": {}, 19 | "outputs": [], 20 | "source": [ 21 | "train1 = pd.read_csv('student-mat.csv')" 22 | ] 23 | }, 24 | { 25 | "cell_type": "code", 26 | "execution_count": 31, 27 | "metadata": {}, 28 | "outputs": [], 29 | "source": [ 30 | "train2 = pd.read_csv('student-por.csv')" 31 | ] 32 | }, 33 | { 34 | "cell_type": "code", 35 | "execution_count": 32, 36 | "metadata": {}, 37 | "outputs": [ 38 | { 39 | "data": { 40 | "text/html": [ 41 | "
| \n", 59 | " | school | \n", 60 | "sex | \n", 61 | "age | \n", 62 | "address | \n", 63 | "famsize | \n", 64 | "Pstatus | \n", 65 | "Medu | \n", 66 | "Fedu | \n", 67 | "Mjob | \n", 68 | "Fjob | \n", 69 | "... | \n", 70 | "famrel | \n", 71 | "freetime | \n", 72 | "goout | \n", 73 | "Dalc | \n", 74 | "Walc | \n", 75 | "health | \n", 76 | "absences | \n", 77 | "G1 | \n", 78 | "G2 | \n", 79 | "G3 | \n", 80 | "
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0 | \n", 85 | "GP | \n", 86 | "F | \n", 87 | "18 | \n", 88 | "U | \n", 89 | "GT3 | \n", 90 | "A | \n", 91 | "4 | \n", 92 | "4 | \n", 93 | "at_home | \n", 94 | "teacher | \n", 95 | "... | \n", 96 | "4 | \n", 97 | "3 | \n", 98 | "4 | \n", 99 | "1 | \n", 100 | "1 | \n", 101 | "3 | \n", 102 | "6 | \n", 103 | "5 | \n", 104 | "6 | \n", 105 | "6 | \n", 106 | "
| 1 | \n", 109 | "GP | \n", 110 | "F | \n", 111 | "17 | \n", 112 | "U | \n", 113 | "GT3 | \n", 114 | "T | \n", 115 | "1 | \n", 116 | "1 | \n", 117 | "at_home | \n", 118 | "other | \n", 119 | "... | \n", 120 | "5 | \n", 121 | "3 | \n", 122 | "3 | \n", 123 | "1 | \n", 124 | "1 | \n", 125 | "3 | \n", 126 | "4 | \n", 127 | "5 | \n", 128 | "5 | \n", 129 | "6 | \n", 130 | "
| 2 | \n", 133 | "GP | \n", 134 | "F | \n", 135 | "15 | \n", 136 | "U | \n", 137 | "LE3 | \n", 138 | "T | \n", 139 | "1 | \n", 140 | "1 | \n", 141 | "at_home | \n", 142 | "other | \n", 143 | "... | \n", 144 | "4 | \n", 145 | "3 | \n", 146 | "2 | \n", 147 | "2 | \n", 148 | "3 | \n", 149 | "3 | \n", 150 | "10 | \n", 151 | "7 | \n", 152 | "8 | \n", 153 | "10 | \n", 154 | "
| 3 | \n", 157 | "GP | \n", 158 | "F | \n", 159 | "15 | \n", 160 | "U | \n", 161 | "GT3 | \n", 162 | "T | \n", 163 | "4 | \n", 164 | "2 | \n", 165 | "health | \n", 166 | "services | \n", 167 | "... | \n", 168 | "3 | \n", 169 | "2 | \n", 170 | "2 | \n", 171 | "1 | \n", 172 | "1 | \n", 173 | "5 | \n", 174 | "2 | \n", 175 | "15 | \n", 176 | "14 | \n", 177 | "15 | \n", 178 | "
| 4 | \n", 181 | "GP | \n", 182 | "F | \n", 183 | "16 | \n", 184 | "U | \n", 185 | "GT3 | \n", 186 | "T | \n", 187 | "3 | \n", 188 | "3 | \n", 189 | "other | \n", 190 | "other | \n", 191 | "... | \n", 192 | "4 | \n", 193 | "3 | \n", 194 | "2 | \n", 195 | "1 | \n", 196 | "2 | \n", 197 | "5 | \n", 198 | "4 | \n", 199 | "6 | \n", 200 | "10 | \n", 201 | "10 | \n", 202 | "
5 rows × 33 columns
\n", 206 | "| \n", 261 | " | school | \n", 262 | "sex | \n", 263 | "age | \n", 264 | "address | \n", 265 | "famsize | \n", 266 | "Pstatus | \n", 267 | "Medu | \n", 268 | "Fedu | \n", 269 | "Mjob | \n", 270 | "Fjob | \n", 271 | "... | \n", 272 | "famrel | \n", 273 | "freetime | \n", 274 | "goout | \n", 275 | "Dalc | \n", 276 | "Walc | \n", 277 | "health | \n", 278 | "absences | \n", 279 | "G1 | \n", 280 | "G2 | \n", 281 | "G3 | \n", 282 | "
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0 | \n", 287 | "GP | \n", 288 | "F | \n", 289 | "18 | \n", 290 | "U | \n", 291 | "GT3 | \n", 292 | "A | \n", 293 | "4 | \n", 294 | "4 | \n", 295 | "at_home | \n", 296 | "teacher | \n", 297 | "... | \n", 298 | "4 | \n", 299 | "3 | \n", 300 | "4 | \n", 301 | "1 | \n", 302 | "1 | \n", 303 | "3 | \n", 304 | "4 | \n", 305 | "0 | \n", 306 | "11 | \n", 307 | "11 | \n", 308 | "
| 1 | \n", 311 | "GP | \n", 312 | "F | \n", 313 | "17 | \n", 314 | "U | \n", 315 | "GT3 | \n", 316 | "T | \n", 317 | "1 | \n", 318 | "1 | \n", 319 | "at_home | \n", 320 | "other | \n", 321 | "... | \n", 322 | "5 | \n", 323 | "3 | \n", 324 | "3 | \n", 325 | "1 | \n", 326 | "1 | \n", 327 | "3 | \n", 328 | "2 | \n", 329 | "9 | \n", 330 | "11 | \n", 331 | "11 | \n", 332 | "
| 2 | \n", 335 | "GP | \n", 336 | "F | \n", 337 | "15 | \n", 338 | "U | \n", 339 | "LE3 | \n", 340 | "T | \n", 341 | "1 | \n", 342 | "1 | \n", 343 | "at_home | \n", 344 | "other | \n", 345 | "... | \n", 346 | "4 | \n", 347 | "3 | \n", 348 | "2 | \n", 349 | "2 | \n", 350 | "3 | \n", 351 | "3 | \n", 352 | "6 | \n", 353 | "12 | \n", 354 | "13 | \n", 355 | "12 | \n", 356 | "
| 3 | \n", 359 | "GP | \n", 360 | "F | \n", 361 | "15 | \n", 362 | "U | \n", 363 | "GT3 | \n", 364 | "T | \n", 365 | "4 | \n", 366 | "2 | \n", 367 | "health | \n", 368 | "services | \n", 369 | "... | \n", 370 | "3 | \n", 371 | "2 | \n", 372 | "2 | \n", 373 | "1 | \n", 374 | "1 | \n", 375 | "5 | \n", 376 | "0 | \n", 377 | "14 | \n", 378 | "14 | \n", 379 | "14 | \n", 380 | "
| 4 | \n", 383 | "GP | \n", 384 | "F | \n", 385 | "16 | \n", 386 | "U | \n", 387 | "GT3 | \n", 388 | "T | \n", 389 | "3 | \n", 390 | "3 | \n", 391 | "other | \n", 392 | "other | \n", 393 | "... | \n", 394 | "4 | \n", 395 | "3 | \n", 396 | "2 | \n", 397 | "1 | \n", 398 | "2 | \n", 399 | "5 | \n", 400 | "0 | \n", 401 | "11 | \n", 402 | "13 | \n", 403 | "13 | \n", 404 | "
5 rows × 33 columns
\n", 408 | "| \n", 560 | " | school | \n", 561 | "sex | \n", 562 | "age | \n", 563 | "address | \n", 564 | "famsize | \n", 565 | "Pstatus | \n", 566 | "Medu | \n", 567 | "Fedu | \n", 568 | "Mjob | \n", 569 | "Fjob | \n", 570 | "... | \n", 571 | "famrel | \n", 572 | "freetime | \n", 573 | "goout | \n", 574 | "Dalc | \n", 575 | "Walc | \n", 576 | "health | \n", 577 | "absences | \n", 578 | "G1 | \n", 579 | "G2 | \n", 580 | "G3 | \n", 581 | "
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0 | \n", 586 | "0 | \n", 587 | "0 | \n", 588 | "18 | \n", 589 | "U | \n", 590 | "GT3 | \n", 591 | "A | \n", 592 | "4 | \n", 593 | "4 | \n", 594 | "at_home | \n", 595 | "teacher | \n", 596 | "... | \n", 597 | "4 | \n", 598 | "3 | \n", 599 | "4 | \n", 600 | "1 | \n", 601 | "1 | \n", 602 | "3 | \n", 603 | "6 | \n", 604 | "5 | \n", 605 | "6 | \n", 606 | "6 | \n", 607 | "
| 1 | \n", 610 | "0 | \n", 611 | "0 | \n", 612 | "17 | \n", 613 | "U | \n", 614 | "GT3 | \n", 615 | "T | \n", 616 | "1 | \n", 617 | "1 | \n", 618 | "at_home | \n", 619 | "other | \n", 620 | "... | \n", 621 | "5 | \n", 622 | "3 | \n", 623 | "3 | \n", 624 | "1 | \n", 625 | "1 | \n", 626 | "3 | \n", 627 | "4 | \n", 628 | "5 | \n", 629 | "5 | \n", 630 | "6 | \n", 631 | "
| 2 | \n", 634 | "0 | \n", 635 | "0 | \n", 636 | "15 | \n", 637 | "U | \n", 638 | "LE3 | \n", 639 | "T | \n", 640 | "1 | \n", 641 | "1 | \n", 642 | "at_home | \n", 643 | "other | \n", 644 | "... | \n", 645 | "4 | \n", 646 | "3 | \n", 647 | "2 | \n", 648 | "2 | \n", 649 | "3 | \n", 650 | "3 | \n", 651 | "10 | \n", 652 | "7 | \n", 653 | "8 | \n", 654 | "10 | \n", 655 | "
| 3 | \n", 658 | "0 | \n", 659 | "1 | \n", 660 | "15 | \n", 661 | "U | \n", 662 | "GT3 | \n", 663 | "T | \n", 664 | "4 | \n", 665 | "2 | \n", 666 | "health | \n", 667 | "services | \n", 668 | "... | \n", 669 | "3 | \n", 670 | "2 | \n", 671 | "2 | \n", 672 | "1 | \n", 673 | "1 | \n", 674 | "5 | \n", 675 | "2 | \n", 676 | "15 | \n", 677 | "14 | \n", 678 | "15 | \n", 679 | "
| 4 | \n", 682 | "0 | \n", 683 | "0 | \n", 684 | "16 | \n", 685 | "U | \n", 686 | "GT3 | \n", 687 | "T | \n", 688 | "3 | \n", 689 | "3 | \n", 690 | "other | \n", 691 | "other | \n", 692 | "... | \n", 693 | "4 | \n", 694 | "3 | \n", 695 | "2 | \n", 696 | "1 | \n", 697 | "2 | \n", 698 | "5 | \n", 699 | "4 | \n", 700 | "6 | \n", 701 | "10 | \n", 702 | "10 | \n", 703 | "
5 rows × 33 columns
\n", 707 | "| \n", 957 | " | school | \n", 958 | "sex | \n", 959 | "age | \n", 960 | "address | \n", 961 | "famsize | \n", 962 | "Pstatus | \n", 963 | "Medu | \n", 964 | "Fedu | \n", 965 | "Mjob | \n", 966 | "Fjob | \n", 967 | "... | \n", 968 | "famrel | \n", 969 | "freetime | \n", 970 | "goout | \n", 971 | "Dalc | \n", 972 | "Walc | \n", 973 | "health | \n", 974 | "absences | \n", 975 | "G1 | \n", 976 | "G2 | \n", 977 | "G3 | \n", 978 | "
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0 | \n", 983 | "0 | \n", 984 | "0 | \n", 985 | "18 | \n", 986 | "1 | \n", 987 | "0 | \n", 988 | "0 | \n", 989 | "4 | \n", 990 | "4 | \n", 991 | "0 | \n", 992 | "4 | \n", 993 | "... | \n", 994 | "4 | \n", 995 | "3 | \n", 996 | "4 | \n", 997 | "1 | \n", 998 | "1 | \n", 999 | "3 | \n", 1000 | "6 | \n", 1001 | "5 | \n", 1002 | "6 | \n", 1003 | "6 | \n", 1004 | "
| 1 | \n", 1007 | "0 | \n", 1008 | "0 | \n", 1009 | "17 | \n", 1010 | "1 | \n", 1011 | "0 | \n", 1012 | "1 | \n", 1013 | "1 | \n", 1014 | "1 | \n", 1015 | "0 | \n", 1016 | "2 | \n", 1017 | "... | \n", 1018 | "5 | \n", 1019 | "3 | \n", 1020 | "3 | \n", 1021 | "1 | \n", 1022 | "1 | \n", 1023 | "3 | \n", 1024 | "4 | \n", 1025 | "5 | \n", 1026 | "5 | \n", 1027 | "6 | \n", 1028 | "
| 2 | \n", 1031 | "0 | \n", 1032 | "0 | \n", 1033 | "15 | \n", 1034 | "1 | \n", 1035 | "1 | \n", 1036 | "1 | \n", 1037 | "1 | \n", 1038 | "1 | \n", 1039 | "0 | \n", 1040 | "2 | \n", 1041 | "... | \n", 1042 | "4 | \n", 1043 | "3 | \n", 1044 | "2 | \n", 1045 | "2 | \n", 1046 | "3 | \n", 1047 | "3 | \n", 1048 | "10 | \n", 1049 | "7 | \n", 1050 | "8 | \n", 1051 | "10 | \n", 1052 | "
| 3 | \n", 1055 | "0 | \n", 1056 | "1 | \n", 1057 | "15 | \n", 1058 | "1 | \n", 1059 | "0 | \n", 1060 | "1 | \n", 1061 | "4 | \n", 1062 | "2 | \n", 1063 | "1 | \n", 1064 | "3 | \n", 1065 | "... | \n", 1066 | "3 | \n", 1067 | "2 | \n", 1068 | "2 | \n", 1069 | "1 | \n", 1070 | "1 | \n", 1071 | "5 | \n", 1072 | "2 | \n", 1073 | "15 | \n", 1074 | "14 | \n", 1075 | "15 | \n", 1076 | "
| 4 | \n", 1079 | "0 | \n", 1080 | "0 | \n", 1081 | "16 | \n", 1082 | "1 | \n", 1083 | "0 | \n", 1084 | "1 | \n", 1085 | "3 | \n", 1086 | "3 | \n", 1087 | "2 | \n", 1088 | "2 | \n", 1089 | "... | \n", 1090 | "4 | \n", 1091 | "3 | \n", 1092 | "2 | \n", 1093 | "1 | \n", 1094 | "2 | \n", 1095 | "5 | \n", 1096 | "4 | \n", 1097 | "6 | \n", 1098 | "10 | \n", 1099 | "10 | \n", 1100 | "
| 5 | \n", 1103 | "0 | \n", 1104 | "0 | \n", 1105 | "16 | \n", 1106 | "1 | \n", 1107 | "1 | \n", 1108 | "1 | \n", 1109 | "4 | \n", 1110 | "3 | \n", 1111 | "3 | \n", 1112 | "2 | \n", 1113 | "... | \n", 1114 | "5 | \n", 1115 | "4 | \n", 1116 | "2 | \n", 1117 | "1 | \n", 1118 | "2 | \n", 1119 | "5 | \n", 1120 | "10 | \n", 1121 | "15 | \n", 1122 | "15 | \n", 1123 | "15 | \n", 1124 | "
| 6 | \n", 1127 | "0 | \n", 1128 | "0 | \n", 1129 | "16 | \n", 1130 | "1 | \n", 1131 | "1 | \n", 1132 | "1 | \n", 1133 | "2 | \n", 1134 | "2 | \n", 1135 | "2 | \n", 1136 | "2 | \n", 1137 | "... | \n", 1138 | "4 | \n", 1139 | "4 | \n", 1140 | "4 | \n", 1141 | "1 | \n", 1142 | "1 | \n", 1143 | "3 | \n", 1144 | "0 | \n", 1145 | "12 | \n", 1146 | "12 | \n", 1147 | "11 | \n", 1148 | "
| 7 | \n", 1151 | "0 | \n", 1152 | "0 | \n", 1153 | "17 | \n", 1154 | "1 | \n", 1155 | "0 | \n", 1156 | "0 | \n", 1157 | "4 | \n", 1158 | "4 | \n", 1159 | "2 | \n", 1160 | "4 | \n", 1161 | "... | \n", 1162 | "4 | \n", 1163 | "1 | \n", 1164 | "4 | \n", 1165 | "1 | \n", 1166 | "1 | \n", 1167 | "1 | \n", 1168 | "6 | \n", 1169 | "6 | \n", 1170 | "5 | \n", 1171 | "6 | \n", 1172 | "
| 8 | \n", 1175 | "0 | \n", 1176 | "0 | \n", 1177 | "15 | \n", 1178 | "1 | \n", 1179 | "1 | \n", 1180 | "0 | \n", 1181 | "3 | \n", 1182 | "2 | \n", 1183 | "3 | \n", 1184 | "2 | \n", 1185 | "... | \n", 1186 | "4 | \n", 1187 | "2 | \n", 1188 | "2 | \n", 1189 | "1 | \n", 1190 | "1 | \n", 1191 | "1 | \n", 1192 | "0 | \n", 1193 | "16 | \n", 1194 | "18 | \n", 1195 | "19 | \n", 1196 | "
| 9 | \n", 1199 | "0 | \n", 1200 | "0 | \n", 1201 | "15 | \n", 1202 | "1 | \n", 1203 | "0 | \n", 1204 | "1 | \n", 1205 | "3 | \n", 1206 | "4 | \n", 1207 | "2 | \n", 1208 | "2 | \n", 1209 | "... | \n", 1210 | "5 | \n", 1211 | "5 | \n", 1212 | "1 | \n", 1213 | "1 | \n", 1214 | "1 | \n", 1215 | "5 | \n", 1216 | "0 | \n", 1217 | "14 | \n", 1218 | "15 | \n", 1219 | "15 | \n", 1220 | "
10 rows × 33 columns
\n", 1224 | "| \n", 1298 | " | school | \n", 1299 | "sex | \n", 1300 | "age | \n", 1301 | "address | \n", 1302 | "famsize | \n", 1303 | "Pstatus | \n", 1304 | "Medu | \n", 1305 | "Fedu | \n", 1306 | "Mjob | \n", 1307 | "Fjob | \n", 1308 | "... | \n", 1309 | "romantic | \n", 1310 | "famrel | \n", 1311 | "freetime | \n", 1312 | "goout | \n", 1313 | "Dalc | \n", 1314 | "Walc | \n", 1315 | "health | \n", 1316 | "absences | \n", 1317 | "G1 | \n", 1318 | "G2 | \n", 1319 | "
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0 | \n", 1324 | "0 | \n", 1325 | "0 | \n", 1326 | "18 | \n", 1327 | "1 | \n", 1328 | "0 | \n", 1329 | "0 | \n", 1330 | "4 | \n", 1331 | "4 | \n", 1332 | "0 | \n", 1333 | "4 | \n", 1334 | "... | \n", 1335 | "0 | \n", 1336 | "4 | \n", 1337 | "3 | \n", 1338 | "4 | \n", 1339 | "1 | \n", 1340 | "1 | \n", 1341 | "3 | \n", 1342 | "6 | \n", 1343 | "5 | \n", 1344 | "6 | \n", 1345 | "
| 1 | \n", 1348 | "0 | \n", 1349 | "0 | \n", 1350 | "17 | \n", 1351 | "1 | \n", 1352 | "0 | \n", 1353 | "1 | \n", 1354 | "1 | \n", 1355 | "1 | \n", 1356 | "0 | \n", 1357 | "2 | \n", 1358 | "... | \n", 1359 | "0 | \n", 1360 | "5 | \n", 1361 | "3 | \n", 1362 | "3 | \n", 1363 | "1 | \n", 1364 | "1 | \n", 1365 | "3 | \n", 1366 | "4 | \n", 1367 | "5 | \n", 1368 | "5 | \n", 1369 | "
| 2 | \n", 1372 | "0 | \n", 1373 | "0 | \n", 1374 | "15 | \n", 1375 | "1 | \n", 1376 | "1 | \n", 1377 | "1 | \n", 1378 | "1 | \n", 1379 | "1 | \n", 1380 | "0 | \n", 1381 | "2 | \n", 1382 | "... | \n", 1383 | "0 | \n", 1384 | "4 | \n", 1385 | "3 | \n", 1386 | "2 | \n", 1387 | "2 | \n", 1388 | "3 | \n", 1389 | "3 | \n", 1390 | "10 | \n", 1391 | "7 | \n", 1392 | "8 | \n", 1393 | "
| 3 | \n", 1396 | "0 | \n", 1397 | "1 | \n", 1398 | "15 | \n", 1399 | "1 | \n", 1400 | "0 | \n", 1401 | "1 | \n", 1402 | "4 | \n", 1403 | "2 | \n", 1404 | "1 | \n", 1405 | "3 | \n", 1406 | "... | \n", 1407 | "1 | \n", 1408 | "3 | \n", 1409 | "2 | \n", 1410 | "2 | \n", 1411 | "1 | \n", 1412 | "1 | \n", 1413 | "5 | \n", 1414 | "2 | \n", 1415 | "15 | \n", 1416 | "14 | \n", 1417 | "
| 4 | \n", 1420 | "0 | \n", 1421 | "0 | \n", 1422 | "16 | \n", 1423 | "1 | \n", 1424 | "0 | \n", 1425 | "1 | \n", 1426 | "3 | \n", 1427 | "3 | \n", 1428 | "2 | \n", 1429 | "2 | \n", 1430 | "... | \n", 1431 | "0 | \n", 1432 | "4 | \n", 1433 | "3 | \n", 1434 | "2 | \n", 1435 | "1 | \n", 1436 | "2 | \n", 1437 | "5 | \n", 1438 | "4 | \n", 1439 | "6 | \n", 1440 | "10 | \n", 1441 | "
5 rows × 32 columns
\n", 1445 | "| \n", 59 | " | school | \n", 60 | "sex | \n", 61 | "age | \n", 62 | "address | \n", 63 | "famsize | \n", 64 | "Pstatus | \n", 65 | "Medu | \n", 66 | "Fedu | \n", 67 | "Mjob | \n", 68 | "Fjob | \n", 69 | "... | \n", 70 | "famrel | \n", 71 | "freetime | \n", 72 | "goout | \n", 73 | "Dalc | \n", 74 | "Walc | \n", 75 | "health | \n", 76 | "absences | \n", 77 | "G1 | \n", 78 | "G2 | \n", 79 | "G3 | \n", 80 | "
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0 | \n", 85 | "GP | \n", 86 | "F | \n", 87 | "18 | \n", 88 | "U | \n", 89 | "GT3 | \n", 90 | "A | \n", 91 | "4 | \n", 92 | "4 | \n", 93 | "at_home | \n", 94 | "teacher | \n", 95 | "... | \n", 96 | "4 | \n", 97 | "3 | \n", 98 | "4 | \n", 99 | "1 | \n", 100 | "1 | \n", 101 | "3 | \n", 102 | "4 | \n", 103 | "0 | \n", 104 | "11 | \n", 105 | "11 | \n", 106 | "
| 1 | \n", 109 | "GP | \n", 110 | "F | \n", 111 | "17 | \n", 112 | "U | \n", 113 | "GT3 | \n", 114 | "T | \n", 115 | "1 | \n", 116 | "1 | \n", 117 | "at_home | \n", 118 | "other | \n", 119 | "... | \n", 120 | "5 | \n", 121 | "3 | \n", 122 | "3 | \n", 123 | "1 | \n", 124 | "1 | \n", 125 | "3 | \n", 126 | "2 | \n", 127 | "9 | \n", 128 | "11 | \n", 129 | "11 | \n", 130 | "
| 2 | \n", 133 | "GP | \n", 134 | "F | \n", 135 | "15 | \n", 136 | "U | \n", 137 | "LE3 | \n", 138 | "T | \n", 139 | "1 | \n", 140 | "1 | \n", 141 | "at_home | \n", 142 | "other | \n", 143 | "... | \n", 144 | "4 | \n", 145 | "3 | \n", 146 | "2 | \n", 147 | "2 | \n", 148 | "3 | \n", 149 | "3 | \n", 150 | "6 | \n", 151 | "12 | \n", 152 | "13 | \n", 153 | "12 | \n", 154 | "
| 3 | \n", 157 | "GP | \n", 158 | "F | \n", 159 | "15 | \n", 160 | "U | \n", 161 | "GT3 | \n", 162 | "T | \n", 163 | "4 | \n", 164 | "2 | \n", 165 | "health | \n", 166 | "services | \n", 167 | "... | \n", 168 | "3 | \n", 169 | "2 | \n", 170 | "2 | \n", 171 | "1 | \n", 172 | "1 | \n", 173 | "5 | \n", 174 | "0 | \n", 175 | "14 | \n", 176 | "14 | \n", 177 | "14 | \n", 178 | "
| 4 | \n", 181 | "GP | \n", 182 | "F | \n", 183 | "16 | \n", 184 | "U | \n", 185 | "GT3 | \n", 186 | "T | \n", 187 | "3 | \n", 188 | "3 | \n", 189 | "other | \n", 190 | "other | \n", 191 | "... | \n", 192 | "4 | \n", 193 | "3 | \n", 194 | "2 | \n", 195 | "1 | \n", 196 | "2 | \n", 197 | "5 | \n", 198 | "0 | \n", 199 | "11 | \n", 200 | "13 | \n", 201 | "13 | \n", 202 | "
5 rows × 33 columns
\n", 206 | "| \n", 389 | " | school | \n", 390 | "sex | \n", 391 | "age | \n", 392 | "address | \n", 393 | "famsize | \n", 394 | "Pstatus | \n", 395 | "Medu | \n", 396 | "Fedu | \n", 397 | "Mjob | \n", 398 | "Fjob | \n", 399 | "... | \n", 400 | "freetime | \n", 401 | "goout | \n", 402 | "Dalc | \n", 403 | "Walc | \n", 404 | "health | \n", 405 | "absences | \n", 406 | "G1 | \n", 407 | "G2 | \n", 408 | "G3 | \n", 409 | "subject | \n", 410 | "
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0 | \n", 415 | "GP | \n", 416 | "F | \n", 417 | "18 | \n", 418 | "U | \n", 419 | "GT3 | \n", 420 | "A | \n", 421 | "4 | \n", 422 | "4 | \n", 423 | "at_home | \n", 424 | "teacher | \n", 425 | "... | \n", 426 | "3 | \n", 427 | "4 | \n", 428 | "1 | \n", 429 | "1 | \n", 430 | "3 | \n", 431 | "4 | \n", 432 | "0 | \n", 433 | "11 | \n", 434 | "11 | \n", 435 | "Portuguese | \n", 436 | "
| 1 | \n", 439 | "GP | \n", 440 | "F | \n", 441 | "17 | \n", 442 | "U | \n", 443 | "GT3 | \n", 444 | "T | \n", 445 | "1 | \n", 446 | "1 | \n", 447 | "at_home | \n", 448 | "other | \n", 449 | "... | \n", 450 | "3 | \n", 451 | "3 | \n", 452 | "1 | \n", 453 | "1 | \n", 454 | "3 | \n", 455 | "2 | \n", 456 | "9 | \n", 457 | "11 | \n", 458 | "11 | \n", 459 | "Portuguese | \n", 460 | "
| 2 | \n", 463 | "GP | \n", 464 | "F | \n", 465 | "15 | \n", 466 | "U | \n", 467 | "LE3 | \n", 468 | "T | \n", 469 | "1 | \n", 470 | "1 | \n", 471 | "at_home | \n", 472 | "other | \n", 473 | "... | \n", 474 | "3 | \n", 475 | "2 | \n", 476 | "2 | \n", 477 | "3 | \n", 478 | "3 | \n", 479 | "6 | \n", 480 | "12 | \n", 481 | "13 | \n", 482 | "12 | \n", 483 | "Portuguese | \n", 484 | "
| 3 | \n", 487 | "GP | \n", 488 | "F | \n", 489 | "15 | \n", 490 | "U | \n", 491 | "GT3 | \n", 492 | "T | \n", 493 | "4 | \n", 494 | "2 | \n", 495 | "health | \n", 496 | "services | \n", 497 | "... | \n", 498 | "2 | \n", 499 | "2 | \n", 500 | "1 | \n", 501 | "1 | \n", 502 | "5 | \n", 503 | "0 | \n", 504 | "14 | \n", 505 | "14 | \n", 506 | "14 | \n", 507 | "Portuguese | \n", 508 | "
| 4 | \n", 511 | "GP | \n", 512 | "F | \n", 513 | "16 | \n", 514 | "U | \n", 515 | "GT3 | \n", 516 | "T | \n", 517 | "3 | \n", 518 | "3 | \n", 519 | "other | \n", 520 | "other | \n", 521 | "... | \n", 522 | "3 | \n", 523 | "2 | \n", 524 | "1 | \n", 525 | "2 | \n", 526 | "5 | \n", 527 | "0 | \n", 528 | "11 | \n", 529 | "13 | \n", 530 | "13 | \n", 531 | "Portuguese | \n", 532 | "
5 rows × 34 columns
\n", 536 | "