lapspython.stats

Collect statistics for program translations.

Classes

Statistics([result])

Collect statistics for translated frontiers and results.

class lapspython.stats.Statistics(result: Optional[lapspython.types.CompactResult] = None)[source]

Collect statistics for translated frontiers and results.

summarize(result: lapspython.types.CompactResult) dict[source]

Compute descriptive statistics for given result.

Parameters

result (lapspython.types.CompactResult) – Translated checkpoint.

Returns

Descriptive statistics.

Return type

dict

plot_histogram(result: lapspython.types.CompactResult) None[source]

Print histogram of percentages to terminal.

Parameters

result (CompactResult) – Translated checkpoint.

count_programs(result: lapspython.types.CompactResult) int[source]

Count totals number of programs across all tasks.

Parameters

result (lapspython.types.CompactResult) – Translated checkpoint.

Return type

int

count_translations(result: lapspython.types.CompactResult) int[source]

Count total number of correct translations across all tasks.

Parameters

result (lapspython.types.CompactResult) – Translated checkpoint.

Return type

int

percentages_result(result: lapspython.types.CompactResult) List[float][source]

Return percentage of correctly translated programs per frontier.

Parameters

result (lapspython.types.CompactResult) – Translated checkpoint.

Return type

List[float]

percentage_frontier(frontier: lapspython.types.CompactFrontier) float[source]

Return percentage of correctly translated programs.

Parameters

result (lapspython.types.CompactFrontier) – Translated frontier (task).

Return type

float