class_docstr: Train the SVM for the low-shot image classification tasks. Currently,
  datasets like VOC07 and Places205 are supported.
  
  The trained inherits from the SVMTrainer class and takes care of
  training SVM, evaluating, and aggregate the metrics.
class_docstr_tok: ["Train","the","SVM","for","the","low-shot","image","classification","tasks",".","Currently",",","datasets","like","VOC07","and","Places205","are","supported",".","The","trained","inherits","from","the","SVMTrainer","class","and","takes","care","of","training","SVM",",","evaluating",",","and","aggregate","the","metrics","."]
code: def _get_cls_feats_labels(self, cls, features, targets):
      out_feats, out_cls_labels = None, None
      if self._dataset_name == "voc":
          cls_labels = targets[:, cls].astype(dtype=np.int32, copy=True)
          # find the indices for positive/negative imgs. Remove the ignore label.
          out_data_inds = targets[:, cls] != -1
          out_feats = features[out_data_inds]
          out_cls_labels = cls_labels[out_data_inds]
          # label 0 = not present, set it to -1 as svm train target.
          # Make the svm train target labels as -1, 1.
          out_cls_labels[np.where(out_cls_labels == 0)] = -1
      elif "places" in self._dataset_name:
          cls_labels = targets.astype(dtype=np.int32, copy=True)
          # Remove the ignore label.
          out_data_inds = targets[:, 0] != -1
          out_feats = features[out_data_inds]
          out_cls_labels = cls_labels[out_data_inds]
  
          # for the given class, get the relevant positive/negative images and
          # Make the svm train target labels as -1, 1.
          cls_inds = np.where(out_cls_labels[:, 0] == cls)
          non_cls_inds = out_cls_labels[:, 0] != cls
          out_cls_labels[non_cls_inds] = -1
          out_cls_labels[cls_inds] = 1
          # finally reshape into the format taken by sklearn svm package.
          out_cls_labels = out_cls_labels.reshape(-1)
      else:
          raise Exception("Dataset not recognized")
      return out_feats, out_cls_labels
  
file_path: vissl/vissl/utils/svm_utils/svm_low_shot_trainer.py
imports: import logging
  import pickle
  import numpy
  from iopath.common.file_io import g_pathmgr
  from sklearn.svm import LinearSVC
  from vissl.utils.io import load_file, save_file
  from vissl.utils.svm_utils.evaluate import get_precision_recall
  from vissl.utils.svm_utils.svm_trainer import SVMTrainer
label_desc: Use image node_id 3 for calling the SVMLowShotTrainer obj's underlying member method code with example usage: obj._get_cls_feats_labels(cls, features, targets) and returns: out_feats,  out_cls_labels