Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #7092 +/- ##
==========================================
+ Coverage 88.80% 90.08% +1.28%
==========================================
Files 335 340 +5
Lines 73916 82975 +9059
==========================================
+ Hits 65638 74745 +9107
+ Misses 8278 8230 -48 🚀 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.
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.
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.
| 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.
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.
|
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.
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