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] PCA - Output instance of table subclass when instance of table subclass on input #6536

Merged
merged 2 commits into from
Aug 18, 2023

Conversation

PrimozGodec
Copy link
Contributor

Issue

When PCA receives Corpus on input, Transformed Data outputs Corpus instance while Data outputs Table.

Description of changes

Data output outputs the instance of Table subclass (e.g. Corpus) in the described situation.

Includes
  • Code changes
  • Tests
  • Documentation

@codecov
Copy link

codecov bot commented Aug 17, 2023

Codecov Report

Merging #6536 (981317c) into master (f531854) will increase coverage by 0.00%.
Report is 2 commits behind head on master.
The diff coverage is 100.00%.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #6536   +/-   ##
=======================================
  Coverage   87.68%   87.68%           
=======================================
  Files         321      321           
  Lines       69403    69406    +3     
=======================================
+ Hits        60857    60860    +3     
  Misses       8546     8546           

@@ -355,10 +355,9 @@ def commit(self):
self.data.domain.attributes,
self.data.domain.class_vars,
self.data.domain.metas + domain.attributes)
data = Table.from_numpy(
data_dom, self.data.X, self.data.Y,
numpy.hstack((self.data.metas, transformed.X)),
Copy link
Member

@markotoplak markotoplak Aug 17, 2023

Choose a reason for hiding this comment

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

How about replacing everything about this output with the code below? Sure, then, these are transformed twice, but I think this transformation is fast enough so that we do not need to worry.

data = self.data.transform(add_columns(self.data.domain,
                                                   metas=domain.attributes))

This is what @noahnovsak did on the dask brach.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Forgot about this option. It is done now.

Copy link
Member

Choose a reason for hiding this comment

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

Now you do not need the next part (under with:)

@PrimozGodec PrimozGodec force-pushed the fix-pca branch 2 times, most recently from 137367a to 75399dc Compare August 17, 2023 13:09
@PrimozGodec PrimozGodec changed the title PCA - Output instance of table subclass when instance of table subclass on input [FIX] PCA - Output instance of table subclass when instance of table subclass on input Aug 17, 2023
@markotoplak markotoplak merged commit 1725baa into biolab:master Aug 18, 2023
22 of 23 checks passed
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.

2 participants