code: def test_fit_on_residuals(self):
      model = StatsForecastAutoETS(season_length=12, model="ZZZ")
  
      # test if we are indeed fitting the AutoETS on the residuals of the linear regression
      model.fit(
          series=self.ts_pass_train,
          future_covariates=self.ts_trend_train,
      )
  
      # create the residuals from the linear regression
      fitted_values_linreg = model._linreg.model.predict(
          X=self.ts_trend_train.values(copy=False)
      )
      fitted_values_linreg_ts = TimeSeries.from_times_and_values(
          times=self.ts_pass_train.time_index,
          values=fitted_values_linreg,
      )
      resids = self.ts_pass_train - fitted_values_linreg_ts
  
      # now make in-sample predictions with the AutoETS model
      in_sample_preds = model.model.predict_in_sample()["fitted"]
      ts_in_sample_preds = TimeSeries.from_times_and_values(
          times=self.ts_pass_train.time_index, values=in_sample_preds
      )
  
      # compare in-sample predictions to the residuals they have supposedly been fitted on
      current_mae = mae(resids, ts_in_sample_preds)
  
      assert current_mae < 9
  
file_path: darts/darts/tests/models/forecasting/test_sf_auto_ets.py
imports: import numpy
  import pandas
  from darts import TimeSeries
  from darts.datasets import AirPassengersDataset
  from darts.metrics import mae
  from darts.models import LinearRegressionModel, StatsForecastAutoETS
label_desc: Use image node_id 1 for calling the TestStatsForecastAutoETS obj's underlying member method code with example usage: obj.test_fit_on_residuals() without return types