biolab / orange3

🍊 :bar_chart: :bulb: Orange: Interactive data analysis
https://orangedatamining.com
Other
4.89k stars 1.02k forks source link

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

Closed 1324493354ZHOU closed 3 months ago

1324493354ZHOU commented 4 months ago

What's wrong?

How can we reproduce the problem?

What's your environment?

1324493354ZHOU commented 4 months ago

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 commented 4 months ago

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

markotoplak commented 4 months ago

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.

PerryGogas commented 4 months ago

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 commented 4 months ago

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 commented 4 months ago

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 commented 4 months ago

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 commented 3 months ago

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 commented 3 months ago

@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 commented 3 months ago

@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 commented 1 week ago

The version with the fix was finally packaged and released.

PerryGogas commented 1 week ago

Oh! great! thanks!

PG

Professor Periklis Gogas https://econ.duth.gr/author/pgkogkas/ Economic Analysis and International Economics Department of Economics Democritus University of Thrace

Euro Area Business Cycle Network (ECB) - Fellow https://eabcn.org/person/periklis-gogas International Centre for Economic Analysis - Senior Research Fellow https://www.rcea.world/home The Rimini Centre for Economic Analysis - Fellow http://rcea.org/ The Society for Economic Measurement - Member https://sem-society.org/ Institute for Nonlinear Dynamical Inference (INDI) - Charter Fellow http://icemr.ru/institute-for-nonlinear-dynamical-inference/

Associate Editor Open Economies Review https://www.springer.com/journal/11079

The Journal of Economic Asymmetries https://www.sciencedirect.com/journal/the-journal-of-economic-asymmetries

International Journal of Financial Studies https://www.mdpi.com/journal/ijfs

Journal of Banking and Financial Technology https://www.springer.com/journal/42786

(Nature) Humanities and Social Sciences Communications https://www.nature.com/palcomms/

On Wed, 20 Nov 2024 at 11:30, Marko Toplak @.***> wrote:

The version with the fix was finally packaged and released.

— Reply to this email directly, view it on GitHub https://github.com/biolab/orange3/issues/6853#issuecomment-2488015923, or unsubscribe https://github.com/notifications/unsubscribe-auth/BKHRYIWF3BICM3ZN6RRBRZL2BRJB7AVCNFSM6AAAAABLAK6ZVGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDIOBYGAYTKOJSGM . You are receiving this because you were mentioned.Message ID: @.***>