Skip to main content
. 2021 Jul 20;21(14):4946. doi: 10.3390/s21144946
Algorithm 1: Dataset reduction using clustering.
Input:Dold, t, n
Output:Dnew
Function DatasetReduction(Dold, t, n):
Dnew ← [ ]
for c in findClasses(Dold) do
   Xc ← extractClassPoints(Dold,c)
   db ← DBSCAN.fit(Xc)
   for l in db.clusters() do
    m ← size(l)/size(Xc)
    if m > t do
      Xp ← db.extractClusterPoints(p)
      q ← createCentroid(Xp)
    dist ← distances(q, Xp)
Dnew ← addClosestNPoints(Dnew, dist, Xp, n)
    end
   end
end
end