You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
RandomUnderSampler performs checks on X argument, which are unnecessary, as they do not affect the choice of resampled indices.
This is an issue if I pass pandas DataFrame.
The exception is not risen if I pass a numpy object with timestamps.
Steps/Code to Reproduce
from datetime import datetime
import pandas as pd
df = pd.DataFrame({"label": [0,0,0,1], "td": [datetime.now()]*4})
rus = imblearn.under_sampling.RandomUnderSampler(random_state=2342374)
rus.fit_resample(df, df.label)
Expected Results
No error is thrown.
Actual Results
TypeError: The DType <class 'numpy.dtype[int64]'> could not be promoted by <class 'numpy.dtype[datetime64]'>. This means that no common DType exists for the given inputs. For example they cannot be stored in a single array unless the dtype is `object`. The full list of DTypes is: (<class 'numpy.dtype[int64]'>, <class 'numpy.dtype[datetime64]'>)
Uh oh!
There was an error while loading. Please reload this page.
Describe the bug
RandomUnderSampler
performs checks onX
argument, which are unnecessary, as they do not affect the choice of resampled indices.This is an issue if I pass pandas DataFrame.
The exception is not risen if I pass a numpy object with timestamps.
Steps/Code to Reproduce
Expected Results
No error is thrown.
Actual Results
Versions
My current workaround
P.S. Huge thanks for this useful library.
The text was updated successfully, but these errors were encountered: