docstr: Using kwargs to pass additional parameters to the fit()
docstr_tok: ["Using","kwargs","to","pass","additional","parameters","to","the","fit","(",")"]
code: def test_fit_kwargs(self):
      """Using kwargs to pass additional parameters to the fit()"""
      # using default optimization method
      model = ExponentialSmoothing()
      model.fit(self.series)
      assert model.fit_kwargs == {}
      pred = model.predict(n=2)
  
      model_bis = ExponentialSmoothing()
      model_bis.fit(self.series)
      assert model_bis.fit_kwargs == {}
      pred_bis = model_bis.predict(n=2)
  
      # two methods with the same parameters should yield the same forecasts
      assert pred.time_index.equals(pred_bis.time_index)
      np.testing.assert_array_almost_equal(
          pred.values(), pred_bis.values()
      )
  
      # change optimization method
      model_ls = ExponentialSmoothing(method="least_squares")
      model_ls.fit(self.series)
      assert model_ls.fit_kwargs == {"method": "least_squares"}
      pred_ls = model_ls.predict(n=2)
  
      # forecasts should be slightly different
      assert pred.time_index.equals(pred_ls.time_index)
      assert all(np.not_equal(pred.values(), pred_ls.values()))
  
file_path: darts/darts/tests/models/forecasting/test_exponential_smoothing.py
imports: import numpy
  import pytest
  from darts import TimeSeries
  from darts.models import ExponentialSmoothing
  from darts.utils import timeseries_generation
label_desc: Use image node_id 5 for calling the TestExponentialSmoothing obj's underlying member method code with example usage: obj.test_fit_kwargs() without return types