% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/preprocessing-engine.R
\name{bake_gazepoint_preprocessor}
\alias{bake_gazepoint_preprocessor}
\title{Apply a fitted preprocessing engine}
\usage{
bake_gazepoint_preprocessor(preprocessor, new_data)
}
\arguments{
\item{preprocessor}{A fitted \code{gp3ml_preprocessor} object.}

\item{new_data}{Data to transform using the fitted parameters.}
}
\value{
A numeric model matrix transformed using only the parameters stored in the fitted preprocessor.
}
\description{
Apply a fitted 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"
  )
)
baked <- bake_gazepoint_preprocessor(
  preprocessor,
  example_data
)
dim(baked)
}
