docs: def fit(self, y, p):
          """ Fit the calibration map
  
          Parameters
          ----------
          y_true : array-like of shape = [n_samples]
              True class to be used for calibrating the probabilities
  
          y_prob : array-like of shape = [n_samples, 2]
              Predicted probabilities to be used for calibrating the probabilities
  
          Returns
          -------
          self : object
              Returns self.
          """
  
          # TODO: Check input
          if p.size != p.shape[0]:
              p = p[:, 1]
  
          fpr, tpr, thresholds = roc_curve(y, p)
          #works with sklearn 0.11
          if fpr.min() > 0 or tpr.min() > 0:
              fpr = np.hstack((0, fpr))
              tpr = np.hstack((0, tpr))
              thresholds = np.hstack((1.01, thresholds))
  
          def prob_freq(y, predict_proba):
              #calculate distribution and return in inverse order
              proba_bins = np.unique(predict_proba)
              freq_all = np.bincount(proba_bins.searchsorted(predict_proba))
              freq_0_tempa = np.unique(predict_proba[np.nonzero(y == 0)[0]])
              freq_0_tempb = np.bincount(freq_0_tempa.searchsorted(predict_proba[np.nonzero(y == 0)[0]]))
              freq = np.zeros((proba_bins.shape[0], 3))
              freq[:, 0] = proba_bins
              for i in range(freq_0_tempa.shape[0]):
                  freq[np.nonzero(proba_bins == freq_0_tempa[i])[0], 1] = freq_0_tempb[i]
              freq[:, 2] = freq_all - freq[:, 1]
              freq = freq[proba_bins.argsort()[::-1], :]
              pr = freq[:, 2] / freq[:, 1:].sum(axis=1)
              pr = pr.reshape(freq.shape[0], 1)
              #fix when no negatives in range
              pr[pr == 1.0] = 0
              freq = np.hstack((freq, pr))
              return freq
  
          f = prob_freq(y, p)
          temp_hull = []
          for i in range(fpr.shape[0]):
              temp_hull.append((fpr[i], tpr[i]))
          #close the plane
          temp_hull.append((1, 0))
          rocch_ = _convexhull(temp_hull)
          rocch = np.array([(a, b) for (a, b) in rocch_[:-1]])
          rocch_find = np.zeros(fpr.shape[0], dtype=np.bool)
          for i in range(rocch.shape[0]):
              rocch_find[np.intersect1d(np.nonzero(rocch[i, 0] == fpr)[0],
                                        np.nonzero(rocch[i, 1] == tpr)[0])] = True
          rocch_thresholds = thresholds[rocch_find]
          #calibrated probabilities using ROCCH
          f_cal = np.zeros((rocch_thresholds.shape[0] - 1, 5))
          for i in range(rocch_thresholds.shape[0] - 1):
              f_cal[i, 0] = rocch_thresholds[i]
              f_cal[i, 1] = rocch_thresholds[i + 1]
              join_elements = np.logical_and(f_cal[i, 1] <= f[:, 0], f_cal[i, 0] > f[:, 0])
              f_cal[i, 2] = f[join_elements, 1].sum()
              f_cal[i, 3] = f[join_elements, 2].sum()
          f_cal[:, 4] = f_cal[:, 3] / f_cal[:, [2, 3]].sum(axis=1)
          #fix to add 0
          f_cal[-1, 1] = 0
          calibrated_map = f_cal[:, [0, 1, 4]]
  
          self.calibration_map = calibrated_map