meridian.model.transformers.MediaTransformer

Contains forward and inverse media transformation methods.

Inherits From: TensorTransformer

This class stores scale factors computed from per-geo medians of the media data, normalized by the geo population.

media A tensor of dimension (n_geos, n_media_times, n_media_channels) containing the media data, used to compute the scale factors.
population A tensor of dimension (n_geos,) containing the population of each geo, used to compute the scale factors.

population_scaled_median_m

Methods

forward

View source

Scales a given tensor using the stored scale factors.

inverse

View source

Scales a given tensor using the inversed stored scale factors.