Metrics

BaseMetric

class causal_world.metrics.BaseMetric(name)[source]
__init__(name)[source]

The metric base to be used for any metric to calculate over the episodes evaluated.

Parameters

name – (str) metric name.

get_metric_score()[source]
Returns

(float) the metric score calculated so far.

process_episode(episode_obj)[source]

Processes the episode to calculate the scores out of it.

Parameters

episode_obj – (causal_world.loggers.Episode) episode to process and calculate its metric.

Returns

reset()[source]

resets the metric calculation of episodes.

Returns

MeanAccumulatedRewardMetric

class causal_world.metrics.MeanAccumulatedRewardMetric[source]
__init__()[source]

The MeanAccumulatedRewardMetric to be used to calculate the mean accumlated reward over all episodes processed.

get_metric_score()[source]
Returns

(float) the metric score calculated so far.

process_episode(episode_obj)[source]

Processes the episode to calculate the scores out of it.

Parameters

episode_obj – (causal_world.loggers.Episode) episode to process and calculate its metric.

Returns

reset()[source]

resets the metric calculation of episodes.

Returns

MeanFullIntegratedFractionalSuccess

class causal_world.metrics.MeanFullIntegratedFractionalSuccess[source]
__init__()[source]

The MeanFullIntegratedFractionalSuccess to be used to calculate the mean of sum of fractional success over all episodes processed.

get_metric_score()[source]
Returns

(tuple) the mean of the metric score, the std of the metric score.

process_episode(episode_obj)[source]

Processes the episode to calculate the scores out of it.

Parameters

episode_obj – (causal_world.loggers.Episode) episode to process and calculate its metric.

Returns

reset()[source]

resets the metric calculation of episodes.

Returns

MeanLastFractionalSuccess

class causal_world.metrics.MeanLastFractionalSuccess[source]
__init__()[source]

The MeanLastFractionalSuccess to be used to calculate the mean last fractional success over all episodes processed.

get_metric_score()[source]
Returns

(tuple) the mean of the metric score, the std of the metric score.

process_episode(episode_obj)[source]

Processes the episode to calculate the scores out of it.

Parameters

episode_obj – (causal_world.loggers.Episode) episode to process and calculate its metric.

Returns

reset()[source]

resets the metric calculation of episodes.

Returns

MeanLastIntegratedFractionalSuccess

class causal_world.metrics.MeanLastIntegratedFractionalSuccess[source]
__init__()[source]

The MeanLastIntegratedFractionalSuccess to be used to calculate the mean over last 20 fractional successes over all episodes processed.

get_metric_score()[source]
Returns

(tuple) the mean of the metric score, the std of the metric score.

process_episode(episode_obj)[source]

Processes the episode to calculate the scores out of it.

Parameters

episode_obj – (causal_world.loggers.Episode) episode to process and calculate its metric.

Returns

reset()[source]

resets the metric calculation of episodes.

Returns