TypeError: __init__() got an unexpected keyword argument 'positive'
See original GitHub issueHello, my version is scikit-learn-0.24.1
Describe the bug
~/miniconda3/lib/python3.8/site-packages/sklearn/utils/validation.py in inner_f(*args, **kwargs) 70 warnings.warn(f"Pass {args_msg} as keyword args. From version " 71 f"{version} passing these as positional arguments " —> 72 “will result in an error”, FutureWarning) 73 kwargs.update(zip(sig.parameters, args)) 74 return f(**kwargs)
TypeError: init() got an unexpected keyword argument ‘positive’
Steps/Code to Reproduce
from sklearn.linear_model import LinearRegression
reg_nnls = LinearRegression(positive=True)
Expected Results
Actual Results
Versions
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:5 (3 by maintainers)
Top Results From Across the Web
python - SKLearn: TypeError: __init__() got an unexpected ...
Open your terminal (cmd) and try these before you try to import the sklearn. pip install -U scikit-learn. or if you have anaconda...
Read more >init__() got an unexpected keyword argument 'max_iter'?
TypeError : init() got an unexpected keyword argument 'max_iter'. I m running the linear regression code in Community edition. Google says reinstall --....
Read more >Python TypeError: __init__() got an unexpected keyword ...
1 Answer 1 · It's because that's the basic structure of the classifier but the parameters can be changed as per the requirement....
Read more >TypeError: __init__() got an unexpected keyword argument ...
The TypeError: init () got an unexpected keyword argument 'unbound_message' occurs when using an old version of Werkzeug with a more recent ...
Read more >TypeError: __init__() got an ... - NVIDIA Developer Forums
Good day, I get this Type Error : TypeError: init() got an unexpected keyword argument 'ragged' when running: detectnet_v2 train -e ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I faced the same issue and updated the scikit-learn version and it’s working perfectly now. The version has to be >=0.24.
@haijijielov you need to install the latest version (>= 0.24)