AttributeError: module 'sklearn' has no attribute 'decomposition' code example
Example: AttributeError: module 'sklearn' has no attribute 'decomposition'
sklearn does not automatically import its subpackages.
If you only imported via: import sklearn
then it wont work.
Import with importsklearn.<you subpackage> instead.