Skip to main content
. 2022 Sep 27;8:e1060. doi: 10.7717/peerj-cs.1060
Algorithm 1 Pseudocode for the proposed outliers detection approaches.
1 Input: T, alpha, apr
2 //Typicality degrees matrix in nxc dimension, and built by an
3 //unsupervised possibilistic clustering algorithm
4 // alpha, threshold possibility value for outlier testing
5 // apr, number of the approach to be used in outlier detection
6 Output: Outliers
7 //Outliers, vector of n length to store the flags of outliers
8 n <- count of rows of matrix T
9 c <- count ofcolumns of matrix T
10 // If alpha is undefined, use 0.05 as the default value
11 if alpha is null then alpha = 0.05
12 Outliers <- {0} //Assign 0 to all elements of the outliers
13 for k = 1 to n do
14 if apr = 1 then
15 sumT <- 0
16 for i = 1 to c do
17 sumT <- sumT + T[i,k]
18 end
19 avgT <- sumT / c
20 if avgT <= alpha then
21 Outliers[k] <- 1
22 end
23 else
24 if apr = 2 then
25 isOutlier <- True
26 for i = 1 to c do
27 if T[i,k] >= alpha then
28 isOutlier <- False
29 end
30 end
31 if isOutlier = True then
32 Outliers[k] <- 1
33 end
34 end
35 end
36 end
37 return Outliers