Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Silhouette score for softdtw seems to output incorrect value? #70

Closed
newman1234 opened this issue Sep 20, 2018 · 3 comments
Closed

Silhouette score for softdtw seems to output incorrect value? #70

newman1234 opened this issue Sep 20, 2018 · 3 comments

Comments

@newman1234
Copy link

After setting numpy seed to 0, I run KShape() with k from 2 to 20 with data attached(
2009-07-03.txt
), 1st row is column, 1st column is type id, each row is a time series.
Then, I get below output.
But some Silhouette score are out of range [-1, 1], I doubt if any bugs in the source code?

2 -0.08373099425328774
3 -0.05442782800431933
4 -0.2990385898451778
5 0.82257924006757
6 0.07339752270549695
7 0.006547365646187291
8 -0.013190704128275294
9 -0.3699863239470184
10 -0.14525100672345187
11 0.05870643841365358
12 -0.04925086618269442
13 0.022768743713393547
14 -0.21661090959552837
15 -0.4226274569452376
16 -0.02699921955619855
17 -2.851892515422465
18 -0.16215923629608536
19 1.0534899203292516
20 0.23729819535494462

Thanks

@newman1234
Copy link
Author

According to mblondel/soft-dtw#10, softdtw discrepancy may be negative, thus, causing silhouette score out of range. Also, as the authors from the above link said, we can normalizing softdtw to make it more distance alike.
Is it better to provide "normalized" parameter for calculating silhouette score with softdtw?

@rtavenar
Copy link
Member

Hi @newman1234 , and thanks for the "bug" report.

I have implemented a fix in silhouette computation when soft-dtw is used, and changed the doc accordingly. Let me know if this works OK on your side.

@newman1234
Copy link
Author

It works like a charm!
Thank you, @rtavenar.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants