Skip to main content
. Author manuscript; available in PMC: 2017 Nov 3.
Published in final edited form as: Data Min Knowl Discov. 2016 Feb 15;31(1):1–31. doi: 10.1007/s10618-016-0455-0

Table 3.

An algorithm to find iSuccess and dSuccess and compute S scores for all their exemplars

Procedure find_Scores (trainData)
Input: Labeled data, trainData;
Output: S scores for iSuccess and dSuccess, S_iSuccess and S_dSuccess;

1 for n ← 1 to size(trainData)
2   minD ← Nearest_Neighbor_Distance_D (trainData(n), trainData);
3   minI ← Nearest_Neighbor_Distance_I (trainData(n), trainData);
4   if (trainData(n).label == Nearest_Neighbor_D ().label &&
5       trainData(n).label != Nearest_Neighbor_I ().label )
6     S_dSuccess.add (minD / minI);
7   end if
8   if (trainData(n).label != Nearest_Neighbor_D ().label &&
9       trainData(n).label == Nearest_Neighbor_I ().label )
10     S_iSuccess.add (minD / minI);
11   end if
12 end for