new module with a few sklearn wrappers#21
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:
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.