ENH dataframe in/out for all samplers#644
ENH dataframe in/out for all samplers#644glemaitre merged 5 commits intoscikit-learn-contrib:masterfrom
Conversation
|
This pull request introduces 1 alert when merging e936bdd into 45b538c - view on LGTM.com new alerts:
|
Codecov Report
@@ Coverage Diff @@
## master #644 +/- ##
=========================================
+ Coverage 97.96% 98.5% +0.54%
=========================================
Files 83 82 -1
Lines 4867 4888 +21
=========================================
+ Hits 4768 4815 +47
+ Misses 99 73 -26
Continue to review full report at Codecov.
|
|
I thought that you were against on using |
|
I am still against. Before sampling I am duck typing. At the moment to recreate the database if we have the columns name it means that we gave us a database meaning that the user has pandas. So in this case only I am importing pandas to call the dataframe constructor.
Pandas can still be an optional dependence then.
|
|
This pull request introduces 1 alert when merging b1d2d56 into 45b538c - view on LGTM.com new alerts:
|
|
This pull request introduces 1 alert when merging 9431bb8 into 45b538c - view on LGTM.com new alerts:
|
|
@chkoar Would you have a bit of time too look at it. |
|
This pull request introduces 1 alert when merging 2f93b40 into 153f6e0 - view on LGTM.com new alerts:
|
|
I will give it a go soon |
| if self._columns is not None: | ||
| import pandas as pd | ||
| X_ = pd.DataFrame(output[0], columns=self._columns) | ||
| else: | ||
| X_ = output[0] | ||
|
|
There was a problem hiding this comment.
Why not doing this in _check_X_y?
There was a problem hiding this comment.
This block required the resampled data so _check_X_y is called before that the resampling happened.
There was a problem hiding this comment.
Ok. It is like we need to extracted it in an internal transformation method. But I am ok as is.
|
Is there a case where something that will pass, it will have |
We always ducktype like this in scikit-learn for dataframe. So if it passes in imblearn it will break in scikit-learn just with the |
|
Go ahead! |
Reference Issue
closes #639
What does this implement/fix? Explain your changes.
Let dataframe out if they got in.
TODO:
Any other comments?