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

Feature/dim reduction #27

Merged
merged 9 commits into from
Sep 23, 2019
Merged

Feature/dim reduction #27

merged 9 commits into from
Sep 23, 2019

Conversation

ots22
Copy link
Member

@ots22 ots22 commented Sep 19, 2019

Adds a (python-only) implementation of the gKDR algorithm for dimension reduction

@ots22 ots22 requested a review from edaub September 19, 2019 15:56
@edaub
Copy link
Collaborator

edaub commented Sep 20, 2019

A few comments, mostly it looks good.

I would explicitly check the value of K, as it is potentially ambiguous where the problem is if it has a bad value as it won't raise an error until you call __call__ even though the problem arose on calling __init__. I think a negative value should still run to completion without incident; however it leads to a situation where you specify the number of dimensions to drop rather than keep. If you want to allow that I might make that behavior more explicit in the documentation.

Relatedly, you may also want to provide exposed get/set interfaces to K, as it can be changed independently of the solving routine to generate the reduced dimension space. Users may not know the number of dimensions at the start, so this might be a nice way to let them easily play around with the choice without having it perform the full calculation each time.

You may also want to check positivity on EPS -- it might be unclear what the problem is if it has a large enough negative value to produce a singular matrix.

You divide by SGX2 (and SGY2 when forming the gram matrix), you may want to check these are not zero. Though the cause of this is likely to be clear enough so up to you how to handle this.

Minor thing: I have noticed that if my docstrings contain backslashes for LaTeX typesetting, Python will sometimes complain through a deprecation warning. This is fixed by making the docstrings raw strings.

@ots22 ots22 force-pushed the feature/dim-reduction branch from 49489fa to 6ac9f29 Compare September 20, 2019 17:24
@codecov-io
Copy link

codecov-io commented Sep 20, 2019

Codecov Report

Merging #27 into devel will increase coverage by 0.36%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff            @@
##           devel      #27      +/-   ##
=========================================
+ Coverage   86.7%   87.07%   +0.36%     
=========================================
  Files         17       19       +2     
  Lines       3429     3527      +98     
=========================================
+ Hits        2973     3071      +98     
  Misses       456      456
Impacted Files Coverage Δ
mogp_emulator/DimensionReduction.py 100% <100%> (ø)
mogp_emulator/__init__.py 100% <100%> (ø) ⬆️
mogp_emulator/tests/test_DimensionReduction.py 100% <100%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0cdd4aa...ea7b974. Read the comment docs.

@ots22
Copy link
Member Author

ots22 commented Sep 23, 2019

Thanks for the comments @edaub - added some checks. I'll leave setting K out of the interface for now.

@ots22 ots22 merged commit be1ef5c into devel Sep 23, 2019
@JimMadge JimMadge deleted the feature/dim-reduction branch March 11, 2020 15:00
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