src.ml.dataset.create_weighted_sampler

create_weighted_sampler(y_data, class2idx)[source]

Create a weighted random sampler.

Parameters
  • y_data – The output class labels.

  • class2idx – A dictionary to convert class strings to integer.