0

I tried to install KElbowVisualizer and SilhouetteVisualizer from the yellowbrick.model_selection module as well as yellowbrick.cluster module . However, I'm facing the following problem. I tried to follow some of the directions provided in threads related to this topic but nothing worked.

  1. Tried below code but it didn't work; still throwing the error. try: #1137: this allows compatibility for scikit-learn >= 0.24 from sklearn.utils import safe_indexing except ImportError: from sklearn.utils import _safe_indexing

  2. Executed all the below commands: conda update scikit-learn conda install -c districtdatalabs yellowbrick conda update --all as well from the Conda shell

  3. I've executed below command but still error is not resolved. pip install -U scikit-learn --user

Please advise. Thanks! /from yellowbrick.cluster import KElbowVisualizer, SilhouetteVisualizer ImportError: cannot import name 'safe_indexing' from 'sklearn.utils' (\AppData\Roaming\Python\Python38\site-packages\sklearn\utils_init_.py)/

SRK
  • 1
  • 1
  • I ran into this issue because of the version conflict between scikit-learn and yellowbrick possibly because I have installed yellowbricks directly using these commands: $ pip install yellowbrick When I ran below commands, it resolved my issue. pip uninstall scikit-learn yellowbrick pip install scikit-learn yellowbrick – SRK Feb 26 '23 at 02:58

0 Answers0