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

Added compatibility with correction matrix #61

Conversation

NehaBari
Copy link

  1. Pulled changes from upstream to forked repo.
  2. Changed line 234 in _gmlvq.py to accept relevance correction as a parameter.

@codecov
Copy link

codecov bot commented May 20, 2021

Codecov Report

Attention: Patch coverage is 0% with 5 lines in your changes missing coverage. Please review.

Project coverage is 99.01%. Comparing base (9318944) to head (3904477).
Report is 76 commits behind head on fr-51-null-space-correction.

Files with missing lines Patch % Lines
sklvq/models/_gmlvq.py 0.00% 2 Missing and 3 partials ⚠️
Additional details and impacted files
@@                       Coverage Diff                       @@
##           fr-51-null-space-correction      #61      +/-   ##
===============================================================
- Coverage                        99.29%   99.01%   -0.28%     
===============================================================
  Files                               52       54       +2     
  Lines                             1550     1622      +72     
  Branches                           133      142       +9     
===============================================================
+ Hits                              1539     1606      +67     
- Misses                               1        5       +4     
- Partials                            10       11       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@rickvanveen rickvanveen marked this pull request as draft May 21, 2021 13:20
@rickvanveen rickvanveen added this to the v0.2 milestone May 21, 2021
@rickvanveen rickvanveen linked an issue May 21, 2021 that may be closed by this pull request
@rickvanveen
Copy link
Owner

@NehaBari Good work! I changed it to a "draft" pull request, because some things need to happen before it can be accepted:

The codecov checks fail, this means that the test coverage of the project goes down and the method should be tested. The tests are located in the module's test folder (i.e., sklvq/models/tests). In the test_gmlvq.py file you should make a function called test_relevance_correction and add a simple example for which you know the answer (unit eigenvectors for example). See other test for inspiration.

Secondly, could you remove the old code (instead of commenting it out). We don't need the old (wrong) solution in the comments when using version control :-)

Thirdly, we should think about including an example in the documentation, i.e., an example that will be shown in sklvq.readthedocs.io. The examples that you see there are located here.

@NehaBari
Copy link
Author

Dear Rick,

Thankyou for the detailed feedback. Sounds good. I will start incorporating them.

NehaBari added 2 commits May 23, 2021 22:48
Given matrices A and B so that the operations can be pre-formed

properties of a transpose
Given matrices A and B so that the operations can be pre-formed
properties of a transpose

removed some comments
@rickvanveen rickvanveen marked this pull request as ready for review May 24, 2021 06:42
@rickvanveen rickvanveen marked this pull request as draft May 24, 2021 06:43
@@ -385,7 +386,7 @@ def _normalize_omega(omega: np.ndarray) -> None:

def _correct_omega(self, omega: np.ndarray) -> None:
# Note matmul is faster for larger matrices, for smaller dot is faster.
np.matmul(omega.T, self.relevance_correction, out=omega.T)
np.matmul(self.relevance_correction,omega,out=omega.T)
Copy link
Owner

@rickvanveen rickvanveen May 24, 2021

Choose a reason for hiding this comment

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

@NehaBari Are you sure this is correct and you did not change the way the correction matrix was defined? Would be good to add this to the tests.

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

Successfully merging this pull request may close these issues.

Add null-space correction
2 participants