sc2_datasets.transforms.pytorch.economy_vs_outcome

Functions

economy_average_vs_outcome(→ tuple[torch.Tensor, int])

Transforms the SC2ReplayData representation into averaged economy statistics

Module Contents

economy_average_vs_outcome(sc2_replay: sc2_datasets.replay_data.sc2_replay_data.SC2ReplayData) tuple[torch.Tensor, int]

Transforms the SC2ReplayData representation into averaged economy statistics and maps the winner and loser of the match.

Parameters:

sc2_replay (SC2ReplayData) – Specifies the parsed structure of a replay.

Returns:

Returns a tensor containing features and a target.

Return type:

tuple[torch.Tensor, torch.Tensor]

Examples

Correct Usage Examples:

This method may help you to operate with data on the game replay. Obtains averaged ecomomy statistics.

You should set sc2_replay parameter.

The parameters should be set as in the example below.

>>> economy_average_vs_outcome_object = economy_average_vs_outcome(
...        sc2_replay= sc2_replay: SC2ReplayData)
>>> assert isinstance(sc2_replay, SC2ReplayData)

Incorrect Usage Examples:

>>> wrong_type_object = int(2)
>>> economy_average_vs_outcome_object = economy_average_vs_outcome(
...        sc2_replay= wrong_type_object)
Traceback (most recent call last):
...
TypeError: unsupported operand type(s) ...

If you don’t set parameters or paste incorect parameters’ type.