Skip to content

Instantly share code, notes, and snippets.

@codervince
Last active August 29, 2015 14:27
Show Gist options
  • Save codervince/a5fc189d65f5743dd8f3 to your computer and use it in GitHub Desktop.
Save codervince/a5fc189d65f5743dd8f3 to your computer and use it in GitHub Desktop.
BETTR BETTR AUG 20
#1
The data from getdata() is in the data.pkl file.
First create the users from tipsters = np.array(<USER.NAME>)
Then upload data from data.pkl, one row per user to the
TipsterPerformance table.
Note the racedate for the INIT data is say AUG 1 2015
All the SQLAlchemy code should be in a separate file.
TipsterPerformance replaces UserPerformance.
It is the INIT data for the app.
#2
Once this data is in the DB:
The main page after login should display a table (sortable- use JQuery?) with 1 row per user comprising User Performance JOIN User.
Sorted by WinSR, filtered by racedate (I.e. always use the LATEST racedate which in the init case is AUG 1 2015)
RANK TIPSTER COLUMNS..........................
--------------
Lastupdated = Racedate
This table is only visible to logged-in users (later only visible to users who have subscribed).
#3
The second function getsimilarity() in getdata returns pairwise USER1 USER2...USERn for each user (no duplicates) and a coefficient.
This will probably have to go in a JOIN table between users.
2 columns: this similary_coefficient plus the racedate (1 AUG 2015)
Later new data will be updated to this table automatically.
**NB I will put the table in models.py and have the function return whatever is convenient for you - dictionary?**
The same main page after login should display the top 10 (similarity_coefficient ascending) scores..
RANK TIPSTER1 TIPSTER2 SCORE
1
.
10
Lastupdated = Racedate
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment