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

   ### What happened?
   
   `SklearnAdvancedKNNParameters` pairs each hyperparameter with the Python 
callable that converts the user's text. Two of the six name one that cannot 
produce what scikit-learn accepts, so choosing either fails the run whatever is 
typed. They sit in the same dropdown as the four that work.
   
   `metric` is declared `int`, so the operator emits `metric = int(value)`. Its 
values are words like `minkowski`, which raises:
   
   <img width="995" height="882" alt="metric = minkowski" 
src="https://github.com/user-attachments/assets/fbad5611-b848-49c6-86bf-1546754eb5a9";
 />
   
   A number converts cleanly and scikit-learn rejects the result:
   
   <img width="988" height="931" alt="metric = 3" 
src="https://github.com/user-attachments/assets/fc7db3a7-a000-4989-ad0c-9216a43c9b40";
 />
   
   What converts is not accepted and what is accepted does not convert. One 
word fixes it: `str`, as `weights` and `algorithm` beside it already are.
   
   `metric_params` is a different problem. It wants a dict, and none of the 
converters on offer — `int`, `float`, `str` — returns one, so no naming choice 
helps. A well-formed `{"p": 2}` arrives as the string `'{"p": 2}'`. Either the 
field needs a way to carry structured input, or it should leave the dropdown.
   
   Both affect the classifier and the regressor.
   
   ### How to reproduce?
   
   Add a KNN Classifier Trainer with a numeric table on its training port and 
any table on its parameter port, set the ground truth and features, then add 
one hyperparameter row and pick `metric`. Give it `minkowski`, then `3`. 
Picking `p`, `weights`, `algorithm` or `leaf_size` instead runs fine on the 
same workflow.
   
   ### Version/Branch
   
   1.3.0-incubating-SNAPSHOT (main)
   


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