def inject_noise(self, seed, n_out, random_seed):
        '''
        add anomalies to training data to replicate anomaly contaminated data sets.
        we randomly swape 5% features of anomalies to avoid duplicate contaminated anomalies.
        this is for dense data
        '''
        rng = np.random.RandomState(random_seed)
        n_sample, dim = seed.shape
        swap_ratio = 0.05
        n_swap_feat = int(swap_ratio * dim)
        noise = np.empty((n_out, dim))
        for i in np.arange(n_out):
            outlier_idx = rng.choice(n_sample, 2, replace = False)
            o1 = seed[outlier_idx[0]]
            o2 = seed[outlier_idx[1]]
            swap_feats = rng.choice(dim, n_swap_feat, replace = False)
            noise[i] = o1.copy()
            noise[i, swap_feats] = o2[swap_feats]
        return noise

        add anomalies to training data to replicate anomaly contaminated data sets.
        we randomly swape 5% features of anomalies to avoid duplicate contaminated anomalies.
        this is for dense data
        
adbench/baseline/FEAWAD/run.py