You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
silhouette_samples/silhouette_score: metric_params collides with pinned arguments #713
Passing metric_params={"be": ...} (or **kwds with be) to tslearn.clustering.silhouette_samples raises TypeError: got multiple values for keyword argument 'be', because the kwds are merged into metric_params_ and splatted into a call that already pins be=be.
Suggested fix
Treat be like n_jobs/verbose: strip it from metric_params_ (the backend is already pinned by instantiate_backend(X)), or explicitly reject it with a clear message. At minimum, document that be cannot be forwarded.
Metadata
Severity: P2
Confidence: 100
Reviewer(s): adversarial (ce-code-review run 20260821-221628-4e205155 on PR #703)
Finding ID: tslearn/clustering/utils.py:347 metric_params={'be': ...} collides with the backend argument
I guess the same is true fro silhouette_score, with the addition of the verbose param not being properly handled in silhouette_score.
Also metric_params parameter documentations of both function need to be updated accordingly.
changed the title [-]silhouette_samples: metric_params containing 'be' collides with pinned backend argument[/-][+]silhouette_samples/silhouette_score: metric_params collides with pinned arguments[/+]on Aug 26, 2026
I would like to take this and include the matching silhouette_score behavior noted above in one focused PR. I will strip backend/parallelism parameters that are already pinned by the public arguments before forwarding metric parameters, document the override behavior for both functions, and add regression tests for both metric_params and direct keyword input. I will leave the separate precomputed behavior from #714 unchanged.
Activity
charavelg commentedon Aug 26, 2026
I guess the same is true fro silhouette_score, with the addition of the verbose param not being properly handled in silhouette_score.
Also
metric_paramsparameter documentations of both function need to be updated accordingly.Would be nice to pack this into a single PR.
[-]silhouette_samples: metric_params containing 'be' collides with pinned backend argument[/-][+]silhouette_samples/silhouette_score: metric_params collides with pinned arguments[/+]WilliamK112 commentedon Aug 26, 2026
I would like to take this and include the matching
silhouette_scorebehavior noted above in one focused PR. I will strip backend/parallelism parameters that are already pinned by the public arguments before forwarding metric parameters, document the override behavior for both functions, and add regression tests for bothmetric_paramsand direct keyword input. I will leave the separate precomputed behavior from #714 unchanged.