code: def _fit(self, model):
      exp = model.explainer
      if exp.model_type != "classification":
          self.set_message(
              "ROC plot is only available for classificators"
          )
          return
  
      y_hat = exp.predict(exp.data) if exp.y_hat is None else exp.y_hat
      df = pd.DataFrame({"y": exp.y.astype(bool), "y_hat": y_hat})
  
      P_n = df.y.sum()
      N_n = df.shape[0] - P_n
      if P_n == 0 or N_n == 0:
          self.set_message(
              "Provided dataset contains only positive or only negative cases.",
              "error",
          )
          return
  
      tpr_temp = (
          df.groupby("y_hat")
          .sum()
          .reset_index()
          .sort_values("y_hat", ascending=False)
      )
      fpr_temp = (
          df.assign(y=1 - df.y)
          .groupby("y_hat")
          .sum()
          .reset_index()
          .sort_values("y_hat", ascending=False)
      )
  
      _df = pd.DataFrame(
          {
              "TPR": tpr_temp.y.cumsum() / P_n,
              "TNR": 1 - (fpr_temp.y.cumsum() / N_n),
              "cutoff": np.sort(df["y_hat"].unique())[::-1],
          }
      )
  
      grid_points = self.get_option("grid_points")
      if _df.shape[0] > grid_points:
          _df = _df.sample(grid_points).sort_values(
              "cutoff", ascending=False
          )
  
      self.data = {
          "cutoff": _df["cutoff"].tolist(),
          "specifity": [1] + _df["TNR"].tolist(),
          "sensivity": [0] + _df["TPR"].tolist(),
      }
  
imports: import pandas
  import numpy
  from .._plot_container import PlotContainer
label_desc: Use image node_id 1 for calling the ROCContainer obj's underlying member method code with example usage: obj._fit(model) without return types