commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Thomas Neidhart (JIRA)" <>
Subject [jira] [Updated] (MATH-891) SpearmansCorrelation fails when using NaturalRanking together with NaNStrategy.REMOVED
Date Mon, 18 Feb 2013 13:23:13 GMT


Thomas Neidhart updated MATH-891:

    Attachment: MATH-891.patch

The attached patch does the following:

 * checks if the ranking algorithm is NaturalRanking with NaNStrategy set to REMOVED
 ** finds all indices with NaNs in the input arrays
 ** removes the corresponding rows in *all* input data
 ** passes the modified data to the ranking algorithm

This should ideally be handled by the RankingAlgorithm, but updating the interface would break
compatibility afaik.

The SpearmanCorrelation class is the only one in CM that uses a RankingAlgorithm to rank correlated
data, so it is a kind of compromise imho.
> SpearmansCorrelation fails when using NaturalRanking together with NaNStrategy.REMOVED
> --------------------------------------------------------------------------------------
>                 Key: MATH-891
>                 URL:
>             Project: Commons Math
>          Issue Type: Bug
>    Affects Versions: 3.0
>            Reporter: Thomas Neidhart
>         Attachments: MATH-891.patch
> As reported by Martin Rosellen on the users mailinglist:
> Using a NaturalRanking with a REMOVED NaNStrategy can result in an exception when NaN
are contained in the input arrays.
> The current implementation just removes the NaN values where they occur, without taken
care to remove the corresponding values in the other array.

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see:

View raw message