-
Notifications
You must be signed in to change notification settings - Fork 56
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
Unify and fix rank module result types #183
Comments
|
Apparently, restarting the computer fixed issue 2. Unit tests are added and changes are on their way. |
How to handle nan and infinity values within the sequence?At this moment the ranking order is as follows:
nans and infinities are treated as individual elements:
How do others handle nans?
SuggestionI would recommend to assign nan ranks to nan values as default case.
What do you think? |
Yes, I think your suggestion is very good. |
I've just created a update-rank branch to solve all issues. By default nan is sorted to the start of a sequence. This corrupts the loop of the implemented version. There are two possibilities to solve it:
|
There are 4 ranking methods in
FSharp.Stats.Rank
:example = [5,3,3,4,2]
result :int [] = [5,2,3,4,1]
result :float [] = [5,2,2,4,1]
result :float [] = [5,3,3,4,1]
result :float [] = [5,2.5,2.5,4,1]
By now, all functions except rankFirst result in float arrays. The only function where floats can occur is rankAvg. For harmonization I would suggest, that rankFirst as well should report a float array, although it would be a breaking change.
There seems to be an issue, that ties are not ranked correct here:
FSharp.Stats/src/FSharp.Stats/Rank.fs
Line 65 in 46ab30a
It seems the +1 increment belongs to rankMax rather than rankMin.
EDIT 01/02/22: THIS WAS A TEMPORAL LOCAL ERROR!
A fix is on the way!
The text was updated successfully, but these errors were encountered: