Abuja Project
Abuja Project
students and predict the performance of the students in upcoming exams. The
application keeps track of the student's attendance and their participation in the
interactive activities happening in the classroom and using this information, it predicts
with about 80% accuracy how the students will perform in the forecoming examinations.
It is powered by a machine learning model trained with SVM on a data-set of similar
data.
Nowadays, due to large number of students in a single class, teachers find it hard to
identify weak students and to focus on boosting their performance. As a result, many
students do not receive proper attention at the right time and end up failing their
exams. Our application is an attempt to resolve this problem by predicting performance
of the students beforehand and making it possible for the teachers to focus on weaker
students in time.
Our application has a very intuitive and simple UI. On the home page, we provide
options for login and signup. Once the teacher has created an account and they login,
they are redirected to the progress tracking page where they are greeted with a table
which shows a list of their student's names along with the prediction of the student's
performance in upcoming tests based on currently available data. They can also access
the detail page of a particular student by clicking on that student's entry in the table.
The students are classified into three categories: average performance, good
performance and excellent performance. On the progress tracking page, teachers have
the option to add new students and delete older ones. They also have the option to
update data of all the students after they have taken a class.
impor
t
numpy
as np
import pandas as pd
df = pd.read_csv('./final_dataset.csv')
from sklearn.preprocessing import StandardScaler
from sklearn.svm import SVC
import pickle
# Features
gender = list(df['gender'])
for i in range(len(gender)):
if gender[i] == 'M':
gender[i] = 0
else:
gender[i] = 1
# Male - 0 , Female - 1
school_level = list(df['StageID'])
for i in range(len(school_level)):
if school_level[i] == "lowerlevel":
school_level[i] = 0
elif school_level[i] == "MiddleSchool":
school_level[i] = 1
else:
school_level[i] = 2
# Class 0-4 - 0 , 5-8 - 1, 9-12 - 2
doubts_aksed = list(df['raisedhands'])
discussion = list(df['Discussion'])
parent = list(df['ParentschoolSatisfaction'])
for i in range(len(parent)):
if parent[i] == 'Good':
parent[i] = 1
else:
parent[i] = 0
# Good - 1, Bad - 0
absent = list(df['StudentAbsenceDays'])
for i in range(len(absent)):
if absent[i] == 'Under-7':
absent[i] = 0
else:
absent[i] = 1
# Absent More Than 10% - 1, Less Than 10% - 0
result = list(df['Class'])
for i in range(len(result)):
if result[i] == 'L':
result[i] = 0
elif result[i] == 'M':
result[i] = 1
else:
result[i] = 2
# Results 0,1,2
labels = result
features = list()
for i in range(len(doubts_aksed)):
features.append([school_level[i],doubts_aksed[i],discussion[i],parent[i],absent[i]]
)
sc.fit(features_train)
features_train_std = sc.transform(features_train)
features_test_std = sc.transform(features_test)
pickle.dump(svm,open('trained_model.sav','wb'))
loaded_model = pickle.load(open('trained_model.sav','rb'))
labels_pred = loaded_model.predict(features_test_std)
print('Misclassified samples: %d' % (labels_test != labels_pred).sum())
print(len(features_test))