sc2_datasets.transforms.utils ============================= .. py:module:: sc2_datasets.transforms.utils Attributes ---------- .. autoapisummary:: sc2_datasets.transforms.utils.RESULT_DICT Functions --------- .. autoapisummary:: sc2_datasets.transforms.utils.filter_player_stats sc2_datasets.transforms.utils.average_player_stats sc2_datasets.transforms.utils.select_apm_1v1 sc2_datasets.transforms.utils.select_outcome_1v1 Module Contents --------------- .. py:data:: RESULT_DICT .. py:function:: filter_player_stats(sc2_replay: sc2_datasets.replay_data.sc2_replay_data.SC2ReplayData) -> dict[str, list[sc2_datasets.replay_parser.tracker_events.events.player_stats.player_stats.PlayerStats]] Filters PlayerStats events and places them in lists based on the playerId. :param sc2_replay: Specifies the replay that the outcome will be selected from. :type sc2_replay: SC2ReplayData :returns: Returns a dictionary containing a mapping from playerId to the respective player stats. :rtype: dict[str, list[PlayerStats]] .. rubric:: Examples **Correct Usage Examples:** The use of this method is intended to filter player's events from the game based on playerId You should set sc2_replay parameter. May help you in analysing on the dataset. The parameters should be set as in the example below. >>> filter_player_stats_object = filter_player_stats( ... sc2_replay= sc2_replay: SC2ReplayData) >>> assert isinstance(sc2_replay, SC2ReplayData) **Incorrect Usage Examples:** >>> wrong_type_object = int(2) >>> filter_player_stats_object = filter_player_stats( ... 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. Will throw an exception if the player's id in the game is greater than 2. .. py:function:: average_player_stats(sc2_replay: sc2_datasets.replay_data.sc2_replay_data.SC2ReplayData) -> dict[str, list[float]] Exposes the logic of selecting and averaging PlayerStats events from within TrackerEvents list. :param sc2_replay: Specifies the replay that the outcome will be selected from. :type sc2_replay: SC2ReplayData :returns: Returns a dictionary containing averaged features. :rtype: dict[str, list[float]] .. rubric:: Examples **Correct Usage Examples:** The use of this method is intended to average stats of the player from the game. You should set sc2_replay parameter. The parameters should be set as in the example below. >>> average_player_stats_object = average_player_stats( ... sc2_replay= sc2_replay: SC2ReplayData) >>> assert isinstance(sc2_replay, SC2ReplayData) **Incorrect Usage Examples:** >>> wrong_type_object = int(2) >>> average_player_stats_object = average_player_stats( ... 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. .. py:function:: select_apm_1v1(sc2_replay: sc2_datasets.replay_data.sc2_replay_data.SC2ReplayData) -> dict[str, int] Exposes logic for selecting APM from replay data. :param sc2_replay: Specifies the replay that the outcome will be selected from. :type sc2_replay: SC2ReplayData :returns: Returns player id to APM mapping. :rtype: dict[str, int] .. rubric:: Examples **Correct Usage Examples:** The use of this method is intended to check the value of the correct APM from the selected replay. The parameters should be set as in the example below. >>> select_apm_1v1_object = select_apm_1v1( ... sc2_replay= sc2_replay: SC2ReplayData) >>> assert isinstance(sc2_replay, SC2ReplayData) **Incorrect Usage Examples:** >>> wrong_type_object = int(2) >>> select_apm_1v1_object = select_apm_1v1( ... 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. .. py:function:: select_outcome_1v1(sc2_replay: sc2_datasets.replay_data.sc2_replay_data.SC2ReplayData) -> dict[str, int] Exposes logic for selecting game outcome of a 1v1 game. Maps loss to 0, and win to 1. :param sc2_replay: Specifies the replay that the outcome will be selected from. :type sc2_replay: SC2ReplayData :returns: Returns a dictionary mapping loss to 0, and win to 1 for playerIDs. :rtype: dict[str, int] .. rubric:: Examples The use of this method is intended to check logic value of the selected 1v1 game, lose or win You should set sc2_replay parameter. The parameters should be set as in the example below. >>> select_outcome_1v1_object = select_outcome_1v1( ... sc2_replay= sc2_replay: SC2ReplayData) >>> assert isinstance(sc2_replay, SC2ReplayData) **Incorrect Usage Examples:** >>> wrong_type_object = int(2) >>> select_outcome_1v1_object = select_outcome_1v1( ... 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.