Skip to content

Conversation

lionelkusch
Copy link
Collaborator

I reformat the Gaussian estimation of knockoff in the format of classes, as conditional sampling.
I moved all the conditional samplers into statistical_tool.

Copy link

codecov bot commented Aug 29, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.91%. Comparing base (bafa4ed) to head (90f8455).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #366      +/-   ##
==========================================
- Coverage   98.10%   97.91%   -0.20%     
==========================================
  Files          22       20       -2     
  Lines        1161     1053     -108     
==========================================
- Hits         1139     1031     -108     
  Misses         22       22              

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Collaborator

@bthirion bthirion left a comment

Choose a reason for hiding this comment

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

Thx for this refactoring. I have two relatively minor comments.

Copy link
Collaborator

@jpaillard jpaillard left a comment

Choose a reason for hiding this comment

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

Thanks, I agree that having both samplers implemented as classes makes sense.

Copy link
Collaborator

@jpaillard jpaillard left a comment

Choose a reason for hiding this comment

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

I think it limits extra work to integrate the test in this PR rather than having to fix something in an upcoming one. I made a suggestion for the tests.

Copy link
Collaborator

@bthirion bthirion left a comment

Choose a reason for hiding this comment

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

The PR is almost ready to merge

)
generator.fit(X=X)
X_tilde = generator.sample()
assert X_tilde.shape == (n, p)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Sounds like a smoke test.
Maybe you could add assert np.linalg.norm(X - X_tilde) < np.linalg.norm(X) (assuming that this test works)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This assertion doesn't work.
For the moment, I don't do the test of functionalities. I just have tests for the coverage.
I don't want to over load the Pull Request.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Then np.linalg.norm(X - X_tilde) < np.sqrt(2) * np.linalg.norm(X) should work
But we need to test that the generated knockoffs are not crazy.

d = np.eye(n)
sigma = u * d * u.T
_s_equi(sigma)

Copy link
Collaborator

Choose a reason for hiding this comment

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

final assert ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I did one test, tell me if it's ok.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Sorry, I mean that we should either drop lines 62-67 or add a finall assert.

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