code: def _evaluate_oob_savings(self, X, y, cost_mat):
          
          estimators_weight = []
          for estimator, samples, features in zip(self.estimators_, self.estimators_samples_,
                                                  self.estimators_features_):
              # Test if all examples where used for training
              if not np.any(~samples):
                  # Then use training
                  oob_pred = estimator.predict(X[:, features])
                  oob_savings = max(0, savings_score(y, oob_pred, cost_mat))
              else:
                  # Then use OOB
                  oob_pred = estimator.predict((X[~samples])[:, features])
                  oob_savings = max(0, savings_score(y[~samples], oob_pred, cost_mat[~samples]))
  
              estimators_weight.append(oob_savings)
  
          # Control in case were all weights are 0
          if sum(estimators_weight) == 0:
              self.estimators_weight_ = np.ones(len(estimators_weight)) / len(estimators_weight)
          else:
              self.estimators_weight_ = (np.array(estimators_weight) / sum(estimators_weight)).tolist()
  
          return self
docs: Private function used to calculate the OOB Savings of each estimator.