code: def predict_proba(self, p):
          
  
          # TODO: Check input
          if p.size != p.shape[0]:
              p = p[:, 1]
  
          calibrated_proba = np.zeros(p.shape[0])
          for i in range(self.calibration_map.shape[0]):
              calibrated_proba[np.logical_and(self.calibration_map[i, 1] <= p, self.calibration_map[i, 0] > p)] = \
                  self.calibration_map[i, 2]
  
          # TODO: return 2D and refactor
          return calibrated_proba
docs: Calculate the calibrated probabilities
  
          Parameters
          ----------
          y_prob : array-like of shape = [n_samples, 2]
              Predicted probabilities to be calibrated using calibration map
  
          Returns
          -------
          y_prob_cal : array-like of shape = [n_samples, 1]
              Predicted calibrated probabilities