This project is designed to predict students' grades in two secodary schools [Gabriel Pereira, Mousinho da Silveira] in Portugal in Portuguese Language Course.
Project for the course: Learning Analytics, International studies in engineering, Master of computer engineering, University of Duisburg-Essen.
- Check how attributes and features are correlated to exams' grades.
- Have a clear idea about their predicted grades through an interactive decision trees.
- Get the predicted result (fail/ pass) for all exams (first, second, and final) at the beginning of the semester.
- Get the predicted result (fail, medium, and high) for second exam after getting first exam's result
(fail: less than 10, medium: from 10 to less than 15, high: from 15 to 20). - Get the predicted result (fail, medium, and high) for final exam after getting second exam's result
(fail: less than 10, medium: from 10 to less than 15, high: from 15 to 20).
"It takes several minutes for Heruko to activate both workloads:
Two different workloads were used in Heroku to deploy this project, one for our backend and one for the frontend.
The first request caused the Heroku to wake up the frontend workload.
Then frontend will send the request to the backend, which subsequently caused Heroku to wake up the backend workload.
So it takes a few minutes before both are operational."
Logo
Landing page
Footer
Dataset
Interactive Decision Tree
Prediction page
Prediction Form
Prediction Results
The application consists of two main parts:
- Backend: responsible for:
Machine Learning
Server-side web application logic, consists of a server, an application, and a database. - Frontend: the part that users interact with it.
- Flask
- MongoDB for database
- Scikit-learn for machine learning
- React
- Bootstrap
- Axios
- Postman: to test connectivity especially for 'POST' method
- Gunicorn as a web server gateway interface "WSGI"
- mLab as a cloud database service
- Github
- Heroku
Make sure that you have mongoDB installed on your PC and we highly recommend you to use visual studio code as a code editor
Make sure to have the file
numValuesComb.csv
in the same folder that containsscikit.py
-
Import
allData.csv
to MongoDB. This tutorial will help you. -
In the top level directory, go to
scikit.py
file. -
In line.52
app.config["MONGO_URI"] = "mongodb://localhost:27017/laprobk"
changelaprobk
to the name you've choosen to your DB. -
In line.221 in the route
@app.route("/alldata")
changedf = mongo.db.<YOUR COLLECTION'S NAME>.find()
-
Open terminal and go to the path of
scikit.py
then type the following:
pip install -r requirements.txt
python scikit.py
- First command will install all required python packages to run this app
- Second command will run the backend part of the app
The backend part should be running now.
- Go to
client\src\contexts\urlContext.js
comment line.3
export const UrlContext = createContext('https://passwizardbackend.herokuapp.com/');
uncomment line.4
export const UrlContext = createContext('http://127.0.0.1:5000/');
npm install
npm start
If
npm start
doesn't work, do the following:
npm install rimraf -g
rimraf node_modules
npm start -- --reset-cache
then repeat step number 6
-
Import
allData.csv
as frontend dataset into Atlas (Cloud DB Service)
andnumValuesComb.csv
as backend dataset into Atlas as a new collection in same database. This tutorial may help you. -
In the top level directory, go to
wsgi.py
file
go to line.52 and add Mongo_URI
you got in step.1 for allData.csv
Also add this uri to line.63 between the parentheses.
-
In lines [56 to 58] add the credintials for backend collection from step.1.
-
In line.247 add the collection name for frontend collection.
-
Go to
client\src\contexts\urlContext.js
uncomment line.3
export const UrlContext = createContext('https://passwizardbackend.herokuapp.com/');
Here you should use the link that you'll get when deploying backend part to Heroku (step.7) instead of this link.
Otherwise you'll be connected to our backend which will work regardless of whether you deployed your backend part properly.
comment line.4
export const UrlContext = createContext("http://localhost:5000/");
-
Seperate 'client' folder from main project folder to be deployed seperately as in the following guide
-
follow the guide Deploy web app to Heroku, mainly you need to do as follows:
- Deploy backend app to heroku after pushing it to github. Please follow the steps in the upmentioned guide
- Create an account on mLab, currently migrated to mongoDB Atlas, make sure to name database and collection as written in the code, and finally connect backend app to mLab as explained in the upmentioned guide
- Push
client
file to a new github repository and deploy it to heroku. Please follow the steps in the upmentioned guide and note that here you don't need to change url in axios part as you did that on step 5
- Baohui Deng
- Tannaz Vahidi
- Amr Shakhshir
- Hesamoddin Heidarzadeh
P . Cortez and A. Silva. Using Data Mining to Predict Secondary School Student Performance. In A. Brito and J. Teixeira Eds., P roc eedings of 5 th FUture BUsiness TEChnology Conference (FUBUTEC 2008 ) pp. 5 12 , Porto, Portugal, April, 2008 , EUROSIS, ISBN 978 9077381 39 7