docstr: Scale the time series dataset's feature column and target column.
  
  :param scaler: sklearn scaler instance, StandardScaler, MaxAbsScaler,
         MinMaxScaler and RobustScaler are supported.
  :param fit: if we need to fit the scaler. Typically, the value should
         be set to True for training set, while False for validation and
         test set. The value is defaulted to True.
  
  :return: the tsdataset instance.
  
  Assume there is a training set tsdata and a test set tsdata_test.
  scale() should be called first on training set with default value fit=True,
  then be called on test set with the same scaler and fit=False.
  
  >>> from sklearn.preprocessing import StandardScaler
  >>> scaler = StandardScaler()
  >>> tsdata.scale(scaler, fit=True)
  >>> tsdata_test.scale(scaler, fit=False)
docstr_tok: ["Scale","the","time","series","dataset","'s","feature","column","and","target","column",".",":","param","scaler",":","sklearn","scaler","instance",",","StandardScaler",",","MaxAbsScaler",",","MinMaxScaler","and","RobustScaler","are","supported",".",":","param","fit",":","if","we","need","to","fit","the","scaler",".","Typically",",","the","value","should","be","set","to","True","for","training","set",",","while","False","for","validation","and","test","set",".","The","value","is","defaulted","to","True",".",":","return",":","the","tsdataset","instance",".","Assume","there","is","a","training","set","tsdata","and","a","test","set","tsdata_test",".","scale","(",")","should","be","called","first","on","training","set","with","default","value","fit=True",",","then","be","called","on","test","set","with","the","same","scaler","and","fit=False",".",">",">",">","from","sklearn.preprocessing","import","StandardScaler",">",">",">","scaler","=","StandardScaler","(",")",">",">",">","tsdata.scale","(","scaler",",","fit=True",")",">",">",">","tsdata_test.scale","(","scaler",",","fit=False",")"]
code: def scale(self, scaler, fit=True):
      """
      Scale the time series dataset's feature column and target column.
  
      :param scaler: sklearn scaler instance, StandardScaler, MaxAbsScaler,
             MinMaxScaler and RobustScaler are supported.
      :param fit: if we need to fit the scaler. Typically, the value should
             be set to True for training set, while False for validation and
             test set. The value is defaulted to True.
  
      :return: the tsdataset instance.
  
      Assume there is a training set tsdata and a test set tsdata_test.
      scale() should be called first on training set with default value fit=True,
      then be called on test set with the same scaler and fit=False.
  
      >>> from sklearn.preprocessing import StandardScaler
      >>> scaler = StandardScaler()
      >>> tsdata.scale(scaler, fit=True)
      >>> tsdata_test.scale(scaler, fit=False)
      """
      feature_col = self.feature_col
      if self.roll_additional_feature:
          feature_col = []
          for feature in self.feature_col:
              if feature not in self.roll_additional_feature:
                  feature_col.append(feature)
      if fit:
          self.df[self.target_col + feature_col] = scaler.fit_transform(
              self.df[self.target_col + feature_col]
          )
      else:
          from sklearn.utils.validation import check_is_fitted
  
          try:
              assert not check_is_fitted(scaler)
          except Exception:
              raise AssertionError(
                  "When calling scale for the first time, \
                      you need to set fit=True."
              )
          self.df[self.target_col + feature_col] = scaler.transform(
              self.df[self.target_col + feature_col]
          )
      self.scaler = scaler
      return self
  
imports: import pandas
  import numpy
  import functools
  from zoo.chronos.data.utils.feature import generate_dt_features, generate_global_features
  from zoo.chronos.data.utils.impute import impute_timeseries_dataframe
  from zoo.chronos.data.utils.deduplicate import deduplicate_timeseries_dataframe
  from zoo.chronos.data.utils.roll import roll_timeseries_dataframe
  from zoo.chronos.data.utils.scale import unscale_timeseries_numpy
  from zoo.chronos.data.utils.resample import resample_timeseries_dataframe
  from zoo.chronos.data.utils.split import split_timeseries_dataframe
  from zoo.chronos.data.utils.utils import _to_list, _check_type, _check_col_within, _check_col_no_na, _check_is_aligned, _check_dt_is_sorted
  from tsfresh.utilities.dataframe_functions import roll_time_series
  from tsfresh.utilities.dataframe_functions import impute
  from tsfresh import extract_features
  from tsfresh.feature_extraction import ComprehensiveFCParameters, MinimalFCParameters, EfficientFCParameters
label_desc: Use image node_id 14 for calling the TSDataset obj's underlying member method code with example usage: obj.scale(scaler, fit) and returns: self