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
{{ message }}
Repository navigation
Locally Linear Embedding manifold doesn't work with integer inputs #6033
An error occurs when you try to use manifold.LocallyLinearEmbedding with an integer array as the input if you have certain values of the method parameter. I'm running the latest version of scikit-learn (I got this error, updated through conda, and the error still occurs).
Traceback (most recent call last):
File "C:/Users/jswanson/Downloads/plot_compare_methods.py", line 63, in <module>
method=method).fit_transform(X)
File "C:\Users\jswanson\AppData\Local\Continuum\Anaconda3\lib\site-packages\sklearn\manifold\locally_linear.py", line 652, in fit_transform
self._fit_transform(X)
File "C:\Users\jswanson\AppData\Local\Continuum\Anaconda3\lib\site-packages\sklearn\manifold\locally_linear.py", line 623, in _fit_transform
random_state=random_state, reg=self.reg)
File "C:\Users\jswanson\AppData\Local\Continuum\Anaconda3\lib\site-packages\sklearn\manifold\locally_linear.py", line 476, in locally_linear_embedding
Xi -= Xi.mean(0)
TypeError: Cannot cast ufunc subtract output from dtype('float64') to dtype('int64') with casting rule 'same_kind'
I confirm. Error is raised for both method='ltsa' (see @Jezzamonn log) and method='hessian' (see log below). Everything else works fine.
Traceback (most recent call last):
File "test.py", line 46, in <module>
method=method).fit_transform(X)
File "/usr/lib/python3.5/site-packages/sklearn/manifold/locally_linear.py", line 652, in fit_transform
self._fit_transform(X)
File "/usr/lib/python3.5/site-packages/sklearn/manifold/locally_linear.py", line 623, in _fit_transform
random_state=random_state, reg=self.reg)
File "/usr/lib/python3.5/site-packages/sklearn/manifold/locally_linear.py", line 327, in locally_linear_embedding
Gi -= Gi.mean(0)
TypeError: Cannot cast ufunc subtract output from dtype('float64') to dtype('int64') with casting rule 'same_kind'
Activity
soupault commentedon Feb 4, 2016
I confirm. Error is raised for both
method='ltsa'(see @Jezzamonn log) andmethod='hessian'(see log below). Everything else works fine.BUG: handle integer inputs in LLE (fixes scikit-learn#6033)
jakevdp commentedon Feb 4, 2016
I added a fix in #6282
soupault commentedon Feb 5, 2016
@jakevdp thanks a lot!
amueller commentedon Oct 7, 2016
Fixed in #6282
BUG: handle integer inputs in LLE (fixes #6033) (#6282)
BUG: handle integer inputs in LLE (fixes scikit-learn#6033) (scikit-l…
BUG: handle integer inputs in LLE (fixes scikit-learn#6033) (scikit-l…
BUG: handle integer inputs in LLE (fixes scikit-learn#6033) (scikit-l…