Commit aa56a8aa authored by Ivo Peterek's avatar Ivo Peterek

ENH: improved parameter settings for cluster anlysis. #8

parent 74de78b3
......@@ -31,7 +31,7 @@ def metric(x, y, c1, c2):
def similarity(x, y):
return metric(x, y, 0.001, 1)
return metric(x, y, 0.001, 0.85)
class Window(QtWidgets.QDialog):
sendInfo = QtCore.pyqtSignal(object)
......@@ -389,13 +389,14 @@ class Window(QtWidgets.QDialog):
engs = [e[1] for e in samples]
avg = np.mean(engs)
var = np.var(engs)
print(avg, var, np.sqrt(var))
std = np.std(engs)
print(avg, var, std)
min_region_size = 100
if 'Voltage regulator' in self.combo_sample.currentText():
min_region_size = 10
clustering = DBSCAN(eps=0.9*np.sqrt(var), min_samples=min_region_size, metric=similarity).fit(samples)
clustering = DBSCAN(eps=0.85*std, min_samples=min_region_size, metric=similarity).fit(samples)
#clustering = OPTICS(min_cluster_size=min_region_size, metric=similarity).fit(samples)
noisy_samples = False
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment