kz930 opened a new issue, #7945:
URL: https://github.com/apache/texera/issues/7945

   ### What happened?
   
   `SklearnAdvancedSVCParameters` and `SklearnAdvancedSVRParameters` pair each 
hyperparameter with the Python callable that converts the user's text. `gamma` 
names `float`, so the operator emits `gamma = float(value)`.
   
   scikit-learn accepts two different kinds of value for this parameter: one of 
the words `scale` and `auto`, or a non-negative number. `scale` is the default, 
and it is what makes the estimator derive gamma from the training data rather 
than having it pinned to a constant. Under `float` neither word survives:
   
   ```
   float('scale') -> ValueError: could not convert string to float: 'scale'
   ```
   
   So the parameter can only ever be given an explicit number, and the mode 
most users want is unreachable.
   
   Naming `str` instead does not fix it, it only moves the loss to the other 
half. `str` turns `0.1` into the string `'0.1'`, which scikit-learn then 
refuses:
   
   ```
   The 'gamma' parameter of SVC must be a str among {'auto', 'scale'} or a 
float in the range [0.0, inf). Got '0.1' instead.
   ```
   
   The difficulty is that `ParamClass` gives each hyperparameter exactly one 
converter, and this one needs to carry both a word and a number. A converter 
that tries `float` and falls back to the text would cover it, as would letting 
a parameter declare more than one.
   
   Related but not the same: #7593 covers two KNN parameters whose declared 
converter is simply the wrong one, and a single word fixes each. This one 
cannot be fixed by choosing a different converter, because no single converter 
covers both kinds of value.
   
   ### 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 `gamma`, and give it 
`scale`. The run ends. `auto` behaves the same. A number such as `0.1` runs 
fine, which is the only way the parameter can be used today. The SVM Regressor 
Trainer behaves identically.
   
   ### Version/Branch
   
   1.3.0-incubating-SNAPSHOT (main)
   
   ### Relevant log output
   
   ```shell
   ValueError: could not convert string to float: 'scale'
   ```
   


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

Reply via email to