# mlfeatures > A framework for declaring, estimating, and applying feature-engineering pipelines ## Docs ### API Reference #### Recipes > Build a recipe, then fit and apply it. The Recipe class and its methods are flattened into this section so each method appears on the reference index. - [Recipe](https://tidymodels.github.io/mlfeatures/reference/Recipe.html): A declarative, untrained pipeline of feature-engineering steps - [Recipe.add](https://tidymodels.github.io/mlfeatures/reference/Recipe.add.html) - [Recipe.fit](https://tidymodels.github.io/mlfeatures/reference/Recipe.fit.html) - [Recipe.set_roles](https://tidymodels.github.io/mlfeatures/reference/Recipe.set_roles.html) - [Recipe.add_role](https://tidymodels.github.io/mlfeatures/reference/Recipe.add_role.html) - [Recipe.update_role](https://tidymodels.github.io/mlfeatures/reference/Recipe.update_role.html) - [Recipe.remove_role](https://tidymodels.github.io/mlfeatures/reference/Recipe.remove_role.html) - [Recipe.update_role_requirements](https://tidymodels.github.io/mlfeatures/reference/Recipe.update_role_requirements.html) - [Recipe.summary](https://tidymodels.github.io/mlfeatures/reference/Recipe.summary.html) #### Steps: numeric features > Rescale, expand, or derive new numeric columns. - [StepNormalize](https://tidymodels.github.io/mlfeatures/reference/StepNormalize.html): Center and scale numeric columns to zero mean and unit variance - [StepOrderNorm](https://tidymodels.github.io/mlfeatures/reference/StepOrderNorm.html): Normalize numeric columns onto a standard normal distribution by rank - [StepRange](https://tidymodels.github.io/mlfeatures/reference/StepRange.html): Scale numeric columns to a fixed range - [StepLog](https://tidymodels.github.io/mlfeatures/reference/StepLog.html): Take the logarithm of numeric columns - [StepPolynomial](https://tidymodels.github.io/mlfeatures/reference/StepPolynomial.html): Replace numeric columns with their orthogonal polynomial expansion - [StepSplineNatural](https://tidymodels.github.io/mlfeatures/reference/StepSplineNatural.html): Replace numeric columns with a natural cubic spline basis expansion - [StepSplineMonotone](https://tidymodels.github.io/mlfeatures/reference/StepSplineMonotone.html): Replace numeric columns with a monotone (I-spline) basis expansion - [StepClassDistance](https://tidymodels.github.io/mlfeatures/reference/StepClassDistance.html): Replace numeric columns with per-row distances to each class centroid - [StepGeoDistance](https://tidymodels.github.io/mlfeatures/reference/StepGeoDistance.html): Add the distance from each row to a fixed reference point - [StepIntercept](https://tidymodels.github.io/mlfeatures/reference/StepIntercept.html): Add a constant column with a fixed value - [StepInteract](https://tidymodels.github.io/mlfeatures/reference/StepInteract.html): Add the pairwise product of every pair of selected columns #### Steps: categorical features > Encode nominal columns as numeric ones. - [StepDummy](https://tidymodels.github.io/mlfeatures/reference/StepDummy.html): Expand categorical columns into *k-1* binary indicator columns - [StepOneHot](https://tidymodels.github.io/mlfeatures/reference/StepOneHot.html): Expand discrete columns into *k* binary indicator columns - [StepOther](https://tidymodels.github.io/mlfeatures/reference/StepOther.html): Collapse infrequent categorical levels into a single ``"other"`` level #### Steps: date and datetime features > Expand Date and Datetime columns into calendar-part feature columns. - [StepDateFeatures](https://tidymodels.github.io/mlfeatures/reference/StepDateFeatures.html): Expand Date columns into calendar-part feature columns - [StepDatetimeFeatures](https://tidymodels.github.io/mlfeatures/reference/StepDatetimeFeatures.html): Expand Datetime columns into calendar-part feature columns - [StepHoliday](https://tidymodels.github.io/mlfeatures/reference/StepHoliday.html): Add binary indicator columns flagging named holidays and custom recurrences #### Steps: missing data > Impute missing values, or give them an explicit level. - [StepImputeMean](https://tidymodels.github.io/mlfeatures/reference/StepImputeMean.html): Impute missing numeric values with the column mean - [StepImputeMedian](https://tidymodels.github.io/mlfeatures/reference/StepImputeMedian.html): Impute missing numeric values with the column median - [StepImputeMode](https://tidymodels.github.io/mlfeatures/reference/StepImputeMode.html): Impute missing values with the column mode (most frequent value) - [StepUnknown](https://tidymodels.github.io/mlfeatures/reference/StepUnknown.html): Recode missing categorical levels to an explicit ``"unknown"`` level - [StepIndicateNa](https://tidymodels.github.io/mlfeatures/reference/StepIndicateNa.html): Add a binary indicator column flagging missing values #### Steps: dimensionality reduction > Reduce dimensionality, or filter columns that carry no signal. - [StepDropZeroVariance](https://tidymodels.github.io/mlfeatures/reference/StepDropZeroVariance.html): Remove columns that have a single unique value (zero variance) - [StepDropNearZeroVariance](https://tidymodels.github.io/mlfeatures/reference/StepDropNearZeroVariance.html): Remove columns that are sparse and unbalanced (near-zero variance) - [StepPca](https://tidymodels.github.io/mlfeatures/reference/StepPca.html): Project numeric columns onto their principal components - [StepPls](https://tidymodels.github.io/mlfeatures/reference/StepPls.html): Project numeric columns onto partial-least-squares components - [StepDropCorr](https://tidymodels.github.io/mlfeatures/reference/StepDropCorr.html): Remove numeric columns whose pairwise absolute correlation is too high - [StepDrop](https://tidymodels.github.io/mlfeatures/reference/StepDrop.html): Remove the selected columns #### Steps: general expressions > Arbitrary row filters and column computations; escape hatches rather than a named feature-engineering method. - [StepFilter](https://tidymodels.github.io/mlfeatures/reference/StepFilter.html): Remove rows that do not match a predicate - [StepMutate](https://tidymodels.github.io/mlfeatures/reference/StepMutate.html): Apply arbitrary column expressions: the escape hatch #### Fitted recipes > What Recipe.fit() returns: an immutable, fitted pipeline you can apply to new data. Serialization methods are listed under Serialization below. - [FittedRecipe](https://tidymodels.github.io/mlfeatures/reference/FittedRecipe.html): A trained pipeline: applies statistics learned at fit time to new data - [FittedRecipe.transform](https://tidymodels.github.io/mlfeatures/reference/FittedRecipe.transform.html) - [FittedRecipe.summary](https://tidymodels.github.io/mlfeatures/reference/FittedRecipe.summary.html) #### Lineage > The column-lineage DAG a fitted recipe maintains: per-column provenance and dtype history, plus the queries that back has_source. - [Lineage](https://tidymodels.github.io/mlfeatures/reference/Lineage.html): The record of where every column came from, and what happened to it - [Lineage.removed](https://tidymodels.github.io/mlfeatures/reference/Lineage.removed.html) - [Lineage.summary](https://tidymodels.github.io/mlfeatures/reference/Lineage.summary.html) - [Lineage.columns_from_source](https://tidymodels.github.io/mlfeatures/reference/Lineage.columns_from_source.html) - [Lineage.parents](https://tidymodels.github.io/mlfeatures/reference/Lineage.parents.html) - [Lineage.ancestors](https://tidymodels.github.io/mlfeatures/reference/Lineage.ancestors.html) - [ColumnNode](https://tidymodels.github.io/mlfeatures/reference/ColumnNode.html): One column's lineage record #### Serialization > Save a fitted recipe to a diffable JSON or YAML format and reload it, or strip fit-only artifacts with minimize(). - [to_dict](https://tidymodels.github.io/mlfeatures/reference/to_dict.html): Serialize a `FittedRecipe` to a diffable, JSON-safe ``dict`` - [from_dict](https://tidymodels.github.io/mlfeatures/reference/from_dict.html): Reconstruct a `FittedRecipe` from the ``dict`` produced by `to_dict` - [to_json](https://tidymodels.github.io/mlfeatures/reference/to_json.html): Serialize a `FittedRecipe` to a diffable JSON string - [from_json](https://tidymodels.github.io/mlfeatures/reference/from_json.html): Reconstruct a `FittedRecipe` from the JSON produced by `to_json` - [to_yaml](https://tidymodels.github.io/mlfeatures/reference/to_yaml.html): Serialize a `FittedRecipe` to a diffable YAML string - [from_yaml](https://tidymodels.github.io/mlfeatures/reference/from_yaml.html): Reconstruct a `FittedRecipe` from the YAML produced by `to_yaml` - [minimize](https://tidymodels.github.io/mlfeatures/reference/minimize.html): Return a `FittedRecipe` that keeps only what ``transform()`` needs - [FittedRecipe.to_dict](https://tidymodels.github.io/mlfeatures/reference/FittedRecipe.to_dict.html) - [FittedRecipe.from_dict](https://tidymodels.github.io/mlfeatures/reference/FittedRecipe.from_dict.html) - [FittedRecipe.to_json](https://tidymodels.github.io/mlfeatures/reference/FittedRecipe.to_json.html) - [FittedRecipe.from_json](https://tidymodels.github.io/mlfeatures/reference/FittedRecipe.from_json.html) - [FittedRecipe.to_yaml](https://tidymodels.github.io/mlfeatures/reference/FittedRecipe.to_yaml.html) - [FittedRecipe.from_yaml](https://tidymodels.github.io/mlfeatures/reference/FittedRecipe.from_yaml.html) - [FittedRecipe.minimize](https://tidymodels.github.io/mlfeatures/reference/FittedRecipe.minimize.html) #### Interop > Adapters for using recipes inside other ecosystems. - [RecipeTransformer](https://tidymodels.github.io/mlfeatures/reference/RecipeTransformer.html): Wrap a `Recipe` as a scikit-learn transformer #### Types & selectors > Selector DSL and the schema/type vocabulary that steps are written against. - [Selectors](https://tidymodels.github.io/mlfeatures/reference/Selectors.html): Namespace of factory methods for built-in mlfeatures column selectors - [FeaturesSelector](https://tidymodels.github.io/mlfeatures/reference/FeaturesSelector.html): Base class for all mlfeatures-native column selectors - [Selector](https://tidymodels.github.io/mlfeatures/reference/Selector.html) - [ColSchema](https://tidymodels.github.io/mlfeatures/reference/ColSchema.html): Column schema: the names and dtypes a step reports for a column set - [SchemaInfo](https://tidymodels.github.io/mlfeatures/reference/SchemaInfo.html): Schema-derived context handed to `Step.fit()` - [Roles](https://tidymodels.github.io/mlfeatures/reference/Roles.html): Column → set of role names - [Mode](https://tidymodels.github.io/mlfeatures/reference/Mode.html): Shape of a step's input/output relationship - [KeepOriginals](https://tidymodels.github.io/mlfeatures/reference/KeepOriginals.html): Whether a step's ``keep_original_cols`` is fixed or up to the caller - [KeepOriginals.for_mode](https://tidymodels.github.io/mlfeatures/reference/KeepOriginals.for_mode.html) - [KeepOriginals.fixed_value](https://tidymodels.github.io/mlfeatures/reference/KeepOriginals.fixed_value.html) - [Schema](https://tidymodels.github.io/mlfeatures/reference/Schema.html): A structural snapshot of the training data used for boundary checks - [Schema.check](https://tidymodels.github.io/mlfeatures/reference/Schema.check.html) - [DataFrame](https://tidymodels.github.io/mlfeatures/reference/DataFrame.html): Special type indicating an unconstrained type - [Frame](https://tidymodels.github.io/mlfeatures/reference/Frame.html) - [ANY_DTYPE](https://tidymodels.github.io/mlfeatures/reference/ANY_DTYPE.html): Sentinel type for `ANY_DTYPE` (a singleton) - [NUMERIC_DTYPES](https://tidymodels.github.io/mlfeatures/reference/NUMERIC_DTYPES.html): set() -> new empty set object - [AcceptedDtypes](https://tidymodels.github.io/mlfeatures/reference/AcceptedDtypes.html) #### Datasets > Example datasets bundled with the package, loaded on access as polars frames (`from mlfeatures.data import credit`). Used throughout the user guide and the examples. - [data](https://tidymodels.github.io/mlfeatures/reference/data.html) #### Developing > The abstract Step base class and its lifecycle methods, for authoring new steps. Flattened so each method appears on the reference index. - [Step](https://tidymodels.github.io/mlfeatures/reference/Step.html): Abstract base class for a feature-engineering step - [Step.fit](https://tidymodels.github.io/mlfeatures/reference/Step.fit.html) - [Step.transform](https://tidymodels.github.io/mlfeatures/reference/Step.transform.html) - [Step.resolve_selection](https://tidymodels.github.io/mlfeatures/reference/Step.resolve_selection.html) - [Step.update_roles](https://tidymodels.github.io/mlfeatures/reference/Step.update_roles.html) - [Step.schema_in](https://tidymodels.github.io/mlfeatures/reference/Step.schema_in.html) - [Step.schema_out](https://tidymodels.github.io/mlfeatures/reference/Step.schema_out.html) - [Step.output_parents](https://tidymodels.github.io/mlfeatures/reference/Step.output_parents.html) - [Step.accepts_dtypes](https://tidymodels.github.io/mlfeatures/reference/Step.accepts_dtypes.html) - [Step.produces_sparse](https://tidymodels.github.io/mlfeatures/reference/Step.produces_sparse.html) - [Step.produced_columns](https://tidymodels.github.io/mlfeatures/reference/Step.produced_columns.html) - [Step.keep_original_cols](https://tidymodels.github.io/mlfeatures/reference/Step.keep_original_cols.html) - [Step.required_pkgs](https://tidymodels.github.io/mlfeatures/reference/Step.required_pkgs.html) - [Step.check_required_pkgs](https://tidymodels.github.io/mlfeatures/reference/Step.check_required_pkgs.html) - [Step.get_params](https://tidymodels.github.io/mlfeatures/reference/Step.get_params.html) - [Step.set_params](https://tidymodels.github.io/mlfeatures/reference/Step.set_params.html) - [Step.to_state](https://tidymodels.github.io/mlfeatures/reference/Step.to_state.html) - [Step.from_state](https://tidymodels.github.io/mlfeatures/reference/Step.from_state.html) - [Step.minimize](https://tidymodels.github.io/mlfeatures/reference/Step.minimize.html) - [RowOp](https://tidymodels.github.io/mlfeatures/reference/RowOp.html): Row-altering steps - [StepError](https://tidymodels.github.io/mlfeatures/reference/StepError.html): A failure raised while fitting or transforming a step