GithubHelp home page GithubHelp logo

[BUG] ImportError: cannot import name '_check_X' from 'imblearn.utils._validation' (/usr/local/lib/python3.10/dist-packages/imblearn/utils/_validation.py) about imbalanced-learn HOT 2 CLOSED

apavlo89 avatar apavlo89 commented on June 3, 2024
[BUG] ImportError: cannot import name '_check_X' from 'imblearn.utils._validation' (/usr/local/lib/python3.10/dist-packages/imblearn/utils/_validation.py)

from imbalanced-learn.

Comments (2)

jawadkazi avatar jawadkazi commented on June 3, 2024

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)

from imbalanced-learn.

glemaitre avatar glemaitre commented on June 3, 2024

I also cannot reproduce even after updating imbalanced-learn using pip.

from imbalanced-learn.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.