class_docstr: Base class for interfacing prophet and neuralprophet.
class_docstr_tok: ["Base","class","for","interfacing","prophet","and","neuralprophet","."]
docstr: Fit to training data.
  
  Parameters
  ----------
  y : pd.Series
      Target time series to which to fit the forecaster.
  X : pd.DataFrame, optional (default=None)
      Exogenous variables.
  fh : int, list or np.array, optional (default=None)
      The forecasters horizon with the steps ahead to to predict.
  
  Returns
  -------
  self : returns an instance of self.
docstr_tok: ["Fit","to","training","data",".","Parameters","--","--","--","--","--","y",":","pd.Series","Target","time","series","to","which","to","fit","the","forecaster",".","X",":","pd.DataFrame",",","optional","(","default=None",")","Exogenous","variables",".","fh",":","int",",","list","or","np.array",",","optional","(","default=None",")","The","forecasters","horizon","with","the","steps","ahead","to","to","predict",".","Returns","--","--","--","-","self",":","returns","an","instance","of","self","."]
code: def _fit(self, y, X, fh):
      """Fit to training data.
  
      Parameters
      ----------
      y : pd.Series
          Target time series to which to fit the forecaster.
      X : pd.DataFrame, optional (default=None)
          Exogenous variables.
      fh : int, list or np.array, optional (default=None)
          The forecasters horizon with the steps ahead to to predict.
  
      Returns
      -------
      self : returns an instance of self.
      """
      self._instantiate_model()
      self._check_changepoints()
  
      # sets y_index_was_period_ and self.y_index_was_int_ flags
      # to remember the index type of y before conversion
      self._remember_y_input_index_type(y)
  
      # various type input indices are converted to datetime
      # since facebook prophet can only deal with dates
      y = self._convert_input_to_date(y)
      X = self._convert_input_to_date(X)
  
      # We have to bring the data into the required format for fbprophet
      # the index should not be pandas index, but in a column named "ds"
      df = y.copy()
      df.columns = ["y"]
      df.index.name = "ds"
      df = df.reset_index()
  
      # Add seasonality/seasonalities
      if self.add_seasonality:
          if isinstance(self.add_seasonality, dict):
              self._forecaster.add_seasonality(**self.add_seasonality)
          elif isinstance(self.add_seasonality, list):
              for seasonality in self.add_seasonality:
                  self._forecaster.add_seasonality(**seasonality)
  
      # Add country holidays
      if self.add_country_holidays:
          self._forecaster.add_country_holidays(
              **self.add_country_holidays
          )
  
      # Add regressor (multivariate)
      if X is not None:
          X = X.copy()
          df, X = _merge_X(df, X)
          for col in X.columns:
              self._forecaster.add_regressor(col)
  
      # Add floor and bottom when growth is logistic
      if self.growth == "logistic":
          if self.growth_cap is None:
              raise ValueError(
                  "Since `growth` param is set to 'logistic', expecting `growth_cap`"
                  " to be non `None`: a float."
              )
  
          df["cap"] = self.growth_cap
          df["floor"] = self.growth_floor
  
      if hasattr(self, "fit_kwargs") and isinstance(
          self.fit_kwargs, dict
      ):
          fit_kwargs = self.fit_kwargs
      else:
          fit_kwargs = {}
      if self.verbose:
          self._forecaster.fit(df=df, **fit_kwargs)
      else:
          with _suppress_stdout_stderr():
              self._forecaster.fit(df=df, **fit_kwargs)
  
      return self
  
imports: import os
  import pandas
  from sktime.forecasting.base import BaseForecaster
label_desc: Use image node_id 4 for calling the _ProphetAdapter obj's underlying member method code with example usage: obj._fit(y, X, fh) and returns: self