Skip to content Skip to sidebar Skip to footer

Latentdirichletallocation Was Not Installed In Decomposition Module Of Scikit-learn

I got some strange problem at SciKit-Learn package. There is 'decomposition' module inside SciKit-Learn package, which should contain LatentDirichletAllocation([…]) function. Se

Solution 1:

I had the same problem today. I solved it by going back to the previous version 0.21 of scikit-learn:

pip3 install scikit-learn==0.21

EDIT: I think the answer from glemaitre (https://stackoverflow.com/a/59328446/10429267) shows a better solution.

Solution 2:

The validated "answered" is not the right fix since it only downgrades scikit-learn. You will not be able to benefit from new features and bug fixes.

It will be helpful instead to report and give feedback in the issue tracker: https://github.com/scikit-learn/scikit-learn/issues/15884

It will allow us to find the root of the problem and propose the proper fix which seems to affect several persons.

EDIT: After some investigation, you need to remove the following files:

  • ~/.local/lib/python3.6/site-packages/sklearn/decomposition/_online_lda.cpython-36m-x86_64-linux-gnu.so
  • ~/.local/lib/python3.6/site-packages/sklearn/feature_extraction/_hashing.cpython-36m-x86_64-linux-gnu.so
  • ~/.local/lib/python3.6/site-packages/sklearn/datasets/_svmlight_format.cpython-36m-x86_64-linux-gnu.so

Apparently, the so files do not get removed when updating to scikit-learn. This might be due to an old pip version.

Solution 3:

Try:


For Python 3

pip3 uninstall scikit-learn
pip3 install -U scikit-learn==0.21.3

For Python 2

pip uninstall scikit-learn
pip install -U scikit-learn==0.20.4

Post a Comment for "Latentdirichletallocation Was Not Installed In Decomposition Module Of Scikit-learn"