Make simple leaderboard for machine learning competition using Flask
There are two role: admin and user
Admin is able to:
- See Public & Private Leaderboard
- Create, read, update, delete (CRUD) Users & Submissions
The Flask Leaderboard repo enable users to:
- See Public Leaderboard
- Login & Register User
- Public & Private Submission
First, setting up the admin
- Clone and Install
- Insert Master Key
- Change Scoring Method
- Run Flask App
- Make Admin Account
- Reset All
Clone the repo using git clone https://github.com/vindruid/flask_leaderboard.git
Then install the package with the version pip install -r requirements.txt
Put your key inside folder master_key with name public_key.csv and private_key.csv
with column data_id and prediction
for example
data_id,prediction
1,5
2,4
3,4.1
4,9
5,6.8
open main.py
greater_better = Trueif greatest score is the best (i.e. Accuracy, R2 Score)
greater_better = Falseif lowest score is the best (i.e. Mean Square Error, log loss)
Using scikit learn metrics
for example
from sklearn.metrics import mean_squared_error
metric = mean_squared_errorEnsure the metric you choose align with the greater_better parameter
in your terminal, run python main.py
Then you will see a page open in your browser with url http://localhost:5005/
Go to register page http://localhost:5005/register or click register button at the top left
Then perserve admin username, the password is up to you.
You can go to http://localhost:5005/admin by login with admin username.
At that page, you can manage users and submissions (create, read, update, and delete)
If you forgot your admin password
run python query.py and it will print all submission and username with password
If you intent to remove all user and submission.
just delete app.db file
Go to http://localhost:5005/
Go to register page http://localhost:5005/register or click register button at the top left
Add your username and password then click register
Go back to home page http://localhost:5005/ or click home button
Put your registered username and password then login
If you forget your password, please contact admin or register new account
Submission menu will be appeared if you already login
Choose your submission type (public or private)
Click choose file button and select your file then click upload
Ensure your file extension is .csv and the file has 2 columns data_id & prediction with data_id according to admin instruction (should match with master key