How to add 5% uniformly distributed Noise in the dataset
2 ビュー (過去 30 日間)
古いコメントを表示
How can i add 5% of Noise to the dataset with uniform distrubution, i have implemented the code but noise is not uniformly distrubeted How can i do that
can any body please help me
load('datasetvalue.mat')
[rows, columns] = size(dataset);
noise = 0.05 * dataset .* (randn(rows, columns) - 0.5);
noisyData = dataset + noise;
0 件のコメント
回答 (2 件)
KSSV
2022 年 3 月 1 日
load('datasetvalue.mat')
[rows, columns] = size(dataset);
N = zeros(rows,columns) ;
% pick 5% of random indices
idx = randsample(rows*columns,round(5/100*rows*columns));
N(idx) = randn(size(idx)) ;
noisyData = dataset + N;
2 件のコメント
yanqi liu
2022 年 3 月 2 日
yse,sir,may be ues rand not randn to get uniformly distributed pseudorandom numbers
参考
カテゴリ
Help Center および File Exchange で Statistics and Machine Learning Toolbox についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!