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:
A number converts cleanly and scikit-learn rejects the result:
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)
What happened?
SklearnAdvancedKNNParameterspairs 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.metricis declaredint, so the operator emitsmetric = int(value). Its values are words likeminkowski, which raises:A number converts cleanly and scikit-learn rejects the result:
What converts is not accepted and what is accepted does not convert. One word fixes it:
str, asweightsandalgorithmbeside it already are.metric_paramsis 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 itminkowski, then3. Pickingp,weights,algorithmorleaf_sizeinstead runs fine on the same workflow.Version/Branch
1.3.0-incubating-SNAPSHOT (main)