explainable_rl.evaluation package

Submodules

explainable_rl.evaluation.evaluator module

class Evaluator(engines)[source]

Bases: object

Evaluator class which evaluates a list of trained agents and produces RL evaluation graphs.

__init__(engines)[source]

Initialise the Evaluator.

Parameters

engines (Engine or List[Engine]) – one or list of trained engine

_get_evaluation_results()[source]

Evaluate the engines on the test set.

This method fills in self.eval_results, which is a list of dictionaries containing all the relevant evaluation metrics.

agent_array_rewards()[source]

Calculate the individual agent rewards for each test set sample.

Returns

array of agent rewards on test set.

Return type

agent_array_rewards (List[float])

agent_cum_rewards()[source]

Calculate the cumulative agent rewards on test set.

Returns

total reward on test set using historical policy.

Return type

agent_cum_rewards (float)

hist_array_rewards()[source]

Calculate the individual historical rewards for each test set sample.

Returns

array of historical rewards on test set.

Return type

hist_array_rewards (List[float])

hist_cum_rewards()[source]

Calculate the cumulative historical rewards on test set.

Returns

total reward on test set using historical policy.

Return type

hist_cum_rewards (float)

plot_reward_distribution()[source]

Plot the distribution of rewards on the evaluation set.

plot_training_curve()[source]

Plot the training reward for a list of runs.

Module contents