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

[FIX] Support Sparse Data in Domain Editor #2245

Merged
merged 4 commits into from
Apr 24, 2017

Conversation

nikicc
Copy link
Contributor

@nikicc nikicc commented Apr 18, 2017

Issue

Fixes #2188.

Description of changes

Enhance DomainEditor.get_domain to handle sparse data. Also instead of returning a list of columns' the method itself merges them to appropriate X, y and meta arrays.

Includes
  • Code changes
  • Tests
  • Documentation

@codecov-io
Copy link

codecov-io commented Apr 19, 2017

Codecov Report

Merging #2245 into master will increase coverage by 0.01%.
The diff coverage is 89.65%.

@@            Coverage Diff             @@
##           master    #2245      +/-   ##
==========================================
+ Coverage   72.37%   72.39%   +0.01%     
==========================================
  Files         319      319              
  Lines       55014    55056      +42     
==========================================
+ Hits        39819    39858      +39     
- Misses      15195    15198       +3

@jerneju jerneju self-requested a review April 20, 2017 13:54
@nikicc nikicc force-pushed the edit-domain-sparse branch 2 times, most recently from c54a56a to 35727c9 Compare April 21, 2017 13:12
@jerneju
Copy link
Contributor

jerneju commented Apr 21, 2017

Can you reduce complexity?

@jerneju jerneju self-assigned this Apr 21, 2017
@nikicc nikicc force-pushed the edit-domain-sparse branch 2 times, most recently from 2516b82 to e4385c6 Compare April 21, 2017 14:27
@jerneju
Copy link
Contributor

jerneju commented Apr 21, 2017

Traceback (most recent call last):
  File "/home/jernej/Projects/Orange2/orange3/Orange/widgets/data/owfile.py", line 241, in select_file
    self.load_data()
  File "/home/jernej/Projects/Orange2/orange3/Orange/widgets/data/owfile.py", line 322, in load_data
    self.apply_domain_edit()  # sends data
  File "/home/jernej/Projects/Orange2/orange3/Orange/widgets/data/owfile.py", line 404, in apply_domain_edit
    domain, cols = self.domain_editor.get_domain(self.data.domain, self.data)
  File "/home/jernej/Projects/Orange2/orange3/Orange/widgets/utils/domaineditor.py", line 280, in get_domain
    col_data = self._to_column(col_data, is_sparse, dtype=object)
  File "/home/jernej/Projects/Orange2/orange3/Orange/widgets/utils/domaineditor.py", line 213, in _to_column
    raise ValueError('Cannot set dtype on sparse matrix.')
ValueError: Cannot set dtype on sparse matrix.

Copy link
Contributor

@jerneju jerneju left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Open corpus file, then iris, and then again corpus.

@nikicc
Copy link
Contributor Author

nikicc commented Apr 21, 2017

@jerneju should be fixed now, please check again.

@jerneju jerneju merged commit 5524ed9 into biolab:master Apr 24, 2017
@nikicc nikicc deleted the edit-domain-sparse branch April 24, 2017 19:45
@jerneju
Copy link
Contributor

jerneju commented Jun 21, 2017

@jerneju
Copy link
Contributor

jerneju commented Jun 21, 2017

@jerneju
Copy link
Contributor

jerneju commented Jun 21, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants