code: def create_from_boosted_machine(self, boosted_machine, classifiers_per_round, classification_thresholds=-5.):
      
      indices = list(range(0, len(boosted_machine.weak_machines), classifiers_per_round))
      if indices[-1] != len(boosted_machine.weak_machines): indices.append(len(boosted_machine.weak_machines))
      self.cascade = []
      self.indices = []
      for i in range(len(indices)-1):
        machine = bob.learn.boosting.BoostedMachine()
        for index in range(indices[i], indices[i+1]):
          machine.add_weak_machine(boosted_machine.weak_machines[index], boosted_machine.weights[index, 0])
        self.cascade.append(machine)
      if isinstance(classification_thresholds, (int, float)):
        self.thresholds = [classification_thresholds] * len(self.cascade)
      else:
        self.thresholds = classification_thresholds
docs: Creates this cascade from the given boosted machine, by simply splitting off strong classifiers that have classifiers_per_round weak classifiers.
  
      **Parameters:**
  
      ``boosted_machine`` : :py:class:`bob.learn.boosting.BoostedMachine`
        The strong classifier to split into a regular cascade.
  
      ``classifiers_per_round`` : int
        The number of classifiers that each cascade step should contain.
  
      ``classification_threshold`` : float
        A single threshold that will be applied in all rounds of the cascade.