-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
[ENH] OWSilhouettePlot: displays average silhouette #7092
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
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #7092 +/- ##
=======================================
Coverage 88.80% 88.80%
=======================================
Files 335 335
Lines 73916 73923 +7
=======================================
+ Hits 65638 65647 +9
+ Misses 8278 8276 -2 🚀 New features to boost your workflow:
|
|
Hm, what about putting this on the graph, say at the top left, in two lines? Silhouette scores for groups are already there. The second reason is that if it is a part of the figure, it is saved together with the figure. |
| self.avg_silhouette_label.setText( | ||
| f"<b>Silhouette:</b> {avg_score:.4f}") | ||
| else: | ||
| self.avg_silhouette_label.setText("<b>Silhouette:</b> N/A") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Must it be bold? I don't think we use bold anywhere else (or at least not often).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We used bold in Data Info widget, I copied the style from there. But I agree it sticks out, and will correct. Let me work on this in the following days.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bold removed
| self.Warning.nan_distances( | ||
| count_nandist, s="s" if count_nandist > 1 else "") | ||
|
|
||
| self._update_avg_silhouette() # Update the average silhouette display |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this comment necessary?
I know: copilot and similar tools add heaps and heaps of comments to explain the code, but they often just state the obvious. PEP8 says they're distracting.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed
|
I was working on this in parallel with Blaž. Here is my proposed solution: #7106 |
52453dc to
48a2bd2
Compare
| data = Table("brown-selected") | ||
| self.send_signal(self.widget.Inputs.data, data) | ||
| self.assertEqual(self.widget.avg_silhouette_label.text(), | ||
| "Average Silhouette: 0.4692") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let us hope this is stable...
|
@BlazZupan, for some reason, github doesn't allow me to push new commits to your branch. Could you, please, update the translation file? Here are the changes (be careful with indentation). |

Issue
Silhouette Plot would display silhouette score per group, but not the average silhouette score which may serve as a reference to judge if the group is below or above the average.
Also, learning about average silhouette score may be beneficial when judging on the quality of some clustering that precedes Silhouette Plot widget, say, a Hierarchical Clustering or DBSCAN and Silhouette Plot combination.
Description of changes
This pull request introduces an info box that reports on the average silhouette score:
The style of reporting (the label in bold and the number in normal text) follows that of an Info widget. When input data is missing, the box displays N/A.
Unit tests should most likely be added. I have currently tested the widget by coupling it in the workflow with k-means, that also reports on the average silhouette:
Includes