What happened?
The four advanced Sklearn trainers (SVC, SVR, KNN Classifier, KNN Regressor) take their hyperparameters as a table. Each row picks a parameter from a dropdown and supplies a value beside it. The parameter is a real dropdown, backed by an enum. The value is a plain text box carrying nothing at all: no allowed values, no format, no default, not even a title or a description.
Each parameter's legal values are fixed, and the code already knows them. The same enum that fills the dropdown pairs every parameter with the Python converter its text goes through, so C is a float, degree is an int, kernel is a string and probability is a boolean. For the string ones scikit-learn accepts a fixed set of words, and the set differs per parameter: kernel takes one of five, weights one of two, algorithm one of four. Every parameter also has a default of its own in scikit-learn, rbf for kernel and 1.0 for C.
None of that reaches the form. Typing 1 for kernel is accepted by the property editor, saved, and submitted. The run then ends with an error raised inside scikit-learn, naming a constraint the user was never shown. A number behaves the same way: abc in C is accepted and dies in float().
The value is not required either, so a row can pick a parameter, leave the value empty and submit. C then reaches float("") and kernel reaches scikit-learn as an empty string. Which of the two inputs a row needs depends on parametersSource, which decides whether the row reads its value from the text box or from a column, so the requirement is conditional: one of value and attribute is always needed, and neither is declared.
The value should follow the row it sits in. Picking kernel should offer the five words it accepts and nothing else. Picking C should take a number and refuse the rest. Leaving it empty should be caught in the editor.
One parameter cannot be constrained without also correcting it. gamma is declared with the converter float, so the operator emits gamma = float(value). scikit-learn accepts either of the words scale and auto or a non-negative number, and scale is its default, so today neither word survives the converter and the mode most users want is unreachable. Naming str instead only moves the loss to the other half: 0.1 reaches scikit-learn as '0.1' and is refused. The column names a Python expression rather than a type, which the boolean parameters already use for a lambda, so a single converter that hands the two words through and puts everything else past float() carries both kinds of value. The constraint that follows from it is a pattern rather than a set or a type.
Related but separate: #7593 is about two parameters whose declared converter is the wrong one. This is about the value carrying no constraint at all, which affects every parameter in all four trainers.
How to reproduce?
Add an SVM Classifier Trainer, wire a numeric table to its training port and any table to its parameter port, then set the ground truth attribute and the selected features. Add one hyperparameter row, pick kernel, and type 1. The property editor shows no error and the workflow submits. The run ends. Setting C to abc, or leaving the value empty, does the same on the same workflow.
Version/Branch
1.3.0-incubating-SNAPSHOT (main)
Relevant log output
InvalidParameterError: The 'kernel' parameter of SVC must be a str among
{'poly', 'precomputed', 'rbf', 'sigmoid', 'linear'} or a callable. Got '1' instead.
ValueError: could not convert string to float: 'abc'
ValueError: could not convert string to float: ''
ValueError: could not convert string to float: 'scale'
What happened?
The four advanced Sklearn trainers (SVC, SVR, KNN Classifier, KNN Regressor) take their hyperparameters as a table. Each row picks a parameter from a dropdown and supplies a value beside it. The parameter is a real dropdown, backed by an enum. The value is a plain text box carrying nothing at all: no allowed values, no format, no default, not even a title or a description.
Each parameter's legal values are fixed, and the code already knows them. The same enum that fills the dropdown pairs every parameter with the Python converter its text goes through, so
Cis a float,degreeis an int,kernelis a string andprobabilityis a boolean. For the string ones scikit-learn accepts a fixed set of words, and the set differs per parameter:kerneltakes one of five,weightsone of two,algorithmone of four. Every parameter also has a default of its own in scikit-learn,rbfforkerneland 1.0 forC.None of that reaches the form. Typing
1forkernelis accepted by the property editor, saved, and submitted. The run then ends with an error raised inside scikit-learn, naming a constraint the user was never shown. A number behaves the same way:abcinCis accepted and dies infloat().The value is not required either, so a row can pick a parameter, leave the value empty and submit.
Cthen reachesfloat("")andkernelreaches scikit-learn as an empty string. Which of the two inputs a row needs depends onparametersSource, which decides whether the row reads its value from the text box or from a column, so the requirement is conditional: one ofvalueandattributeis always needed, and neither is declared.The value should follow the row it sits in. Picking
kernelshould offer the five words it accepts and nothing else. PickingCshould take a number and refuse the rest. Leaving it empty should be caught in the editor.One parameter cannot be constrained without also correcting it.
gammais declared with the converterfloat, so the operator emitsgamma = float(value). scikit-learn accepts either of the wordsscaleandautoor a non-negative number, andscaleis its default, so today neither word survives the converter and the mode most users want is unreachable. Namingstrinstead only moves the loss to the other half:0.1reaches scikit-learn as'0.1'and is refused. The column names a Python expression rather than a type, which the boolean parameters already use for a lambda, so a single converter that hands the two words through and puts everything else pastfloat()carries both kinds of value. The constraint that follows from it is a pattern rather than a set or a type.Related but separate: #7593 is about two parameters whose declared converter is the wrong one. This is about the value carrying no constraint at all, which affects every parameter in all four trainers.
How to reproduce?
Add an SVM Classifier Trainer, wire a numeric table to its training port and any table to its parameter port, then set the ground truth attribute and the selected features. Add one hyperparameter row, pick
kernel, and type1. The property editor shows no error and the workflow submits. The run ends. SettingCtoabc, or leaving the value empty, does the same on the same workflow.Version/Branch
1.3.0-incubating-SNAPSHOT (main)
Relevant log output