Skip to content

Make simple leaderboard for machine learning competition using Flask

License

Notifications You must be signed in to change notification settings

riaraju/flask_leaderboard

 
 

Repository files navigation

Flask Leaderboard

Make simple leaderboard for machine learning competition using Flask

How to Use This Apps

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

How to Use it as an Admin

Clone and Install

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

Insert Master Key

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

Change Scoring Method

open main.py

change greater_better parameter

greater_better = True

if greatest score is the best (i.e. Accuracy, R2 Score)

greater_better = False

if lowest score is the best (i.e. Mean Square Error, log loss)

change metric parameter

Using scikit learn metrics
for example

from sklearn.metrics import mean_squared_error

metric = mean_squared_error

Ensure the metric you choose align with the greater_better parameter

Run Flask App

in your terminal, run python main.py
Then you will see a page open in your browser with url http://localhost:5005/

Make Admin account

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

Reset All

If you intent to remove all user and submission.
just delete app.db file

How to Use it as an User

Connect to leaderboard

Go to http://localhost:5005/

Register

Go to register page http://localhost:5005/register or click register button at the top left
Add your username and password then click register

Login

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

Submit

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

About

Make simple leaderboard for machine learning competition using Flask

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • HTML 51.1%
  • Python 48.9%