[
https://issues.apache.org/jira/browse/MATH-891?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
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: https://issues.apache.org/jira/browse/MATH-891
> 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: http://www.atlassian.com/software/jira