Skip to content

[FIX] Silhouette Plot: Fixes#1747

Merged
lanzagar merged 2 commits intobiolab:masterfrom
ales-erjavec:fixes/silhouette-n-clusters
Nov 15, 2016
Merged

[FIX] Silhouette Plot: Fixes#1747
lanzagar merged 2 commits intobiolab:masterfrom
ales-erjavec:fixes/silhouette-n-clusters

Conversation

@ales-erjavec
Copy link
Copy Markdown
Contributor

Issue
  • When the number of clusters was the same as the number of instances the widget crashed with an ValueError: Number of labels is {num} Valid values are 2 to n_samples - 1 (inclusive) error from scikit-learn.
  • If the cluster column contained missing values the widget would crash with an assertion error (assert Ck[0] >= 0 and Ck[-1] < len(values)) in SilhouettePlot.setScores
Description of changes
  • Check (and show an error message) if the number of clusters is the same as the number of instances
  • Omit instances with missing cluster assignment from the display (and the "Selected Data" output) and show a warning when this happens. When the "Add silhouette scores" is selected, output missing values for scores corresponding to instances with unknown cluster assignment.
Includes
  • Code changes
  • Tests
  • Documentation

@codecov-io
Copy link
Copy Markdown

codecov-io commented Nov 11, 2016

Current coverage is 88.87% (diff: 100%)

Merging #1747 into master will not change coverage

@@             master      #1747   diff @@
==========================================
  Files            82         82          
  Lines          8819       8819          
  Methods           0          0          
  Messages          0          0          
  Branches          0          0          
==========================================
  Hits           7838       7838          
  Misses          981        981          
  Partials          0          0          

Sunburst

Powered by Codecov. Last update 909a119...c7efeed

@lanzagar lanzagar merged commit fbf23ba into biolab:master Nov 15, 2016
@ales-erjavec ales-erjavec deleted the fixes/silhouette-n-clusters branch January 27, 2017 10:40
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

Successfully merging this pull request may close these issues.

3 participants