def _sod(self, X):
    'This function is called internally to perform subspace outlier \n        detection algorithm.\n        \n        Returns\n        -------\n        anomaly_scores : numpy array of shape (n_samples,)\n            The anomaly score of the input samples.\n        '
    ref_inds = self._snn(X)
    anomaly_scores = 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)
        var_total = (np.sum(np.sum(np.square((ref - means)))) / self.ref_set_)
        var_expect = ((self.alpha_ * var_total) / X.shape[1])
        var_actual = np.var(ref, axis=0)
        var_inds = [(1 if (j < var_expect) else 0) for j in var_actual]
        rel_dim = np.sum(var_inds)
        if (rel_dim != 0):
            anomaly_scores[i] = np.sqrt((np.dot(var_inds, np.square((obs - means))) / rel_dim))
    return anomaly_scores
This function is called internally to perform subspace outlier 
detection algorithm.

Returns
-------
anomaly_scores : numpy array of shape (n_samples,)
    The anomaly score of the input samples.
def _sod(self, X):
    'This function is called internally to perform subspace outlier \n        detection algorithm.\n        \n        Returns\n        -------\n        anomaly_scores : numpy array of shape (n_samples,)\n            The anomaly score of the input samples.\n        '
    ref_inds = self._snn(X)
    anomaly_scores = 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)
        var_total = (np.sum(np.sum(np.square((ref - means)))) / self.ref_set_)
        var_expect = ((self.alpha_ * var_total) / X.shape[1])
        var_actual = np.var(ref, axis=0)
        var_inds = [(1 if (j < var_expect) else 0) for j in var_actual]
        rel_dim = np.sum(var_inds)
        if (rel_dim != 0):
            anomaly_scores[i] = np.sqrt((np.dot(var_inds, np.square((obs - means))) / rel_dim))
    return anomaly_scores