0

I have a little probleme with the sklearn library. I am trying to import a module named 'pls' and I have en error

ImportError: cannot import name 'pls'

I tried to do like this post: adding-a-module-specifically but I have no 'pls' file in my 'sklearn' file.

Even after upgraded my sklearn version with pip install -U scikit-learn... It says it is already up-to-date.

Any idea ? Thanks for your help, and pardon my english :P

1 Answers1

0

Python cannot magically know that the pls module you want is inside sklearn. You need to specify it. Also the sklearn version 0.11 is many years old, things have moved since then. With scikt-learn 0.20, the right way is:

from sklearn.cross_decomposition import PLSRegression

estimator = PLSRegression()
Jon Nordby
  • 5,494
  • 1
  • 21
  • 50