banditpylib

Functions

banditpylib.argmax_or_min(values: List[float], find_min: bool = False)int[source]

Find index with the largest or smallest value

Parameters
  • values – a list of values

  • find_min – whether to select smallest value

Returns

index with the largest or smallest value. When there is a tie, randomly output one of the indexes.

banditpylib.argmax_or_min_tuple(values: List[Tuple[float, int]], find_min: bool = False)int[source]

Find the second element of the tuple with the largest or smallest value

Parameters
  • values – a list of tuples

  • find_min – whether to select smallest value

Returns

the second element of the tuple with the largest or smallest value. When there is a tie, randomly output one of them.

banditpylib.parse_trials_from_bytes(data: bytes)List[data_pb2.Trial][source]

Parse trials from bytes

Parameters

data – bytes data

Returns

trial protobuf messages

banditpylib.trials_to_dataframe(filename: str)pandas.core.frame.DataFrame[source]

Read bytes file storing trials and transform to pandas DataFrame

Parameters

filename – file name

Returns

pandas dataframe