rasbt / mlxtend

A library of extension and helper modules for Python's data analysis and machine learning libraries.
https://rasbt.github.io/mlxtend/
Other
4.85k stars 857 forks source link

TypeError: 'module' object is not callable (from mlxtend.evaluate import bias_variance_decomp) #865

Closed Bahar1978 closed 2 years ago

Bahar1978 commented 2 years ago

I could always use from mlxtend.evaluate import bias_variance_decomp) but today when I wanted to use this function , I faced the typeError: I tried the example of http://rasbt.github.io/mlxtend/user_guide/evaluate/bias_variance_decomp/ and also https://machinelearningmastery.com/calculate-the-bias-variance-trade-off/ that worked before for me but today following both ways I got the error. Could you please let me know if you updated something regarding to bias_variance_decomp?

rasbt commented 2 years ago

Can you print the mlxtend version?

import mlxtend
print(mlxtend.__version__)
Bahar1978 commented 2 years ago

Thanks for the fast reply. Here is the result:
Requirement already satisfied: mlxtend in /usr/local/lib/python3.7/dist-packages (0.19.0) But now I just used "import mlxtend" and then checked the version and it worked. I just used the following code that did not work: from mlxtend.evaluate import bias_variance_decomp So it works if I first "import mlxtend". Thanks again and there is no issue :).

rasbt commented 2 years ago

Glad it works now! And huh, that's weird. In my case, without importing mlxtend first, I can run

from mlxtend.evaluate import bias_variance_decomp

without issues. Anyways, glad it works for you now.