## Recipe.remove_role()


Return a new recipe with a role removed at this point in the chain.


Usage

``` python
Recipe.remove_role(
    columns,
    *,
    role,
)
```


Takes effect where it is written (see [add_role()](Recipe.add_role.md#mlfeatures.Recipe.add_role)). Every selected column must carry the role, or fitting raises `ValueError`. A column left with no role is kept, but role selectors no longer match it.


## Parameters


`columns: Selector`  
Columns to remove the role from. Accepts a single column name, a list of names, a mlfeatures selector such as [Selectors.numeric_features()](Selectors.md#mlfeatures.Selectors.numeric_features) (see [Selectors](Selectors.md#mlfeatures.Selectors) for the full set), or a narwhals or polars selector (`narwhals.selectors.numeric()`, `polars.selectors.numeric()`). Selectors are resolved against the data frame as the steps before this one left it, when the recipe is fitted.

`role: str`  
The role to remove.


## Examples


``` python
recipe = (
    Recipe(data=credit, target="Status")
    .add(StepNormalize(s.numeric_features()))
    .remove_role(s.starts_with("Senior"), role="feature")
)
recipe
```


    Recipe (untrained)
      Inputs: 14 columns (1 target)
      Steps:
        step_normalize(select(role='feature', type=NumericType))  [untrained]
        remove_role(starts_with('Senior'), role='feature')


Fitting applies the change, which the summary then shows:


``` python
fitted = recipe.fit(credit)
```


``` python
fitted.summary()
```


shape: (14, 5)

| name        | dtype   | roles     | source     | sparse |
|-------------|---------|-----------|------------|--------|
| str         | str     | str       | str        | bool   |
| "Status"    | "str"   | "target"  | "original" | false  |
| "Seniority" | "float" | ""        | "original" | false  |
| "Home"      | "str"   | "feature" | "original" | false  |
| "Time"      | "float" | "feature" | "original" | false  |
| "Age"       | "float" | "feature" | "original" | false  |
| …           | …       | …         | …          | …      |
| "Income"    | "float" | "feature" | "original" | false  |
| "Assets"    | "float" | "feature" | "original" | false  |
| "Debt"      | "float" | "feature" | "original" | false  |
| "Amount"    | "float" | "feature" | "original" | false  |
| "Price"     | "float" | "feature" | "original" | false  |
