-
Notifications
You must be signed in to change notification settings - Fork 14
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
new module with a few sklearn wrappers #21
base: master
Are you sure you want to change the base?
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
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! |
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. |
Sure Pradeep, it makes sense to review this together. |
Wanna do it now? or what time would work for you? |
I can do it now, yeah. Just give me 5 mins |
Ready |
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:
DeconfEstimator
class, 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 usualfit
andpredict
methods.deconfounded_cv_predict
anddeconfounded_cv_score
functions, intended to mimic the functionscross_val_predict
andcross_val_score
from 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.