class_docstr: Fit a polynomial of the given order and resample data onto predicted curve.
class_docstr_tok: ["Fit","a","polynomial","of","the","given","order","and","resample","data","onto","predicted","curve","."]
code: def _fit_predict(self, data):
      x = data["x"]
      y = data["y"]
      if x.nunique() <= self.order:
          # TODO warn?
          xx = yy = []
      else:
          p = np.polyfit(x, y, self.order)
          xx = np.linspace(x.min(), x.max(), self.gridsize)
          yy = np.polyval(p, xx)
  
      return pd.DataFrame(dict(x=xx, y=yy))
  
file_path: seaborn/seaborn/_stats/regression.py
imports: from __future__ import annotations
  from dataclasses import dataclass
  import numpy
  import pandas
  from seaborn._stats.base import Stat
label_desc: Use image node_id 1 for calling the PolyFit obj's underlying member method code with example usage: obj._fit_predict(data) and returns: pd