class_docstr: Class to build a VAR model
      
class_docstr_tok: ["Class","to","build","a","VAR","model"]
docstr: Refits an already trained model using a new dataset
  Useful when fitting to the full data after testing with cross validation
  :param ts_df The time series data to be used for fitting the model
  :type ts_df pd.DataFrame
  :rtype object
docstr_tok: ["Refits","an","already","trained","model","using","a","new","dataset","Useful","when","fitting","to","the","full","data","after","testing","with","cross","validation",":","param","ts_df","The","time","series","data","to","be","used","for","fitting","the","model",":","type","ts_df","pd.DataFrame",":","rtype","object"]
code: def refit(self, ts_df: pd.DataFrame) -> object:
      """
      Refits an already trained model using a new dataset
      Useful when fitting to the full data after testing with cross validation
      :param ts_df The time series data to be used for fitting the model
      :type ts_df pd.DataFrame
      :rtype object
      """
      bestmodel = self.get_best_model(ts_df)
      print("Refitting data with previously found best parameters")
      try:
          self.model = bestmodel.fit(disp=False)
          print(
              "    Best %s metric = %0.1f"
              % (self.scoring, eval("self.model." + self.scoring))
          )
      except Exception as exception:
          print(exception)
  
      return self
  
imports: import pdb
  from typing import Optional
  import warnings
  import itertools
  import operator
  import copy
  import numpy
  import pandas
  from pandas.core.generic import NDFrame
  import dask
  import dask.dataframe
  import matplotlib.pyplot
  import seaborn
  from statsmodels.tsa.statespace.varmax import VARMAX
  from sklearn.model_selection import TimeSeriesSplit
  from ...utils import print_dynamic_rmse
  from ...models.ar_based.param_finder import find_lowest_pq
  from ..build_base import BuildBase
label_desc: Use image node_id 5 for calling the BuildVAR obj's underlying member method code with example usage: obj.refit(ts_df) and returns: self