Reads data from an xarray.Dataset
object.
Inherits From: InputDataLoader
meridian
.
data
.
load
.
XrDatasetDataLoader
(
dataset
:
xr
.
Dataset
,
kpi_type
:
str
,
name_mapping
:
(
Mapping
[
str
,
str
]
|
None
)
=
None
)
Example:
data_loader
=
XrDatasetDataLoader
(
pickle
.
loads
(
'data.pickle'
))
data
=
data_loader
.
load
()
Args
A string denoting whether the KPI is of a
'revenue'
or 'non-revenue'
type. When the kpi_type
is 'non-revenue'
and revenue_per_kpi
exists, ROI calibration is used and the analysis is
run on revenue. When revenue_per_kpi
doesn't exist for the same kpi_type
, custom ROI calibration is used and the analysis is run on
KPI.An optional dictionary whose keys are the current
coordinates or array names in the
input
dataset and whose values are
the desired coordinates ( geo
, time
, media_time
, media_channel
and/or rf_channel
, control_variable
, non_media_channel
, organic_media_channel
, organic_rf_channel
) or array names ( kpi
, revenue_per_kpi
, media
, media_spend
and/or rf_spend
, controls
, population
, non_media_treatments
, organic_media
, organic_reach
, organic_frequency
). Mapping must be provided if the names in the input
dataset are different from the required ones, otherwise errors
are thrown.
Attributes
A string denoting whether the KPI is of a
'revenue'
or 'non-revenue'
type. When the kpi_type
is 'non-revenue'
and revenue_per_kpi
exists, ROI calibration is used and the analysis is run
on revenue. When revenue_per_kpi
doesn't exist for the same kpi_type
,
custom ROI calibration is used and the analysis is run on KPI.Methods
load
load
()
->
meridian
.
data
.
input_data
.
InputData
Returns an InputData
object containing the data from the dataset.



