-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Create a cython version of biweight_midcorrelation
to massively speed up computation
#9483
Comments
Hi. Can you post an example usage that causes slow performance? Did you try to profile it? If the bottleneck is upstream somewhere else, there is nothing much we can do. |
An example would be doing a pairwise correlation matrix. I haven’t profiled it yet to see where the bottleneck is but I’m basing my comparison off a fast c implementation available in R’s WGCNA package (function is called bicor). |
Here is an example of the WGCNA package wrapping C code into their function: https://github.com/cran/WGCNA/blob/678c9da2b71c5b4a43cb55005224c243f411abc8/R/corFunctions.R#L3 Look at the difference in performance:
That's about 108x faster... |
Having had what is admittedly only a quick look at the current astropy code, I think that code could be sped up similarly simply by allowing multi-dimensional input (i.e., let the work-horse |
Description
To create a cython version of
biweight_midcorrelation
because the current implementation is very slow. For example,pandas
hasnancorr
andnancorr_spearman
which are EXTREMELY fast compared to the normal pairwise iterations that could be done usingscipy
.Would it be possible to add this functionality to
astropy
? Currently, I am unable to use this robust metric for my actual datasets that are quite large. I can only use this for test datasets because it takes very long.Additional context
Here's an example of the
nancorr
function implemented in cython: https://github.com/pandas-dev/pandas/blob/master/pandas/_libs/algos.pyxThe text was updated successfully, but these errors were encountered: