| 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 |