Skip to content

silhouette_samples(metric='precomputed') silently ignores metric_params, n_jobs, verbose #714

Description

@SomSamantray

Problem

tslearn.clustering.silhouette_samples(X, labels, metric="precomputed", metric_params=..., n_jobs=..., verbose=...) silently drops all of metric_params, **kwds, n_jobs, and verbose. The docstring promises metric_params and **kwds are passed to the distance function, and silhouette_score raises on unexpected kwargs via sklearn forwarding, so the silent no-op is a contract inconsistency on the new API surface.

Suggested fix (design call)

Either (a) raise TypeError for any non-None metric_params/n_jobs/verbose/**kwds on the precomputed branch (loud rejection, parity with silhouette_score), or (b) explicitly document that these are ignored when metric == "precomputed".

Metadata

Severity: P3
Confidence: 75
Reviewer(s): api-contract, adversarial (ce-code-review run 20260821-221628-4e205155 on PR #703)
Finding ID: tslearn/clustering/utils.py:330 silhouette_samples(metric="precomputed") silently drops metric_params

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions