% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/preprocessing-engine.R
\name{fit_gazepoint_preprocessor}
\alias{fit_gazepoint_preprocessor}
\title{Fit a fold-local preprocessing engine}
\usage{
fit_gazepoint_preprocessor(
  data,
  predictors,
  numeric_imputation = c("median", "mean"),
  center = TRUE,
  scale = TRUE,
  novel_level = c("other", "error"),
  remove_zero_variance = TRUE
)
}
\arguments{
\item{data}{Analysis data used to estimate preprocessing parameters.}

\item{predictors}{Character vector naming predictor columns.}

\item{numeric_imputation}{Numeric imputation method.}

\item{center}{Whether numeric model columns should be centered.}

\item{scale}{Whether numeric model columns should be scaled.}

\item{novel_level}{How novel categorical levels should be handled.}

\item{remove_zero_variance}{Whether zero-variance columns are removed.}
}
\value{
A fitted \code{gp3ml_preprocessor} object containing analysis-partition imputation values, factor levels, model columns, centering values, and scaling values.
}
\description{
Fit a fold-local preprocessing engine
}
\examples{
example_data <- data.frame(
  participant_id = rep(sprintf("P\%02d", 1:12), each = 2),
  trial_id = sprintf("T\%02d", 1:24),
  stimulus_id = rep(c("S01", "S02"), 12),
  condition = rep(c("A", "B"), 12),
  fixation_duration = 180 + seq_len(24),
  pupil_change = sin(seq_len(24) / 3),
  stringsAsFactors = FALSE
)
example_data$quality_status <- factor(
  c(
    "pass", "review", "pass", "review", "review", "pass",
    "review", "pass", "pass", "review", "review", "pass",
    "review", "pass", "review", "pass", "pass", "review",
    "pass", "review", "review", "pass", "pass", "review"
  ),
  levels = c("pass", "review")
)
preprocessor <- fit_gazepoint_preprocessor(
  data = example_data,
  predictors = c(
    "fixation_duration",
    "pupil_change",
    "condition"
  )
)
preprocessor
}
