Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The 'degree' parameter of SVC must be an int in the range [0, inf). Got 2.5 instead #6853

Closed
1324493354ZHOU opened this issue Jul 17, 2024 · 12 comments · Fixed by #6866
Closed
Assignees
Labels
bug A bug confirmed by the core team

Comments

@1324493354ZHOU
Copy link

What's wrong?

How can we reproduce the problem?

What's your environment?

  • Operating system:
  • Orange version:
  • How you installed Orange:
@1324493354ZHOU 1324493354ZHOU added the bug report Bug is reported by user, not yet confirmed by the core team label Jul 17, 2024
@1324493354ZHOU
Copy link
Author

What's wrong?
InvalidParameterError: The 'degree' parameter of SVC must be an int in the range [0, inf). Got 2.5 instead.
How can we reproduce the problem?
Occurs when using SVM classification
What's your environment?
conda
Operating system:win10
Orange version:[Orange 3.37.0 for Windows]
How you installed Orange:Download and install from the official website

@PerryGogas
Copy link

So what is the solution to this? I have the same problem...

@markotoplak
Copy link
Member

I confirm the bug. My scikit-learn (for reference) is 1.3.2.

The problem is not only that the parameter can be 2.5 as in the original error report - scikit-learn complains as soon as it is a float, even if it is 2.0.

@markotoplak markotoplak added bug A bug confirmed by the core team and removed bug report Bug is reported by user, not yet confirmed by the core team labels Jul 31, 2024
@PerryGogas
Copy link

PerryGogas commented Jul 31, 2024

I confirm the bug. My scikit-learn (for reference) is 1.3.2.

The problem is not only that the parameter can be 2.5 as in the original error report - scikit-learn complains as soon as it is a float, even if it is 2.0.

Where is this degree parameter set?
I get: "The 'degree' parameter of SVC must be an int in the range [0, inf). Got 3.0 instead"

image

@markotoplak
Copy link
Member

It is an internal parameter ("d") only relevant to the "Polynomial" kernel, but it seems to be always passed and that check about argument type complains even if it is not used.

It is a bug that has to be fixed in code.

@PerryGogas
Copy link

It is an internal parameter ("d") only relevant to the "Polynomial" kernel, but it seems to be always passed and that check about argument type complains even if it is not used.

It is a bug that has to be fixed in code.

I see. It did not make sense in the linear SVM as it is the degree of the polynomial in the polynomial kernel... But still I get it in the linear SVM node...

@markotoplak
Copy link
Member

While fixing this bug I found a workaround for other types of SVMs. If you are using non-polynomial SVM (or polynomial with a default degree of 3), reset widget settings (Options -> Reset Widget Settings and then start a new workflow). The SVM widget will work correctly until you change the degree.

@PerryGogas
Copy link

While fixing this bug I found a workaround for other types of SVMs. If you are using non-polynomial SVM (or polynomial with a default degree of 3), reset widget settings (Options -> Reset Widget Settings and then start a new workflow). The SVM widget will work correctly until you change the degree.

Does not work for me. Still I cannot train any SVM models despite the fact that the problem is with the SVM-Polynomial.

@markotoplak
Copy link
Member

@PerryGogas, for the workaround to work you have to clear settings and then NOT used saved workflows. You will have to make a new workflow.

@PerryGogas
Copy link

@PerryGogas, for the workaround to work you have to clear settings and then NOT used saved workflows. You will have to make a new workflow.

Ohhh I see many thanks!!!

@markotoplak
Copy link
Member

The version with the fix was finally packaged and released.

@PerryGogas
Copy link

PerryGogas commented Nov 21, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A bug confirmed by the core team
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants