question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

TypeError: __init__() got an unexpected keyword argument 'positive'

See original GitHub issue

Hello, 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:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
VijayAnaparthicommented, Mar 30, 2021

I faced the same issue and updated the scikit-learn version and it’s working perfectly now. The version has to be >=0.24.

0reactions
NicolasHugcommented, Jan 21, 2021

@haijijielov you need to install the latest version (>= 0.24)

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found