You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When y.shape and x.shape are different, spearman_correlation fails because of missing "otypes" in np.vectorise.
This happens from np.vectorise - numpy/lib/function_base.py - _get_ufunc_and_otypes() - line 2365 otypes = ''.join([asarray(outputs[_k]).dtype.char for _k in range(nout)])
To Reproduce
Steps to reproduce the behaviour:
I have X - a numpy array shape (1774, 601) with float and nan values.
I have y - a numpy array shape (1774, ) with int values 0 and 1 only.
Just run: spearman_corr(X, y)
Expected behaviour
Returns the scores and doesn't fail.
Desktop (please complete the following information):
OS: MacOS 13.2.1 (22D68)
Proposed fix:
I solved the issue by simply adding otypes=[X.dtype]
So line 567 from filters/univariate/measures.py is now: ranks_X[:, i] = np.vectorize(d.get, otypes=[X.dtype])(X[:, i])
The text was updated successfully, but these errors were encountered:
Description:
Python version: 3.8
numpy version: 1.22.3
ITMO_FS version: 0.3.3
When y.shape and x.shape are different, spearman_correlation fails because of missing "otypes" in np.vectorise.
This happens from np.vectorise - numpy/lib/function_base.py - _get_ufunc_and_otypes() - line 2365
otypes = ''.join([asarray(outputs[_k]).dtype.char for _k in range(nout)])
To Reproduce
Steps to reproduce the behaviour:
Expected behaviour
Returns the scores and doesn't fail.
Desktop (please complete the following information):
Proposed fix:
I solved the issue by simply adding
otypes=[X.dtype]
So line 567 from filters/univariate/measures.py is now:
ranks_X[:, i] = np.vectorize(d.get, otypes=[X.dtype])(X[:, i])
The text was updated successfully, but these errors were encountered: