Skip to content
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

Negative Scores? #366

Open
MGatner opened this issue Sep 22, 2022 · 3 comments
Open

Negative Scores? #366

MGatner opened this issue Sep 22, 2022 · 3 comments

Comments

@MGatner
Copy link

MGatner commented Sep 22, 2022

I was confused why I was not getting the full filesToShow when minScoreToShow was 0. It turns out some scores are coming back negative:

Times Changed Complexity Score
45 1068 1
40 792 0.719
26 786 0.502
38 418 0.372
25 591 0.37
30 378 0.273
33 290 0.224
18 457 0.171
21 387 0.169
11 697 0.168
21 354 0.145
14 406 0.073
15 323 0.035
17 281 0.036
19 245 0.037
18 229 0.011
20 191 0.009
10 377 -0.012
15 250 -0.015
16 145 -0.078

I know score is a somewhat-contrived calculation based on the actual value columns... but how does a negative make sense?

@villfa
Copy link
Collaborator

villfa commented Sep 23, 2022

Interesting.

The reason we have negative scores come from this line.

For instance, by changing the code like below we won't have negative values anymore, but the maximum score will be 1.414 (square root of 2) instead of 1.

- return \round(1 - $distanceFromTopRightCorner, 3);
+ return \round(\sqrt(2) - $distanceFromTopRightCorner, 3);

If we want to have a score between 0 and 1, a better solution would probably be to apply this formula.

@MGatner
Copy link
Author

MGatner commented Sep 23, 2022

How about your alternative equation divided by 1.414?

@villfa
Copy link
Collaborator

villfa commented Sep 23, 2022

It sounds more simple indeed 😅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants