code: def fit(
      self,
      X: pd.DataFrame,
      y: pd.DataFrame,
      minima: typing.Dict[int, typing.Dict[str, float]],
      maxima: typing.Dict[int, typing.Dict[str, float]],
  ) -> None:
      self.maxima = copy.deepcopy(maxima)
      target_indices = np.array(list(range(y.shape[1])))
      models = dict()
      weights = dict()
  
      self.strategies_ = copy.deepcopy(y.columns.to_list())
      y_pd = y.copy()
      y = y.to_numpy()
  
      for i in range(len(target_indices)):
          models[i] = dict()
          weights[i] = dict()
          for j in range(i + 1, len(target_indices)):
              if self.configuration["normalization"] in (
                  "all",
                  "binary",
                  "y",
                  "all1",
                  "binary1",
              ):
                  minimum2 = np.ones(len(X)) * np.inf
                  maximum2 = np.zeros(len(X))
  
                  if self.configuration["normalization"] in (
                      "all",
                      "all1",
                  ):
                      for idx, task_id in enumerate(X.index):
                          for method_id in range(len(target_indices)):
                              minimum2[idx] = np.nanmin(
                                  (
                                      minimum2[idx],
                                      minima[task_id][
                                          self.strategies_[method_id]
                                      ],
                                  )
                              )
                              maximum2[idx] = np.nanmax(
                                  (
                                      maximum2[idx],
                                      maxima[task_id][
                                          self.strategies_[method_id]
                                      ],
                                  )
                              )
                      if self.configuration["normalization"] == "all1":
                          maximum2 = np.ones_like(maximum2)
                  elif self.configuration["normalization"] in (
                      "binary",
                      "binary1",
                  ):
                      for idx, task_id in enumerate(X.index):
                          for method_id in (i, j):
                              minimum2[idx] = np.nanmin(
                                  (
                                      minimum2[idx],
                                      minima[task_id][
                                          self.strategies_[method_id]
                                      ],
                                  )
                              )
                              maximum2[idx] = np.nanmax(
                                  (
                                      maximum2[idx],
                                      maxima[task_id][
                                          self.strategies_[method_id]
                                      ],
                                  )
                              )
                      if (
                          self.configuration["normalization"]
                          == "binary1"
                      ):
                          maximum2 = np.ones_like(maximum2)
                  elif self.configuration["normalization"] == "y":
                      for idx, task_id in enumerate(X.index):
                          minimum2[idx] = np.nanmin(
                              (minimum2[idx], y_pd.loc[task_id].min())
                          )
                          maximum2[idx] = np.nanmax(
                              (maximum2[idx], y_pd.loc[task_id].max())
                          )
                  else:
                      raise ValueError(
                          self.configuration["normalization"]
                      )
  
                  y_i_j = y[:, i] < y[:, j]
                  mask = np.isfinite(y[:, i]) & np.isfinite(y[:, j])
                  X_ = X.to_numpy()[mask]
                  y_i_j = y_i_j[mask]
  
                  minimum = minimum2[mask]
                  maximum = maximum2[mask]
  
                  diff = maximum - minimum
                  diff[diff == 0] = 1
                  normalized_y_i = (
                      y[:, i][mask].copy() - minimum
                  ) / diff
                  normalized_y_j = (
                      y[:, j][mask].copy() - minimum
                  ) / diff
  
                  weights_i_j = np.abs(normalized_y_i - normalized_y_j)
  
              elif self.configuration["normalization"] == "rank":
                  y_i_j = y[:, i] < y[:, j]
                  mask = np.isfinite(y[:, i]) & np.isfinite(y[:, j])
                  X_ = X.to_numpy()[mask]
                  y_i_j = y_i_j[mask]
                  ranks = scipy.stats.rankdata(y[mask], axis=1)
                  weights_i_j = np.abs(ranks[:, i] - ranks[:, j])
  
              elif self.configuration["normalization"] == "None":
                  y_i_j = y[:, i] < y[:, j]
                  mask = np.isfinite(y[:, i]) & np.isfinite(y[:, j])
                  X_ = X.to_numpy()[mask]
                  y_i_j = y_i_j[mask]
                  weights_i_j = np.ones_like(y_i_j).astype(int)
  
              else:
                  raise ValueError(self.configuration["normalization"])
  
              if len(y_i_j) == 0:
                  models[i][j] = None
                  weights[i][j] = None
                  continue
  
              if np.all([target == y_i_j[0] for target in y_i_j]):
                  n_zeros = int(np.ceil(len(y_i_j) / 2))
                  n_ones = int(np.floor(len(y_i_j) / 2))
                  import sklearn.dummy
  
                  base_model = sklearn.dummy.DummyClassifier(
                      strategy="constant", constant=y_i_j[0]
                  )
                  base_model.fit(
                      X_,
                      np.array(
                          ([[0]] * n_zeros) + ([[1]] * n_ones)
                      ).flatten(),
                      sample_weight=weights_i_j,
                  )
              else:
                  if self.configuration.get("max_depth") == 0:
                      import sklearn.dummy
  
                      loss_i = np.sum((y_i_j == 0) * weights_i_j)
                      loss_j = np.sum((y_i_j == 1) * weights_i_j)
  
                      base_model = sklearn.dummy.DummyClassifier(
                          strategy="constant",
                          constant=1 if loss_i < loss_j else 0,
                      )
                      base_model.fit(
                          X_,
                          np.ones_like(y_i_j) * int(loss_i < loss_j),
                          sample_weight=weights_i_j,
                      )
                  else:
                      base_model = self.fit_pairwise_model(
                          X_,
                          y_i_j,
                          weights_i_j,
                          self.rng,
                          self.configuration,
                      )
              models[i][j] = base_model
              weights[i][j] = weights_i_j
      self.models = models
      self.weights_ = weights
      self.target_indices = target_indices
  
imports: import typing
  import copy
  import itertools
  import numpy
  import pandas
  import scipy.stats
  import sklearn.ensemble
label_desc: Use image node_id 2 for calling the OneVSOneSelector obj's underlying member method code with example usage: obj.fit(X, y, minima, maxima) without return types