-
-
Notifications
You must be signed in to change notification settings - Fork 21.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
improve: improved rating algorithm wip #49
Conversation
@@ -1,3 +1,21 @@ | |||
// https://stackoverflow.com/a/5263759/10629172 | |||
function normalcdf(mean, sigma, to) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I really have no idea what this does but i'm just experimenting it's a Cumulative distribution function : https://stackoverflow.com/questions/5259421/cumulative-distribution-function-in-javascript/5263759#5263759
const REPO_OFFSET = 1; | ||
|
||
const ALL_OFFSETS = | ||
CONTRIBS_OFFSET + | ||
ISSUES_OFFSET + | ||
STARS_OFFSET + | ||
PRS_OFFSET + | ||
FOLLOWERS_OFFSET + | ||
REPO_OFFSET; | ||
|
||
const FIRST_STEP = 0; | ||
const SECOND_STEP = 5; | ||
const THIRD_STEP = 20; | ||
const FOURTH_STEP = 50; | ||
const FIFTH_STEP = 130; | ||
const RANK_S_VALUE = 1; | ||
const RANK_DOUBLE_A_VALUE = 25; | ||
const RANK_A2_VALUE = 45; | ||
const RANK_A3_VALUE = 60; | ||
const RANK_B_VALUE = 100; | ||
|
||
const TOTAL_VALUES = | ||
RANK_S_VALUE + RANK_A2_VALUE + RANK_A3_VALUE + RANK_B_VALUE; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding all the OFFSETS & conditional values and feeding it to that function, all values are result of trial and errors
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@anuraghazra Hi, I wanted to know , what are these offsets are for and how are they calculated??/
} else if (score > FOURTH_STEP && score <= FIFTH_STEP) { | ||
level = "A++"; | ||
} else if (score > FIFTH_STEP) { | ||
if (normalizedScore < RANK_S_VALUE) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
normalizedScore is for some reason reverse that means the better your score is the normalized score would be closer to 0
Users like
- yyx990803
- kentcdodds
- gaearon
all are close to 0
@vinayaksh42 @garvit-joshi can you guys check and see if anything you want to improve or review the code? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm, surely a much better way to calculate ranks.
I am not that good with maths either, but preview is quite Amazing |
I think guys this is a lot better. @garvit-joshi @vinayaksh42 perfectly balanced to A and A++ and S, S+ ranks are hard to get, even kentcdodds did not get S+ rank. also fixed #39 as you can see MichaelDeBoey had 19k stars which was because of forks so i filtered them out. |
@@ -26,7 +26,7 @@ const fetcher = (variables, token) => { | |||
followers { | |||
totalCount | |||
} | |||
repositories(first: 100, orderBy: { direction: DESC, field: STARGAZERS }) { | |||
repositories(first: 100, ownerAffiliations: OWNER, isFork: false, orderBy: {direction: DESC, field: STARGAZERS}) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Filter out own repos, and forked repos
Related issues
#41
#39
NOTE: i suck at math, so i'm just experimenting and doing trial and error to get the correct results.