new module with a few sklearn wrappers - #21
Open
jrasero wants to merge 25 commits into
Open
Conversation
In particular, this bug was located in the _transform function, when looping through the test batches to remove the location and scale effects. This bug was introduced after changing the global names of the variables. Also, the keys in bladder_test data have been renamed to follow the same nomenclature that we now use with respect to the previous one (Y, b, X..). Some other typos have been corrected to fulfill code styling.
modified: confounds/sklearn.py
Owner
|
thanks Javi! this looks great. a high level comment on the module name -- given its broader focus, I think a more appropriate name would be I will comment on the code as I review it! |
Owner
|
I just had a quick look, and I feel like its best we review it together, so I follow your motivation and reasoning! I'd have done some things slightly differently so I want to understand what's happening before I ask for or propose specific changes. |
Contributor
Author
|
Sure Pradeep, it makes sense to review this together. |
Owner
|
Wanna do it now? or what time would work for you? |
Contributor
Author
|
I can do it now, yeah. Just give me 5 mins |
Contributor
Author
|
Ready |
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.
This pull request creates a new module, which I called "sklearn_wrappers", that implements basic sklearn functionalities with the inclusion of a deconfounding step. This has the intention of encapsulation in a familiar scikit-learn way, so that It can be easier for new users.
In the current pull request, three main objects have been implemented:
DeconfEstimatorclass, where you pass a deconfounder object from this library and an estimator from scikit-learn. It then first deconfounds the data and feed this to the estimator supplied. It implements the usualfitandpredictmethods.deconfounded_cv_predictanddeconfounded_cv_scorefunctions, intended to mimic the functionscross_val_predictandcross_val_scorefrom scikit-learn. Note that the estimators passed to these functions should be an instance ofDeconfEstimator.The idea with this new module is to include more wrappers in the future.