dsipts.TimeSeries.load_signal

TimeSeries.load_signal(data: DataFrame, enrich_cat: List[str] = [], past_variables: List[str] = [], future_variables: List[str] = [], target_variables: List[str] = [], cat_past_var: List[str] = [], cat_fut_var: List[str] = [], check_past: bool = True, group: None | str = None, check_holes_and_duplicates: bool = True, silly_model: bool = False, sampler_weights: None | str = None, loss_weights: None | str = None) → None
This is a crucial point in the data structure. We expect here to have a dataset with time as timestamp.
There are some checks:

1- the duplicates will be removed taking the first instance

2- the frequency will the inferred taking the minumum time distance between samples

3- the dataset will be filled completing the missing timestamps

Parameters:
  • data (pd.DataFrame) – input dataset the column indicating the time must be called time

  • enrich_cat (List[str], optional) – it is possible to let this function enrich the dataset for example adding the standard columns: hour, dow, month and minute. Defaults to [].

  • past_variables (List[str], optional) – list of column names of past variables not available for future times . Defaults to [].

  • future_variables (List[str], optional) – list of future variables available for tuture times. Defaults to [].

  • target_variables (List[str], optional) – list of the target variables. They will added to past_variables by default unless check_past is false. Defaults to [].

  • cat_past_var (List[str], optional) – list of the past categorical variables. Defaults to [].

  • cat_future_var (List[str], optional) – list of the future categorical variables. Defaults to [].

  • check_past (bool, optional) – see target_variables. Defaults to True.

  • group (sampler_weights) – if not None the

  • realization (time serie dataset is considered composed by omogeneus timeseries coming from different)

  • check_holes_and_duplicates (bool, optional) – if False duplicates or holes will not checked, the dataloader can not correctly work, disable at your own risk. Defaults True

  • silly_model (bool, optional) – if True, target variables will be added to the pool of the future variables. This can be useful to see if information passes throught the decoder part of your model (if any)

  • group – if it is a column name it will be used as weight for the sampler. Careful that the weight of the sample is the weight value of the fist target value (index)

  • loss_weights (str or None, optional) – name of a column used as loss weight of each target point: every future step of a sample is weighted by the value of this column at that time (applied to all the targets, multiplied by the model horizon_weights, NOT normalised). It is not an input of the model and it is not scaled. It must be finite and non-negative on the targets of the samples that are kept (samples with NaN in the past context or in the targets are dropped as usual, whatever the weight). It weights both the training and the validation loss (so the best epoch too) and works with quantiles, crps, l1 and mse. Use 0 to exclude a point from the loss while keeping its value in the inputs. Defaults to None.