tslearn-team / tslearn

The machine learning toolkit for time series analysis in Python
https://tslearn.readthedocs.io
BSD 2-Clause "Simplified" License
2.92k stars 342 forks source link

Support for silhouette_samples() functionalities like sklearn. #451

Open srimantacse opened 1 year ago

srimantacse commented 1 year ago

Is there any support for silhouette_samples() functionalities as sklearn has.

rtavenar commented 1 year ago

Hi,

We don't have support for silhouette_samples at the moment.

In terms of implementation, given the current implementation of silhouette_score (https://github.com/tslearn-team/tslearn/blob/main/tslearn/clustering/utils.py#L66) that heavily relies on sklearn's implem, it should be pretty much the same for one willing to adapt silhouette_samples:

  1. compute cross-similarity metrics between points
  2. rely on sklearn's implementation using metric="precomputed"

Anyone is welcome to open a PR on the topic.

srimantacse commented 1 year ago

@rtavenar thanks for the help. Able to get the sample score as you mentioned the steps. Thanks again.

rtavenar commented 1 year ago

@srimantacse would you be willing to contribute your code to tslearn ? If so, we would be happy to help you along the process.

srimantacse commented 1 year ago

@rtavenar please share me the process, I will do it. Request to give me some time considering my schedule. Share me the process.

rtavenar commented 1 year ago

You can find info there: https://github.com/tslearn-team/tslearn/blob/main/CONTRIBUTING.md#more-details-on-pull-requests

No problem if it takes some time, of course, it's always great to welcome new contributors