Description Usage Arguments Details Value Author(s) References Examples
Function to calculate the connectivity-based outlier factor as an outlier score for observations. Suggested by Tang, J., Chen, Z., Fu, A. W. C., & Cheung, D. W. (2002)
1 | COF(dataset, k = 5)
|
dataset |
The dataset for which observations have a COF score returned |
k |
The number of k-nearest neighbors to construct a SBN-path with, being the number of neighbors for each observation to compare chaining-distance with. k has to be smaller than the number of observations in dataset |
COF computes the connectivity-based outlier factor for observations, being the comparison of chaining-distances between observation subject to outlier scoring and neighboring observations. The COF function is useful for outlier detection in clustering and other multidimensional domains.
A vector of COF scores for observations. The greater the COF, the greater outlierness
Jacob H. Madsen
Tang, J., Chen, Z., Fu, A. W. C., & Cheung, D. W. (2002). Enhancing Effectiveness of Outlier Detections for Low Density Patterns. In Pacific-Asia Conf. on Knowledge Discovery and Data Mining (PAKDD). Taipei. pp. 535-548. DOI: 10.1007/3-540-47887-6_53
1 2 3 4 5 6 7 8 9 10 11 12 | # Create dataset
X <- iris[,1:4]
# Find outliers by setting an optional k
outlier_score <- COF(dataset=X, k=10)
# Sort and find index for most outlying observations
names(outlier_score) <- 1:nrow(X)
sort(outlier_score, decreasing = TRUE)
# Inspect the distribution of outlier scores
hist(outlier_score)
|
107 23 42 65 45 36 16 15
1.9032707 1.7679359 1.7505756 1.5342417 1.4856055 1.4369644 1.4033106 1.3971693
88 32 135 118 99 132 34 44
1.3694610 1.3543871 1.3382724 1.3369073 1.3368508 1.3345104 1.3194247 1.3185439
12 25 69 21 120 60 37 7
1.3166301 1.2983290 1.2917991 1.2809970 1.2791897 1.2760174 1.2753276 1.2671240
24 94 33 58 86 57 19 101
1.2373945 1.2229869 1.2213936 1.2137401 1.2029034 1.1933475 1.1928910 1.1899048
63 72 130 110 115 78 9 56
1.1889238 1.1876947 1.1867315 1.1684751 1.1640476 1.1632635 1.1567338 1.1558400
61 17 109 136 134 6 27 67
1.1470166 1.1454335 1.1450388 1.1440485 1.1352748 1.1239692 1.1184118 1.1166019
91 73 11 39 22 131 114 80
1.1155910 1.1084009 1.1037625 1.0948350 1.0928137 1.0920151 1.0893427 1.0889261
116 47 137 111 3 79 108 14
1.0828155 1.0814884 1.0789796 1.0773016 1.0704047 1.0671822 1.0671178 1.0616814
62 20 112 113 148 48 103 149
1.0612918 1.0536648 1.0499772 1.0489315 1.0487261 1.0475973 1.0459533 1.0362908
119 55 71 53 43 83 106 4
1.0291461 1.0289691 1.0249188 1.0211934 1.0191291 1.0161334 1.0115316 1.0112518
74 85 52 133 54 68 51 146
1.0107934 1.0098611 1.0096940 1.0091748 1.0081562 1.0076383 1.0065801 1.0049652
90 126 145 147 84 77 50 98
1.0036980 1.0007133 1.0002103 1.0000670 0.9994414 0.9984011 0.9979847 0.9978489
144 125 38 93 64 122 87 105
0.9977548 0.9954753 0.9928152 0.9920353 0.9906144 0.9884301 0.9879680 0.9848838
142 46 81 13 123 2 5 124
0.9842588 0.9823830 0.9803341 0.9770811 0.9767662 0.9734547 0.9685606 0.9682788
95 127 140 141 49 66 92 59
0.9616037 0.9603973 0.9587731 0.9534695 0.9533724 0.9522957 0.9516702 0.9490012
26 41 128 138 8 82 10 76
0.9474871 0.9474792 0.9473734 0.9461497 0.9448709 0.9428516 0.9390493 0.9337580
40 35 117 121 129 75 102 143
0.9333097 0.9302308 0.9288584 0.9244572 0.9217561 0.9210744 0.9199636 0.9199636
96 104 18 31 30 1 89 70
0.9189363 0.9173045 0.9172902 0.9170788 0.9144431 0.9114170 0.9092849 0.9069919
28 97 29 139 150 100
0.8938966 0.8878631 0.8829402 0.8824604 0.8524619 0.8322319
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.