class_docstr: Manages post-hoc SVM training for a single object class.
class_docstr_tok: ["Manages","post-hoc","SVM","training","for","a","single","object","class","."]
code: def append_neg_and_retrain(self, feat=None, force=False):
      if feat is not None:
          num = feat.shape[0]
          self.neg = np.vstack((self.neg, feat))
          self.num_neg_added += num
      if self.num_neg_added > self.retrain_limit or force:
          self.num_neg_added = 0
          new_w_b, pos_scores, neg_scores = self.train()
          # scores = np.dot(self.neg, new_w_b[0].T) + new_w_b[1]
          # easy_inds = np.where(neg_scores < self.evict_thresh)[0]
          print("    Pruning easy negatives")
          print("         before pruning: #neg = " + str(len(self.neg)))
          not_easy_inds = np.where(neg_scores >= self.evict_thresh)[0]
          if len(not_easy_inds) > 0:
              self.neg = self.neg[not_easy_inds, :]
              # self.neg = np.delete(self.neg, easy_inds)
          print("         after pruning: #neg = " + str(len(self.neg)))
          print(
              "    Cache holds {} pos examples and {} neg examples".format(
                  self.pos.shape[0], self.neg.shape[0]
              )
          )
          print(
              "    {} pos support vectors".format(
                  (pos_scores <= 1).sum()
              )
          )
          print(
              "    {} neg support vectors".format(
                  (neg_scores >= -1).sum()
              )
          )
          return new_w_b
      else:
          return None
  
imports: from timer import Timer
  from sklearn import svm
  import numpy
label_desc: Use image node_id 5 for calling the SVMClassTrainer obj's underlying member method code with example usage: obj.append_neg_and_retrain(feat, force) and returns: new_w_b, None