eugene.preprocess.clamp_targets_sdata

eugene.preprocess.clamp_targets_sdata(sdata, target_vars, percentile=0.995, train_var=None, clamp_nums=None, store_clamp_nums=False, suffix=False, copy=False)

Clamp targets to a given percentile in a SeqData object.

Parameters:
  • sdata (xr.Dataset) – SeqData object.

  • target_vars (list) – List of target variables to clamp.

  • percentile (float, optional) – Percentile to clamp to, by default 0.995

  • train_var (str, optional) – Key to use if you only want to calculate percentiles on training data, by default None

  • clamp_nums (list, optional) – You can provide numbers to clamp to, by default None

  • store_clamp_nums (bool, optional) – Whether to store the clamp numbers in the SeqData object, by default False

  • suffix (bool, optional) – Whether to add a suffix to the variable name, by default False

  • copy (bool, optional) – Whether to return a copy of the SeqData object, by default False

Returns:

SeqData object with clamped targets. If copy is True, a copy of the SeqData object is returned, else the original SeqData object is modified in place.

Return type:

SeqData