class_docstr: The CurveFitForecaster takes a function and fits it by using scipy curve_fit.
  
  The CurveFitForecaster uses the scipy curve_fit method to determine the optimal
  parameters for a given function.
  
  If the index is an integer index, it directly uses the index values.
  If the index is a `pd.DatetimeIndex` or a `pd.PeriodIndex`, the index values
  are transformed into floats using two distinct approaches:
  
  1. For a `pd.DatetimeIndex`, it calculates the number of days since 1970-01-01.
     For a `pd.PeriodIndex`, it computes the number of (full) periods since
      1970-01-01.
  
  2. For a `pd.DatetimeIndex`, it calculates the number of days since the first
     index value.
     For a  `pd.PeriodIndex`, it calculates or the number of (dull) periods since
     the first index value.
  Furthermore, the difference between the index values can be normalised by
  setting the difference between the first and the second index value to one.
  
  In `fit`
  1. The index of the input time series is transformed to a list of floats.
  2. The scipy curve_fit is called using the list of floats as x values,
     and the time series values as y values.
  In `predict`
  1. The ForecastingHorizon is transformed to a list of floats.
  2. The list of floats is passed together with the fitted parameters to the
     function to provide the forecast.
  
  Parameters
  ----------
  function: Callable[[Iterable[float], ...], Iterable[float]]
      The function that should be fitted and used to make forecasts.
      The signature of the functions is `function(x, ...)`.
      It takes the independent variables as first argument and the parameters
      to fit as separate remaining arguments.
      See scipy.optimize.curve_fit for more information.
  curve_fit_params: dict, default=None
      Additional parameters that should be passed to the curve_fit method.
      See scipy.optimize.curve_fit for more information.
  origin: {"unix_zero", "first_index"}, default="unix_zero"
      The origin of the time series index.
  normalise_index: bool, default=False
      If True, the differences between the index values are normalised by
      setting the difference between the first and second index value to one.
  
  Examples
  --------
  >>> from sktime.forecasting.trend import CurveFitForecaster
  >>> from sktime.datasets import load_airline
  >>> y = load_airline()
  >>> def linear_function(x, a, b):
  ...     return a * x + b
  >>> forecaster = CurveFitForecaster(function=linear_function,
  ...                                 curve_fit_params={"p0":[-1, 1]})
  >>> forecaster.fit(y)
  CurveFitForecaster(...)
  >>> y_pred = forecaster.predict(fh=[1, 2, 3])
code: def __init__(
      self,
      function,
      curve_fit_params=None,
      origin="unix_zero",
      normalise_index=False,
  ):
      self.function = function
      self.curve_fit_params = curve_fit_params
      self._curve_fit_params = (
          curve_fit_params if curve_fit_params is not None else {}
      )
      if origin not in ["unix_zero", "first_index"]:
          raise ValueError(
              f"origin must be 'unix_zero' or 'first_index', but found {origin}"
          )
      self.origin = origin
      self.normalise_index = normalise_index
      super().__init__()
  
file_path: sktime/sktime/forecasting/trend/_curve_fit_forecaster.py
imports: import pandas
  from scipy.optimize import curve_fit
  from sktime.forecasting.base import BaseForecaster
  from sktime.forecasting.trend._util import _get_X_numpy_int_from_pandas
label_desc: Use image node_id 1 to create a new CurveFitForecaster object from inherited base classes: BaseForecaster with example: obj = CurveFitForecaster(function, curve_fit_params, origin, normalise_index)