# Examples

Six complete workflows, each ported from a canonical, citable R original and worked **backward from a realistic end model**: the model's requirements decide which of the [four stages](../user-guide/basics/four-stages-eight-steps.md) the recipe needs. Every report executes at build time; each example also links a line-matched [R ↔︎ Python side-by-side](sbs/sbs-index.html).

<table class="caption-top table" style="width:100%;">
<colgroup>
<col style="width: 16%" />
<col style="width: 16%" />
<col style="width: 16%" />
<col style="width: 16%" />
<col style="width: 16%" />
<col style="width: 16%" />
</colgroup>
<thead>
<tr class="header">
<th>Example</th>
<th>Model</th>
<th>Missing</th>
<th>Wrangle</th>
<th>Model prep</th>
<th>Multivar</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>[Ames mini](ames-mini-lm.md) · [R↔︎Py](sbs/tmwr01-r-vs-py.html)<br />
from [TMwR ch. 8](https://www.tmwr.org/recipes)</td>
<td>lm</td>
<td>none</td>
<td>log, dummy</td>
<td>none</td>
<td>none</td>
</tr>
<tr class="even">
<td>[Ames realistic](ames-realistic-lm.md) · [R↔︎Py](sbs/tmwr03-r-vs-py.html)<br />
from [TMwR ch. 8](https://www.tmwr.org/recipes)</td>
<td>lm</td>
<td>none</td>
<td>log, other, dummy</td>
<td>interact, ns</td>
<td>none</td>
</tr>
<tr class="odd">
<td>[Ames xgboost](ames-xgboost.md) · [R↔︎Py](sbs/tmwr11-r-vs-py.html)<br />
from [TMwR ch. 13](https://www.tmwr.org/grid-search)</td>
<td>xgboost</td>
<td>none</td>
<td>novel*, one-hot, zv†</td>
<td>none</td>
<td>none</td>
</tr>
<tr class="even">
<td>[Concrete KNN](concrete-knn.md) · [R↔︎Py](sbs/tmwr14-r-vs-py.html)<br />
from [TMwR ch. 15](https://www.tmwr.org/workflow-sets)</td>
<td>KNN</td>
<td>none</td>
<td>none</td>
<td>normalize</td>
<td>none</td>
</tr>
<tr class="odd">
<td>[Beans PCA](beans-pca.md) · [R↔︎Py](sbs/tmwr16-r-vs-py.html)<br />
from [TMwR ch. 16](https://www.tmwr.org/dimensionality)</td>
<td>none</td>
<td>none</td>
<td>zv†, orderNorm</td>
<td>normalize</td>
<td>PCA</td>
</tr>
<tr class="even">
<td>[Credit glmnet](credit-glmnet.md) · [R↔︎Py](sbs/kuhn-r-vs-py.html)<br />
from [recipes vignette](https://recipes.tidymodels.org/articles/recipes.html)</td>
<td>glmnet</td>
<td>impute ×2</td>
<td>other, dummy, zv†</td>
<td>normalize</td>
<td>none</td>
</tr>
</tbody>
</table>

\* not yet built in mlfeatures; the report runs the buildable subset, and the side-by-side marks the gap in red where it occurs. † zero-variance filter; filters sit beside the stages rather than in them, shown here where they run.


# Running the examples locally

The reports execute with the `examples` extra:

``` bash
uv sync --extra examples
uv run quarto render examples   # or: great-docs build
```

Datasets ship with the package and load from [mlfeatures.data](../reference/data.md#mlfeatures.data) (`from mlfeatures.data import ames`). They were exported from R's [modeldata](https://modeldata.tidymodels.org/) package ([ames](../reference/data.md#mlfeatures.data.ames), [concrete](../reference/data.md#mlfeatures.data.concrete), `credit_data`) and the dry-beans data from Koklu & Ozkan via the [beans](https://cran.r-project.org/package=beans) package; see the [`mlfeatures.data`](../reference/data.md) reference page for each dataset's shape, target, and source.
