docstr: Sampling by rolling for machine learning/deep learning models.
  
  :param lookback: int, lookback value.
  :param horizon: int or list,
         if `horizon` is an int, we will sample `horizon` step
         continuously after the forecasting point.
         if `horizon` is a list, we will sample discretely according
         to the input list.
         specially, when `horizon` is set to 0, ground truth will be generated as None.
  :param feature_col: str or list, indicates the feature col name. Default to None,
         where we will take all available feature in rolling.
  :param target_col: str or list, indicates the target col name. Default to None,
         where we will take all target in rolling. it should be a subset of target_col
         you used to initialize the xshardtsdataset.
  :param id_sensitive: bool,
         |if `id_sensitive` is False, we will rolling on each id's sub dataframe
         |and fuse the sampings.
         |The shape of rolling will be
         |x: (num_sample, lookback, num_feature_col + num_target_col)
         |y: (num_sample, horizon, num_target_col)
         |where num_sample is the summation of sample number of each dataframe
         |if `id_sensitive` is True, we have not implement this currently.
  
  :return: the xshardtsdataset instance.
docstr_tok: ["Sampling","by","rolling","for","machine","learning\/deep","learning","models",".",":","param","lookback",":","int",",","lookback","value",".",":","param","horizon",":","int","or","list",",","if","`","horizon","`","is","an","int",",","we","will","sample","`","horizon","`","step","continuously","after","the","forecasting","point",".","if","`","horizon","`","is","a","list",",","we","will","sample","discretely","according","to","the","input","list",".","specially",",","when","`","horizon","`","is","set","to","0",",","ground","truth","will","be","generated","as","None",".",":","param","feature_col",":","str","or","list",",","indicates","the","feature","col","name",".","Default","to","None",",","where","we","will","take","all","available","feature","in","rolling",".",":","param","target_col",":","str","or","list",",","indicates","the","target","col","name",".","Default","to","None",",","where","we","will","take","all","target","in","rolling",".","it","should","be","a","subset","of","target_col","you","used","to","initialize","the","xshardtsdataset",".",":","param","id_sensitive",":","bool",",","|if","`","id_sensitive","`","is","False",",","we","will","rolling","on","each","id","'s","sub","dataframe","|and","fuse","the","sampings",".","|The","shape","of","rolling","will","be","|x",":","(","num_sample",",","lookback",",","num_feature_col","+","num_target_col",")","|y",":","(","num_sample",",","horizon",",","num_target_col",")","|where","num_sample","is","the","summation","of","sample","number","of","each","dataframe","|if","`","id_sensitive","`","is","True",",","we","have","not","implement","this","currently",".",":","return",":","the","xshardtsdataset","instance","."]
code: def roll(
      self,
      lookback,
      horizon,
      feature_col=None,
      target_col=None,
      id_sensitive=False,
  ):
      """
      Sampling by rolling for machine learning/deep learning models.
  
      :param lookback: int, lookback value.
      :param horizon: int or list,
             if `horizon` is an int, we will sample `horizon` step
             continuously after the forecasting point.
             if `horizon` is a list, we will sample discretely according
             to the input list.
             specially, when `horizon` is set to 0, ground truth will be generated as None.
      :param feature_col: str or list, indicates the feature col name. Default to None,
             where we will take all available feature in rolling.
      :param target_col: str or list, indicates the target col name. Default to None,
             where we will take all target in rolling. it should be a subset of target_col
             you used to initialize the xshardtsdataset.
      :param id_sensitive: bool,
             |if `id_sensitive` is False, we will rolling on each id's sub dataframe
             |and fuse the sampings.
             |The shape of rolling will be
             |x: (num_sample, lookback, num_feature_col + num_target_col)
             |y: (num_sample, horizon, num_target_col)
             |where num_sample is the summation of sample number of each dataframe
             |if `id_sensitive` is True, we have not implement this currently.
  
      :return: the xshardtsdataset instance.
      """
      from bigdl.nano.utils.common import invalidInputError
  
      if id_sensitive:
          invalidInputError(
              False, "id_sensitive option has not been implemented."
          )
      feature_col = (
          _to_list(feature_col, "feature_col")
          if feature_col is not None
          else self.feature_col
      )
      target_col = (
          _to_list(target_col, "target_col")
          if target_col is not None
          else self.target_col
      )
      self.numpy_shards = self.shards.transform_shard(
          roll_timeseries_dataframe,
          None,
          lookback,
          horizon,
          feature_col,
          target_col,
          self.id_col,
          0,
          True,
      )
      self.scaler_index = [
          self.target_col.index(target_col[i])
          for i in range(len(target_col))
      ]
  
      return self
  
imports: from bigdl.orca.data.shard import SparkXShards
  from bigdl.orca.learn.utils import dataframe_to_xshards_of_pandas_df
  from bigdl.chronos.data.utils.utils import _to_list, _check_type
  from bigdl.chronos.data.utils.roll import roll_timeseries_dataframe
  from bigdl.chronos.data.utils.impute import impute_timeseries_dataframe
  from bigdl.chronos.data.utils.split import split_timeseries_dataframe
  from bigdl.chronos.data.experimental.utils import add_row, transform_to_dict
  from bigdl.chronos.data.utils.scale import unscale_timeseries_numpy
  from bigdl.chronos.data.utils.feature import generate_dt_features
  import pandas
label_desc: Use image node_id 4 for calling the XShardsTSDataset obj's underlying member method code with example usage: obj.roll(lookback, horizon, feature_col, target_col, id_sensitive) and returns: self