baseplate.experiments.providers.simple_experiment

Classes

class baseplate.experiments.providers.simple_experiment.SimpleExperiment(id, name, owner, start_ts, stop_ts, config, experiment_version, shuffle_version, variant_set, bucket_seed, bucket_val, targeting, overrides, enabled=True, log_bucketing=True, num_buckets=1000)

A basic experiment choosing from a set of variants.

Simple experiments are meant to be used in conjunction with a VariantSet. This class serves as the replacement for the legacy r2 and feature_flag providers.

Parameters:
  • id (int) – The experiment id. This should be unique.
  • name (string) – The human-readable name of the experiment.
  • owner (string) – Who is responsible for this experiement.
  • start_ts (int) – When this experiment is due to start. Variant requests prior to this time will return None. Expects timestamp in seconds.
  • stop_ts (int) – When this experiment is due to end. Variant requests after this time will return None. Expects timestamp in seconds.
  • config (dict) – The configuration for this experiment.
  • experiment_version (int) – Which version of this experiment is being used. This value should increment with each successive change to the experimental configuration.
  • shuffle_version (int) – Distinct from the experiment version, this value is used in constructing the default bucketing seed value (if not provided). When this value changes, rebucketing will occur.
  • variants (list) – The list of variants for this experiment. This should be provided as an array of dicts, each containing the keys ‘name’ and ‘size’. Name is the variant name, and size is the fraction of users to bucket into the corresponding variant. Sizes are expressed as a floating point value between 0 and 1.
  • bucket_seed (str) – If provided, this provides the seed for determining which bucket a variant request lands in. Providing a consistent bucket_seed will ensure a user is bucketed consistently. Calls to the variant method will return consisten results for any given seed.
  • enabled (bool) – Whether or not this experiment is enabled. disabling an experiment means all variant calls will return None.
  • log_bucketing (bool) – Whether or not to log bucketing events.
  • num_buckets (int) – How many available buckets there are for bucketing requests. This should match the num_buckets in the provided VariantSet. The default value is 1000, which provides a potential variant granularity of 0.1%.