Skip to main content

subrand

subrand(range=(0, 1), axis=none, dist=uniform, log=false, dims=none, p=1.0)

Random subtraction operation.

The operand is sampled from random distribution, based on dist, and applied to the data based on the axis.

A list of one or more indices can be specified via dims, to apply the operation to specific features, and the probability of the operation being applied to the data can be set with p.

Arguments

  • range (tuple[float|int,float|int]): Range parameter values for random distribution, based on dist.

    Default: (0, 1)

  • axis (str|none): Optional axis along which random value should be applied.

    • none: a single random value is applied globally to the entire sequence.
    • time: random values are applied, one for each time step, but constant for all feature at each time step.
    • feature: random values are applied, one for each feature, but constant for all time steps at each feature.
    • element: random values are applied, one for each element in the data—i.e., element-wise.

    Default: none

  • dist (str): Random distribution to sample from.

    • uniform: Even distribution. The range values denote the minimum and maximum value, respectively.
    • normal: Gaussian distribution. The range values denote the mean and standard deviation, respectively.

    Default: uniform

  • log (bool): Apply operation in log base 2 space. If true, the random operand becomes 2 ** r, where r is the randomly generated value.

    Default: false

  • dims (int|list[int]|none): Feature dimensions to apply operation to. If none, all feature dimensions are used.

    Default: none

  • p (float): Probability for operation to be applied to data sequence, between 0 and 1.

    Default: 1.0