I have a severely unbalanced data set. I want to perform a uniform resampling with 200% of the original data set size.
the resample function seems cannot perform as I expected. Anyone knows any toolbox or function can perform this? Thanks.
I have a severely unbalanced data set. I want to perform a uniform resampling with 200% of the original data set size.
the resample function seems cannot perform as I expected. Anyone knows any toolbox or function can perform this? Thanks.
If you want to randomly resample with replacement from a data set of size N, you can use randi(N,1,N*2)
to return a vector of size N*2 of random integers between 1 and N. Then use that vector to index into your original matrix. For example,
N = 100;
data = rand(1,N); % This simulates your original data set
idx = randi(N, 1, N*2);
newData = data(idx);