code: def fit(self, xdata, ydata):
      assert len(xdata.T[0]) == len(ydata)
      r, p = pearsonr(xdata.T[0], ydata)
      if r < 0:
          self.direction = -1
      df = pd.DataFrame({"x": xdata.T[0] * self.direction, "y": ydata})
      # Average runs of isotonic regression
      pred = np.zeros(len(df), dtype=np.float64)
      for i in range(self.n):
          sample_df = df.sample(frac=0.5)
          pred += (
              1
              / self.n
              * IsotonicRegression(
                  y_max=1, y_min=0, out_of_bounds="clip"
              )
              .fit(sample_df.x.values, sample_df.y.values)
              .predict(df.x.values)
          )
      self.output = pred * self.direction
      return self
  
file_path: scattertext/scattertext/smoothing/mean_isotonic.py
imports: import pandas
  import numpy
  from scipy.stats import pearsonr
  from sklearn.isotonic import IsotonicRegression
label_desc: Use image node_id 2 for calling the MeanIsotonic obj's underlying member method code with example usage: obj.fit(xdata, ydata) and returns: self