kz930 opened a new issue, #7936:
URL: https://github.com/apache/texera/issues/7936
### 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 start on `rbf`. Picking `C` should take a number
and start on 1.0. Leaving it empty should be caught in the editor.
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
```shell
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: ''
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]