:return: numpy array containing the SOD outlier scores for each observation
ref_inds = self.__snn(X)
res = np.zeros(shape=(X.shape[0], ))
for i in range(X.shape[0]):
obs = X[i]
ref = X[ref_inds[i, ], ]
means = np.mean(ref, axis=0) // mean of each column
// average squared distance of the reference to the mean
var_total = sum(sum(np.square(ref - means)))/self.ref_set_
var_expect = self.alpha_ * var_total / X.shape[1]
var_actual = np.var(ref, axis=0) // variance of each attribute
var_inds = [1 if (i < var_expect) else 0 for i in var_actual]
rel_dim = sum(var_inds)
if rel_dim != 0:
res[i] = np.sqrt(np.dot(var_inds, np.square(obs - means)) / rel_dim)return res