Borrar filtros
Borrar filtros

How to add 5% uniformly distributed Noise in the dataset

2 visualizaciones (últimos 30 días)
Med Future
Med Future el 1 de Mzo. de 2022
Comentada: Med Future el 2 de Mzo. de 2022
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;

Respuestas (2)

KSSV
KSSV el 1 de Mzo. de 2022
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 comentarios
Med Future
Med Future el 1 de Mzo. de 2022
Editada: Med Future el 1 de Mzo. de 2022
@KSSV its not working the output is not what i want, have you run my code above
Med Future
Med Future el 1 de Mzo. de 2022
@KSSV the code you share it can not add noise to the data

Iniciar sesión para comentar.


yanqi liu
yanqi liu el 2 de Mzo. de 2022
yse,sir,may be ues rand not randn to get uniformly distributed pseudorandom numbers

Categorías

Más información sobre Statistics and Machine Learning Toolbox en Help Center y File Exchange.

Productos


Versión

R2021b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by