Skip to content
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

tSNE widget raises an error on data with only one variable #4354

Closed
PrimozGodec opened this issue Jan 21, 2020 · 0 comments · Fixed by #4364
Closed

tSNE widget raises an error on data with only one variable #4354

PrimozGodec opened this issue Jan 21, 2020 · 0 comments · Fixed by #4364
Assignees
Labels
bug report Bug is reported by user, not yet confirmed by the core team snack This will take an hour or two

Comments

@PrimozGodec
Copy link
Contributor

PrimozGodec commented Jan 21, 2020

Describe the bug

tSNE widget raises an error on data with only one variable in X or when only one variable has non-nan data.

To Reproduce
Steps to reproduce the behavior:

  1. In File widget select iris
  2. Connect it to Select columns where you leave only one variable in features.
  3. Connect to tSNE and it raises an error.

Orange version:
3.24

Additional context

Traceback (most recent call last):
  File "/Users/primoz/Documents/orange3/Orange/widgets/utils/concurrent.py", line 596, in _on_task_done
    super()._on_task_done(future)
  File "/Users/primoz/Documents/orange3/Orange/widgets/utils/concurrent.py", line 552, in _on_task_done
    self.on_exception(ex)
  File "/Users/primoz/Documents/orange3/Orange/widgets/utils/concurrent.py", line 492, in on_exception
    raise ex
  File "/Users/primoz/miniconda3/envs/orange/lib/python3.7/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/Users/primoz/Documents/orange3/Orange/widgets/unsupervised/owtsne.py", line 217, in run
    job(progress_callback=_progress_callback)
  File "/Users/primoz/Documents/orange3/Orange/widgets/unsupervised/owtsne.py", line 107, in compute_initialization
    task.initialization = task.tsne.compute_initialization(task.pca_projection.X)
  File "/Users/primoz/Documents/orange3/Orange/projection/manifold.py", line 454, in compute_initialization
    X, self.n_components, random_state=self.random_state
  File "/Users/primoz/miniconda3/envs/orange/lib/python3.7/site-packages/openTSNE/initialization.py", line 58, in pca
    embedding = pca_.fit_transform(X)
  File "/Users/primoz/miniconda3/envs/orange/lib/python3.7/site-packages/sklearn/decomposition/_pca.py", line 369, in fit_transform
    U, S, V = self._fit(X)
  File "/Users/primoz/miniconda3/envs/orange/lib/python3.7/site-packages/sklearn/decomposition/_pca.py", line 416, in _fit
    return self._fit_full(X, n_components)
  File "/Users/primoz/miniconda3/envs/orange/lib/python3.7/site-packages/sklearn/decomposition/_pca.py", line 435, in _fit_full
    % (n_components, min(n_samples, n_features)))
ValueError: n_components=2 must be between 0 and min(n_samples, n_features)=1 with svd_solver='full'
@PrimozGodec PrimozGodec added bug report Bug is reported by user, not yet confirmed by the core team snack This will take an hour or two labels Jan 21, 2020
@rokgomiscek rokgomiscek self-assigned this Jan 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug report Bug is reported by user, not yet confirmed by the core team snack This will take an hour or two
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants