You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@texera.apache.org by "kz930 (via GitHub)" <gi...@apache.org> on 2026/08/12 05:49:16 UTC
[I] The KNN trainers' `metric` and `metric_params` cannot be given a working value [texera]
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: notifications-unsubscribe@texera.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] The KNN trainers' `metric` and `metric_params` cannot be given a working value [texera]
Posted by "aglinxinyuan (via GitHub)" <gi...@apache.org>.
aglinxinyuan closed issue #7593: The KNN trainers' `metric` and `metric_params` cannot be given a working value
URL: https://github.com/apache/texera/issues/7593
--
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: notifications-unsubscribe@texera.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] The KNN trainers' `metric` and `metric_params` cannot be given a working value [texera]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on issue #7593:
URL: https://github.com/apache/texera/issues/7593#issuecomment-5262891573
<!-- texera:template-compliance -->
👋 Thanks for opening this issue, @kz930!
It looks like the issue description doesn't quite follow our template yet:
- This issue doesn't appear to use one of our templates (Bug, Feature, or Task). Please open it using a template so the required details are captured.
Filling out the template helps reviewers understand and triage your contribution faster. Please edit the description to complete it. This message will disappear automatically once the template is followed.
You can find the template prompts by editing the description, or see [CONTRIBUTING.md](https://github.com/apache/texera/blob/main/CONTRIBUTING.md) for the full contribution flow.
--
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: notifications-unsubscribe@texera.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org