Algorithm 2: Rescaling Input: Training records Φ. Output: Clusters C.

1 initialize C to empty 2 forall (**φ, F**) ∈ Φ do 3 if ∃c ∈ C *such that* F ⊆ c or F ⊇ c **then**
4 forall p ∈ F \ c do 5 add p to c with wc(p) := ǫ 6 end 7 if wc(φ) ≥ 1 **then** 8 increment wc(φ)
9 **else**
10 wc(φ) := 1 11 end 12 **else**
13 initialize c to empty 14 add c to C 15 **forall** p ∈ F do 16 add p to c with wc(p) := ǫ 17 end 18 wc(φ) := 1 19 end 20 end 21 while ∃**c, d** ∈ C *such that* c ∩ d 6= ∅ do 22 sum ratios := 0 23 **forall** p ∈ c ∩ d do sum ratios += wc(p)
wd(p)
24 25 end scale := sum ratios |c ∩ d| 26 27 **forall** p ∈ d \ c do 28 add p to c with wc(p) := wd(p) · scale 29 end 30 remove d from C
31 end 32 **return** C