class_docstr: Stratified Sampling
  
  Provides equal representation of target classes in each batch
  
  :param class_vector: (torch tensor):
          a vector of class labels
  :param batch_size: (int):
          size of the batch
class_docstr_tok: ["Stratified","Sampling","Provides","equal","representation","of","target","classes","in","each","batch",":","param","class_vector",":","(","torch","tensor",")",":","a","vector","of","class","labels",":","param","batch_size",":","(","int",")",":","size","of","the","batch"]
code: def gen_sample_array(self):
      try:
          from sklearn.model_selection import StratifiedShuffleSplit
      except:
          print("Need scikit-learn for this functionality")
      import numpy as np
  
      s = StratifiedShuffleSplit(n_splits=self.n_splits, test_size=0.5)
      X = torch.randn(self.class_vector.size(0), 2).numpy()
      y = self.class_vector.numpy()
      s.get_n_splits(X, y)
  
      train_index, test_index = next(s.split(X, y))
      return np.hstack([train_index, test_index])
  
imports: import math
  from .utils import th_random_choice
  import torch.utils.data
  import torchvision
  from .datasets import FolderDataset, MultiFolderDataset, PredictFolderDataset, ClonedFolderDataset
  from torch.utils.data.sampler import Sampler
label_desc: Use image node_id 2 for calling the StratifiedSampler obj's underlying member method code with example usage: obj.gen_sample_array() and returns: np