Closed apavlo89 closed 7 months ago
This is odd because imblearn is already installed on Google Colab as it is a related project to sklearn. When I run this code below it runs without error. Further, Google Colab has the newest version of imblearn installed (check this with import imblearn and then imblearn.version you should see version 0.10.1. Instead of uninstalling and reinstalling packages, consider creating a new notebook on Google Colab cloud notebook and see if the error persists. A similar error was found relating to the relation between sci-kit learn version causing issues with imblearn (see this issue), but it is unlikely that is the case here.
# code I ran from a new notebook on Google Colab that ran witrhout ImportError
import numpy as np
import pandas as pd
from imblearn.over_sampling import ADASYN
X_train = pd.DataFrame(np.random.rand(100, 3), columns=['f1', 'f2', 'f3'])
y_train = pd.Series(np.random.randint(2, size=100))
adasyn = ADASYN(random_state=42)
X_train_resampled, y_train_resampled = adasyn.fit_resample(X_train, y_train)
X_train_resampled_df = pd.DataFrame(X_train_resampled, columns=X_train.columns)
y_train_resampled_df = pd.Series(y_train_resampled)
I also cannot reproduce even after updating imbalanced-learn using pip
.
Hello @glemaitre could you solve this issue? I have the same problem and i haven't found any solution
Trying to run ADASYN on google collab notebook (Python 3.10.12) and i get this error: ImportError: cannot import name '_check_X' from 'imblearn.utils._validation' (/usr/local/lib/python3.10/dist-packages/imblearn/utils/_validation.py)
Weird right? I've tried uninstalling and reinstalling all packages but can't make this error disappear. Any suggestions? This is the code I am running:
Here is the full error log: