## FittedRecipe.to_dict()


Serialize to a diffable, JSON-safe `dict`. See [mlfeatures.to_dict](to_dict.md#mlfeatures.to_dict) for the layout.


Usage

``` python
FittedRecipe.to_dict()
```


Use the `dict` when you are embedding the recipe in a larger payload or handing it to your own writer; for a file, prefer [to_json](to_json.md#mlfeatures.to_json) or [to_yaml](to_yaml.md#mlfeatures.to_yaml).


## Returns


`dict`  
Plain data holding the roles, schema, lineage, and every step's hyperparameters and learned statistics.


## Raises


`TypeError`  
If a step holds something that cannot be serialized, such as a raw polars or narwhals selector, a `dateutil` rule, or a function.


## Warns


`UserWarning`  
If a step comes from a package that [mlfeatures.from_dict](from_dict.md#mlfeatures.from_dict) refuses by default.
