From 28debd3ab59805425d1e37e9f01a2fbcc226d208 Mon Sep 17 00:00:00 2001 From: Apostolof Date: Mon, 31 Dec 2018 15:19:53 +0200 Subject: [PATCH] Change DB-SCAN parameters per dataset, Fix class enumerations --- spike_sorting.m | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/spike_sorting.m b/spike_sorting.m index e972257..0f0008a 100644 --- a/spike_sorting.m +++ b/spike_sorting.m @@ -270,11 +270,11 @@ for fileIndex=1:4 distThreshold = 0.15; minPts = 30; elseif fileIndex == 3 - distThreshold = 0.32; - minPts = 30; + distThreshold = 0.40; + minPts = 50; else - distThreshold = 0.36; - minPts = 35; + distThreshold = 0.30; + minPts = 40; end [~, dbScanClasses, ~] = dbscan(features(:, 6:7)', distThreshold, minPts); @@ -289,8 +289,7 @@ for fileIndex=1:4 dbScanClasses(dbScanClasses==2) = 1; dbScanClasses(dbScanClasses==7) = 2; elseif fileIndex == 4 - dbScanClasses(dbScanClasses==1) = 7; - dbScanClasses(dbScanClasses==3) = 1; + dbScanClasses(dbScanClasses==3) = 7; dbScanClasses(dbScanClasses==2) = 3; dbScanClasses(dbScanClasses==7) = 2; end @@ -316,10 +315,6 @@ for fileIndex=1:4 hierarchicalClusters(hierarchicalClusters==1) = 7; hierarchicalClusters(hierarchicalClusters==2) = 1; hierarchicalClusters(hierarchicalClusters==7) = 2; - elseif fileIndex == 3 - hierarchicalClusters(hierarchicalClusters==1) = 7; - hierarchicalClusters(hierarchicalClusters==2) = 1; - hierarchicalClusters(hierarchicalClusters==7) = 2; end figure(); @@ -351,6 +346,10 @@ for fileIndex=1:4 kMeansClasses(kMeansClasses==2) = 1; kMeansClasses(kMeansClasses==3) = 2; kMeansClasses(kMeansClasses==7) = 3; + elseif fileIndex == 4 + kMeansClasses(kMeansClasses==3) = 7; + kMeansClasses(kMeansClasses==2) = 3; + kMeansClasses(kMeansClasses==7) = 2; end figure();