X-Git-Url: http://plrg.eecs.uci.edu/git/?p=pingpong.git;a=blobdiff_plain;f=python_ml%2Fplotting-dbscan-complete.py;h=a2baa902c63104e52c02a2c6d24b07f4c5f60760;hp=55d5af4638306220119dcd8ef87f73b991023ed4;hb=a74eb9a9696796e28d6e35e276b7b33fb4079aec;hpb=4488d7f71952e3b8b0910a4f8dcd46066003e4b8 diff --git a/python_ml/plotting-dbscan-complete.py b/python_ml/plotting-dbscan-complete.py index 55d5af4..a2baa90 100644 --- a/python_ml/plotting-dbscan-complete.py +++ b/python_ml/plotting-dbscan-complete.py @@ -13,8 +13,8 @@ fig.set_size_inches(7, 7) # TODO: Just change the following path and filename # when needed to read from a different file path = "/scratch/July-2018/Pairs2/" -device1 = "kwikset-on" -device2 = "kwikset-off" +device1 = "alexa2-on" +device2 = "alexa2-off" filename1 = device1 + ".txt" filename2 = device2 + ".txt" @@ -38,7 +38,7 @@ X = np.array(pairsArr); # Compute DBSCAN # eps = distances # min_samples = minimum number of members of a cluster -db = DBSCAN(eps=30, min_samples=trig - 5).fit(X) +db = DBSCAN(eps=10, min_samples=trig - 5).fit(X) core_samples_mask = np.zeros_like(db.labels_, dtype=bool) core_samples_mask[db.core_sample_indices_] = True labels = db.labels_ @@ -76,7 +76,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]) + - "\nFreq: " + str(labels.tolist().count(labels[count])), fontsize=10) + "\nFreq:" + str(labels.tolist().count(labels[count])), fontsize=10) count = count + 1 #==================================================================================================== @@ -138,7 +138,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]) + - "\nFreq: " + str(labels.tolist().count(labels[count])), fontsize=10) + "\nFreq:" + str(labels.tolist().count(labels[count])), fontsize=10) count = count + 1