giotto-ai / tutorial_mapper

Other
13 stars 7 forks source link

error importing sklearn.cluster._hierarchical #7

Closed pegger0709 closed 4 years ago

pegger0709 commented 4 years ago

Hi all, I tried to run the notebook myself and noticed a really minor thing: in cluster.py on line 7 it says from sklearn.cluster._hierarchical import _TREE_BUILDERS, _hc_cut That threw an exception, but when I removed the leading underscore on hierarchical, to read from sklearn.cluster.hierarchical import _TREE_BUILDERS, _hc_cut everything works beautifully. Does this need to be changed in general, or is that just a hack that happens to work on my machine? Thanks, Philip

WeilerP commented 4 years ago

Hi @pegger0709, thanks for your feedback! Is it possible that you are using a version of scikit-learn before 0.22? The import statement works for me running scikit-learn==0.22.1.

pegger0709 commented 4 years ago

I'm also using scikit-learn==0.22.1. Strange. Sorry to both you with this.

WeilerP commented 4 years ago

No worries, @pegger0709, could you try downgrading to scikit-learn==0.22.0? I believe we ran into a similar problem previously and this solved it.

WeilerP commented 4 years ago

@pegger0709, I just ran the code in a new environment and fixed scikit-learn==0.22.0. This solved the problem (I also have an error message for scikit-learn==0.22.1 even though the import worked in the terminal). We will update the README file accordingly.