Skip to main content
. 2016 Jan 19;11(1):e0146672. doi: 10.1371/journal.pone.0146672

Table 1. Pseudo-code of Algorithm 1.

Algorithm 1 Select the discriminative neighbor set
Input: K is the nearest neighbor numbers, and D = {(X(1), C(1)), …(X(i), C(i)), …(X(n), C(n))}.
Output: discriminative neighbor set S(i)
For each instances (X(i), C(i))
 Compute its Euclidean distance to some other document vector d(X(i), X(j)), subject to C(i) = C(j) and (i ≠ j);
 Rank d(X(i), X(j)) and select the Kth nearest instances to X (i,K)
End for