Utilities#

Utility functions.

action_effective

Test for the effect of the action on the state in the data H(state|prev_action) based on their conditional entropies.

action_reward

Test for the effect of the action on the reward in the data H(reward|prev_action).

backtest

Utility to perform backtesting on simulator.

better_than_random

Tests if the information gain of the input series given a conditioning series H(Y|X) is better than random.

conditional_entropy

The conditional entropy of the input series given a conditioning series H(Y|X).

data_generator_simple

Generate different types of data for your testing.

entropy

The entropy of the input series.

force_assert

Raise AssertionError when condition is False.

information_gain

Calculate the information gain of the input series given a conditioning series H(Y|X).

is_markovian

Test for the Markov property in the data H(state|prev_state, prev_action) based on their conditional entropies.

markovian_matrix

Test for the key MDP properties based on their conditional entropies.

normalized_markovian_matrix

Test for the key MDP properties based on their conditional entropies.

plot_information

Plot the results of MDP checks on dataframe data.

reward_function

Test for a reward function in the data H(r|state,action) based on their conditional entropies.

set_seed

Minimalistic implementation to fix random seeds in python.random, numpy, and pytorch.

stationary_policy

Test for a stationary policy in the data H(action|state) based on their conditional entropies.

tokenize

Concats all columns to one.