Skip to content

Commit f137e2a

Browse files
committed
#5: Fix f string and requirements
1 parent dbd5620 commit f137e2a

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

detection/detect_slow_nodes.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,11 +158,13 @@ def __plotClusteringResults(self, times, clusters, cluster_centers, threshold, r
158158

159159
for i, cluster in enumerate(unique_clusters):
160160
cluster_times = np.array([times[i] for i in range(len(times)) if clusters[i] == cluster])
161+
representative_label = '(representative)' if cluster == representative_cluster else ''
162+
outlier_label = '(outlier)' if cluster_centers[cluster] > threshold else ''
161163
plt.hist(
162164
cluster_times,
163165
bins=self.__freedmanDiaconisBins(cluster_times),
164166
alpha=0.8,
165-
label=f'Cluster {cluster} {'(representative)' if cluster == representative_cluster else ''}{'(outlier)' if cluster_centers[cluster] > threshold else ''}', color=colors[i]
167+
label=f'Cluster {cluster} {representative_label}{outlier_label}', color=colors[i]
166168
)
167169
plt.axvline(cluster_centers[cluster], label=f"Cluster {cluster} center", c=colors[cluster], linestyle=':')
168170

detection/requirements.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
numpy
22
matplotlib
3+
seaborn
4+
scikit-learn

0 commit comments

Comments
 (0)