Repository navigation
BUG/ENH: Two bug fixes and several enhancements to knockoff filter (regression fdr) - #4920
Merged
Merged
Conversation
| import pandas as pd | ||
| from statsmodels.compat.numpy import np_new_unique | ||
|
|
||
| from statsmodels.iolib import summary2 |
Contributor
There was a problem hiding this comment.
One more newline after this pls
| """ | ||
|
|
||
| def __init__(self, model, regularized=False, reg_kws=None): | ||
| self.model = model |
Contributor
There was a problem hiding this comment.
model is used elsewhere to denote a Model instance. For consistency, maybe call this model_cls?
|
|
||
| y = np.random.normal(size=n) | ||
| x = np.random.normal(size=(n, p)) | ||
| for p in 49, 50: |
Contributor
There was a problem hiding this comment.
brackets around 49,50
| x = np.random.normal(size=(n, p)) | ||
|
|
||
| for method in "equi", "sdp": | ||
| testers = [kr.CorrelationEffects(), |
Contributor
There was a problem hiding this comment.
Would it make sense to use pytest.mark.parametrize here?
Codecov Report
@@ Coverage Diff @@
## master #4920 +/- ##
==========================================
+ Coverage 81.34% 81.35% +0.01%
==========================================
Files 581 581
Lines 90053 90084 +31
Branches 10087 10088 +1
==========================================
+ Hits 73253 73289 +36
+ Misses 14506 14501 -5
Partials 2294 2294
Continue to review full report at Codecov.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Bugs:
Forgot to combine the real and knockoff features in init
Modifying exog in-place leads to incorrect scaling
New tests
Enhancements
Summary method
Provide Knockoff+ (guaranteed to control FDR but slightly conservative) as well as Knockoff FDR
New RegModelEffects allows the user to specify which model is used for parameter estimation