Skip to content
This repository was archived by the owner on Jun 1, 2021. It is now read-only.
This repository was archived by the owner on Jun 1, 2021. It is now read-only.

Code mentioned in installation instruction is of older Python version.  #160

Description

@amirsultan

Updated code as per Python version 3

from planout.experiment import SimpleExperiment
from planout.ops.random import *

class FirstExperiment(SimpleExperiment):
def assign(self, params, userid):
params.button_color = UniformChoice(choices=['#ff0000', '#00ff00'], unit=userid)
params.button_text = WeightedChoice(
choices=['Join now!', 'Sign up.'],
weights=[0.3, 0.7], unit=userid)

my_exp = FirstExperiment(userid=12)

parameters may be accessed via the . operator

print(my_exp.get('button_text'), my_exp.get('button_color'))

experiment objects include all input data

for i in range(6):
print(FirstExperiment(userid=i))

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions