Algorithm 3.
Sample selection for kCPM
| Input: Positive training samples 𝒟+, negative training samples 𝒟−, distance threshold r, order flag positive_first. | |
| Output: Selected points set 𝒮 | |
| 1: | 𝒮 ←∅; |
| 2: | if positive_first then |
| 3: | 𝒟 = 𝒟+ ∪𝒟−, where 𝒟+ occur first. |
| 4: | else |
| 5: | 𝒟 = 𝒟− ∪𝒟+, where 𝒟− occur first. |
| 6: | end if |
| 7: | for all xi in 𝒟 in order do |
| 8: | if minxj∈𝒮 d(xi, xj) > r then |
| 9: | Add xi into 𝒮; |
| 10: | end if |
| 11: | end for |