Skip to content

Commit f7dac39

Browse files
committed
add docstring about the keys in the configuration
1 parent 7173183 commit f7dac39

File tree

1 file changed

+15
-5
lines changed

1 file changed

+15
-5
lines changed

pymc_marketing/mmm/builders/yaml.py

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929
from pymc_marketing.utils import from_netcdf
3030

3131

32-
# -----------------------------------------------------------------------------
3332
def _load_df(path: str | Path) -> pd.DataFrame:
3433
"""
3534
Read a DataFrame from *path* based on extension.
@@ -53,13 +52,24 @@ def build_mmm_from_yaml(
5352
"""
5453
Build an MMM model from *config_path*.
5554
55+
The configuration keys:
56+
57+
- `model` (required): MMM initialization parameters
58+
- `effects` (optional): list of additive effects in the model
59+
- `data` (optional): paths to X and y data
60+
- `original_scale_vars` (optional): list of original scale variables
61+
- `idata_path` (optional): path to inference data
62+
5663
Parameters
5764
----------
5865
config_path : str | Path
59-
YAML file following the schema described in factories.py.
60-
X, y : pandas.DataFrame, optional
61-
Pre-loaded covariate matrix and target vector. If omitted, the loader
62-
tries to read them from paths in the YAML under `data:`.
66+
YAML file with model configuration.
67+
X : ~pandas.DataFrame, optional
68+
Pre-loaded covariate matrix. If omitted, the loader tries to read it
69+
from a path in the YAML under `data.X_path`.
70+
y : ~pandas.DataFrame, optional
71+
Pre-loaded target vector. If omitted, the loader tries to read it
72+
from a path in the YAML under `data.y_path`.
6373
6474
Returns
6575
-------

0 commit comments

Comments
 (0)