mdx.behavior_learning.data_transformer module

class DataTransformer(config)

Bases: object

Module provides helper functions for data tranformation such as normalization or interpolation.

Parameters:

config (dict) – configuration for the module

data_transformer = DataTransformer(config)
extrapolate_locations(location: dict)

Extrapolates the coordinates of a behavior to a configured fixed number of points. The start and end points of the behavior remain the same, intermediary points are redistributed.

Parameters:

location (dict) – location dict/field in behavior data.

Returns:

new location dict with interpolated coordinates.

Return type:

python dict

behavior_df["locations"].map(data_transformer.extrapolate_locations)
normalize_locations(location)

Normalizes the coordinates of a behavior w.r.t to min and max values of lat and lon.

Parameters:

location (dict) – location dict/field in behavior data.

Returns:

new location dict with normalized coordinates.

Return type:

python dict

behavior_df["locations"].map(data_transformer.normalize_locations)
update_config(new_config)

Updates the config of the module with the user provided config.

Parameters:

new_config (dict) – New config for update.

Returns:

none

data_transformer.update_config(new_config)