paralleldomain.data_lab.config.distribution

class Bucket(*, proto=None, string_value=None, float_value=None, int32_value=None, probability=None)

A discrete value with an associated probability.

Parameters:
string_value

String name of the bucket.

float_value

Float value of the bucket.

int32_value

Integer value of the bucket.

probability

The probability associated with the bucket.

class CategoricalDistribution(*, proto=None, buckets=None)

Discrete probability distribution that describes the results of a random variable that can take on one of K possible categories, with the probability of each category (bucket) separately specified.

Parameters:
  • buckets (Optional[List[Bucket]]) – buckets

  • proto (Optional[pd_distributions_pb2.CategoricalDistribution]) –

buckets

The buckets which make up the distribution.

sample(random_seed)

Sample from a categorical distribution with buckets.

Parameters:

random_seed (int) – Random seed.

Return type:

Bucket

Returns:

Sampled value.

class ConstantDistribution(*, proto=None, string_value=None, float_value=None, int32_value=None)

A single sample distribution.

Parameters:
string_value

The string value of the distribution.

float_value

The float value of the distribution.

int32_value

The integer value of the distribution.

class ContinousUniformDistribution(*, proto=None, min=None, max=None)

A uniform distribution with constant probability.

Parameters:
min

Minimum value of the continuous normal distribution.

max

Maximum value of the continuous normal distribution.

sample(random_seed)

Sample from a continuous uniform distribution with min and max.

Parameters:

random_seed (int) – Random seed.

Return type:

Union[float, int]

Returns:

Sampled value.

class Distribution(*, proto=None, normal=None, truncated_normal=None, uniform_continous=None, constant=None, uniform_discrete=None, categorical=None)

A wrapper which contains a single distribution.

Parameters:
normal

A normal distribution.

truncated_normal

A truncated normal distribution.

uniform_continous

A continuous uniform distribution.

constant

A constant distribution.

uniform_discrete

A discrete uniform distribution.

categorical

A categorical distribution.

sample(random_seed)

Sample from a distribution.

Parameters:

random_seed (int) – Random seed.

Return type:

Union[str, int, float, Bucket]

Returns:

Sampled value.

class NormalDistribution(*, proto=None, mean=None, variance=None)

Normal distribution.

Parameters:
mean

Mean of the normal distribution.

variance

Variance of the normal distribution

sample(random_seed)

Sample from a normal distribution with mean and variance.

Parameters:

random_seed (int) – Random seed.

Return type:

Union[float, int]

Returns:

Sampled value.