Python-ELM icon indicating copy to clipboard operation
Python-ELM copied to clipboard

Missing function atleast2d_or_csr() - scikit-learn 0.17.0

Open srimalj opened this issue 8 years ago • 4 comments

Hi

Thanks for the code.

The function atleast2d_or_csr() used in random_layer.py does not seem to be available any more with the new scikit-learn 0.17.0

I managed to work around this temporarily by defining a function by that name which simply returns the matrix without performing any checks.

def atleast2d_or_csr(X): return X

I'm not sure what checks should be in there or what the equivalent function in the new scikit is though.

Hope this helps

Cheers

Srimal.

srimalj avatar Mar 11 '16 03:03 srimalj

From its name , I think it is checking whether the input is at least 2d or a csr matrix .

StevenLOL avatar Jul 26 '16 04:07 StevenLOL

https://github.com/scikit-learn/scikit-learn/issues/4457

stgrmks avatar Nov 04 '16 17:11 stgrmks

I fixed this by replacing it with check_array which does the same thing. Trying to figure out how to push this change back to you, but I'm not sure how.

markuskreitzer avatar Apr 12 '17 17:04 markuskreitzer

Go to the file random_layer.py

Change the line no 27 as "from sklearn.utils import check_random_state, check_array" Line numbers 111 and 133 as "X = check_array(X)"

This should work fine

PavithranRick avatar Oct 16 '17 01:10 PavithranRick