# scenarioplanner.mmm_ui_proto_generator.MmmUiProtoGenerator

<br />

|---|
| [![](https://www.tensorflow.org/images/GitHub-Mark-32px.png) View source on GitHub](https://github.com/google/meridian/blob/v2.2.2/scenarioplanner/mmm_ui_proto_generator.py#L78-L260) |

Creates `Mmm` proto for the Meridian Scenario Planner UI (Looker Studio).

```python
scenarioplanner.mmm_ui_proto_generator.MmmUiProtoGenerator(
    mmm: model.Meridian,
    specs: Sequence[SpecType],
    model_id: str = '',
    time_breakdown_generators: Collection[type[date_range_bucketing.DateRangeBucketer]] = _DATE_RANGE_GENERATORS
)
```

Currently, it only accepts specs for Model Fit, Marketing Analysis, and Budget
Optimization, but not stand-alone Reach Frequency Optimization specs.
Reach Frequency Optimization spec will be derived from the Budget Optimization
spec; this is done so that we can structurally pair them.

<br />

<br />

<br />

| ## Attributes ||
|---|---|
| `mmm` | A trained Meridian model. A trained model has its posterior distributions already sampled. |
| `specs` | A sequence of specs that specify the analyses to run on the model. |
| `model_id` | An optional model identifier. |
| `time_breakdown_generators` | A list of generators that break down the given specs by automatically generated time buckets. Currently, this time period breakdown is only done on Marketing Analysis specs and Budget Optimization specs. All other specs are processed in their original forms. The set of default bucketers break down sub-specs with the following time periods: \[All (original spec's time period), Yearly, Quarterly, Monthly\] |

<br />

## Methods

### `__call__`

[View source](https://github.com/google/meridian/blob/v2.2.2/scenarioplanner/mmm_ui_proto_generator.py#L117-L203)

```python
__call__() -> mmm_pb.Mmm
```

Creates `Mmm` proto for the Meridian Scenario Planner UI (Looker Studio).

<br />

<br />

<br />

| Returns ||
|---|---|
| A proto containing the model kernel at rest and its analysis results given user specs. ||

<br />