Skip to main content
. 2022 Aug 14;12(8):1314. doi: 10.3390/jpm12081314
Algorithm 1: Replacement Noise Algorithm
Input: Dataset D with N samples and F features
Output: D’, a corrupted dataset with N samples and F features
1: Define noise term p, the proportion of values to replace
2: For each f ∈F:
3:   df=column f of Dataset D
4:   μf=sum(df)N
5:   σf=(∑n=0Ndn,f−μf) N−1
6:   v=p∗N
7:   Randomly remove v values from column df
8:   Replace each value with a randomly sampled value from N(μf, σf2)
9: End for loop