% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/guard_to_recipe.R
\name{guard_to_recipe}
\alias{guard_to_recipe}
\title{Convert guard preprocessing steps to a recipes recipe}
\usage{
guard_to_recipe(steps, formula, training_data)
}
\arguments{
\item{steps}{A named list of guard preprocessing steps, e.g.,
\code{list(impute = list(method = "median"), normalize = list(method = "zscore"))}.}

\item{formula}{A model formula (e.g., \code{outcome ~ .}).}

\item{training_data}{A data.frame used to initialize the recipe.}
}
\value{
A \code{recipes::recipe} object with the mapped steps added.
}
\description{
Maps bioLeak guard preprocessing steps (impute, normalize, filter, fs) to
their closest \pkg{recipes} equivalents. Requires the \pkg{recipes} package.
Steps that have no direct recipe equivalent are skipped with a warning.
}
\details{
Mapping:
\itemize{
  \item \code{impute$method = "median"}: \code{step_impute_median(all_numeric_predictors())}
  \item \code{impute$method = "knn"}: \code{step_impute_knn(all_predictors(), neighbors = k)}
  \item \code{impute$method = "missForest"} or \code{"mice"}: Warning + \code{step_impute_median()} fallback
  \item \code{normalize$method = "zscore"}: \code{step_normalize(all_numeric_predictors())}
  \item \code{normalize$method = "robust"}: Warning + \code{step_normalize()} fallback
  \item \code{normalize$method = "none"}: No step added
  \item \code{filter$var_thresh > 0}: \code{step_nzv(all_numeric_predictors())}
  \item \code{fs$method = "pca"}: \code{step_pca(all_numeric_predictors(), num_comp = ncomp)}
  \item \code{fs$method = "ttest"} or \code{"lasso"}: Warning, skipped (no recipe equivalent)
}
}
