-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
MNT: reference the proper variable in bootstrapper #7868
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1941,8 +1941,8 @@ def _bootstrap_median(data, N=5000): | |
M = len(data) | ||
percentiles = [2.5, 97.5] | ||
|
||
ii = np.random.randint(M, size=(N, M)) | ||
bsData = x[ii] | ||
bs_index = np.random.randint(M, size=(N, M)) | ||
bsData = data[bs_index] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @anntzer that looks like it would work too. Not sure that performance would be significantly impacted in either direction. So I'm going to punt of figuring out which is better until the refactor associated with MEP 28 like a mentioned in my comment to Nelle. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. np.random.choice(, ...) is basically implemented as array[np.random.randint(...)] so it's the same. |
||
estimate = np.median(bsData, axis=1, overwrite_input=True) | ||
|
||
CI = np.percentile(estimate, percentiles) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Much better than before! Using underscored
bs_index
next to camelcasedbsData
is a bit strange...bsIndices
would be my choice. but I'm nitpicking :)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The latter is not pep8 compliant, so I'd rather go for the pep8 compliant one though it is not coherent on this particular function.