projects
/
pingpong.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Preparing scripts for TP-Link plug.
[pingpong.git]
/
python_ml
/
plotting-dbscan.py
diff --git
a/python_ml/plotting-dbscan.py
b/python_ml/plotting-dbscan.py
index 9b5d1abb0e18ee3f1b7a4cea76f2a5b48eb87469..2202a8ef19894255d34eb24da996cad7754b851e 100644
(file)
--- a/
python_ml/plotting-dbscan.py
+++ b/
python_ml/plotting-dbscan.py
@@
-58,6
+58,7
@@
unique_labels = set(labels)
colors = [plt.cm.Spectral(each)
for each in np.linspace(0, 1, len(unique_labels))]
for k, col in zip(unique_labels, colors):
colors = [plt.cm.Spectral(each)
for each in np.linspace(0, 1, len(unique_labels))]
for k, col in zip(unique_labels, colors):
+ cluster_col = [1, 0, 0, 1]
if k == -1:
# Black used for noise.
col = [0, 0, 0, 1]
if k == -1:
# Black used for noise.
col = [0, 0, 0, 1]
@@
-65,7
+66,7
@@
for k, col in zip(unique_labels, colors):
class_member_mask = (labels == k)
xy = X[class_member_mask & core_samples_mask]
class_member_mask = (labels == k)
xy = X[class_member_mask & core_samples_mask]
- plt.plot(xy[:, 0], xy[:, 1], 'o',
+ plt.plot(xy[:, 0], xy[:, 1], 'o',
markerfacecolor=tuple(cluster_col),
markeredgecolor='k', markersize=10)
xy = X[class_member_mask & ~core_samples_mask]
markeredgecolor='k', markersize=10)
xy = X[class_member_mask & ~core_samples_mask]
@@
-83,7
+84,7
@@
for pair in pairsArr:
else:
# Only print the frequency when this is a real cluster
plt.text(pair[0], pair[1], str(pair[0]) + ", " + str(pair[1]) +
else:
# Only print the frequency when this is a real cluster
plt.text(pair[0], pair[1], str(pair[0]) + ", " + str(pair[1]) +
- "
- Freq
: " + str(labels.tolist().count(labels[count])), fontsize=10)
+ " : " + str(labels.tolist().count(labels[count])), fontsize=10)
count = count + 1
count = count + 1