scikit-learn-contrib / imbalanced-learn

A Python Package to Tackle the Curse of Imbalanced Datasets in Machine Learning
https://imbalanced-learn.org
MIT License
6.85k stars 1.29k forks source link

[BUG] ImportError: cannot import name '_get_column_indices' #1081

Closed ThomasMGeo closed 6 months ago

ThomasMGeo commented 6 months ago

Describe the bug

Import error:

ImportError: cannot import name '_get_column_indices' from 'sklearn.utils' (/opt/conda/envs/rmacc-2024/lib/python3.12/site-packages/sklearn/utils/__init__.py)

Steps/Code to Reproduce

This is the line of code that causes it to barf:

from imblearn.under_sampling import RandomUnderSampler

Sample code to reproduce the problem

Expected Results

Actual Results

Versions

System: python: 3.12.3 | packaged by conda-forge | (main, Apr 15 2024, 18:38:13) [GCC 12.3.0] executable: /opt/conda/envs/rmacc-2024/bin/python machine: Linux-5.15.0-105-generic-x86_64-with-glibc2.35

Python dependencies: sklearn: 1.5.0 pip: 24.0 setuptools: 69.5.1 numpy: 1.26.4 scipy: 1.13.0 Cython: None pandas: 2.2.2 matplotlib: 3.8.4 joblib: 1.4.2 threadpoolctl: 3.5.0

Built with OpenMP: True

threadpoolctl info: user_api: blas internal_api: openblas num_threads: 8 prefix: libopenblas filepath: /opt/conda/envs/rmacc-2024/lib/libopenblasp-r0.3.27.so version: 0.3.27 threading_layer: pthreads architecture: Zen

   user_api: openmp

internal_api: openmp num_threads: 8 prefix: libgomp filepath: /opt/conda/envs/rmacc-2024/lib/libgomp.so.1.0.0 version: None Linux-5.15.0-105-generic-x86_64-with-glibc2.35 Python 3.12.3 | packaged by conda-forge | (main, Apr 15 2024, 18:38:13) [GCC 12.3.0] NumPy 1.26.4 SciPy 1.13.0 Scikit-Learn 1.5.0

Zethson commented 6 months ago

https://github.com/scikit-learn-contrib/imbalanced-learn/commit/53f4e4a48f3fe61ca21144b27bb6e230ff5e0d23

already fixed, but we urgently need a release

ThomasMGeo commented 6 months ago

oh thanks! Would scikit-learn version 1.2-1.4 be safe?

Zethson commented 6 months ago

Yes, but the fix is for @glemaitre to make a release

esoreq commented 6 months ago

Is there an update on this?

typhonshambo commented 6 months ago

is there any developer or pre-release version which, i can install?

glemaitre commented 6 months ago

There will be no release before next week. I cannot commit time for it. There is 2 temporary way:

glemaitre commented 6 months ago

imbalanced-learn 0.12.3 is released on PyPI and will be shortly available in conda-forge.

esoreq commented 6 months ago

[celebrate] Soreq, Eyal reacted to your message:


From: Guillaume Lemaitre @.> Sent: Tuesday, May 28, 2024 3:23:14 PM To: scikit-learn-contrib/imbalanced-learn @.> Cc: Soreq, Eyal @.>; Comment @.> Subject: Re: [scikit-learn-contrib/imbalanced-learn] [BUG] ImportError: cannot import name '_get_column_indices' (Issue #1081)

This email from @.*** originates from outside Imperial. Do not click on links and attachments unless you recognise the sender. If you trust the sender, add them to your safe senders listhttps://spam.ic.ac.uk/SpamConsole/Senders.aspx to disable email stamping for this address.

imbalanced-learn 0.12.3 is released on PyPI and will be shortly available in conda-forge.

— Reply to this email directly, view it on GitHubhttps://github.com/scikit-learn-contrib/imbalanced-learn/issues/1081#issuecomment-2135508133, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AIMOSDQ66K4TQVZBLNFWXJDZESOOFAVCNFSM6AAAAABICFAKSSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMZVGUYDQMJTGM. You are receiving this because you commented.Message ID: @.***>