(data, sample_num)
return new_data
Up sample
Up sample
Up sample
def random_upsampling(data, sample_num):
  """Up sample"""
  np.random.seed(2019)
  new_indices = np.random.permutation(range(sample_num))
  original_size = len(data)
  new_data = [data[i % original_size] for i in new_indices]
  return new_data
def random_upsampling ( data , sample_num ) : np . random . seed ( 2019 ) new_indices = np . random . permutation ( range ( sample_num ) ) original_size = len ( data ) new_data = [ data [ i % original_size ] for i in new_indices ] return new_data