% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/deep-learning-adapter.R
\name{fit_gazepoint_deep_model}
\alias{fit_gazepoint_deep_model}
\title{Fit an optional governed deep-learning model through keras3}
\usage{
fit_gazepoint_deep_model(
  data,
  task,
  predictors = NULL,
  preprocessor = NULL,
  hidden_units = c(64L, 32L),
  dropout = 0.2,
  epochs = 50L,
  batch_size = 32L,
  validation_split = 0.2,
  optimizer = "adam",
  seed = 1L,
  verbose = 0L
)
}
\arguments{
\item{data}{Analysis data used to fit the network.}

\item{task}{A governed \code{gp3ml_task} object.}

\item{predictors}{Optional character vector of predictor columns.}

\item{preprocessor}{Optional fitted preprocessing object.}

\item{hidden_units}{Integer vector of hidden-layer sizes.}

\item{dropout}{Dropout proportion applied after hidden layers.}

\item{epochs}{Number of training epochs.}

\item{batch_size}{Training batch size.}

\item{validation_split}{Proportion reserved for internal validation.}

\item{optimizer}{Keras optimizer name or object.}

\item{seed}{Deterministic random seed.}

\item{verbose}{Keras training verbosity.}
}
\value{
A governed \code{gp3ml_model} object containing the fitted \code{keras3} model, training history, preprocessing object, task contract, and training metadata.
}
\description{
Fit an optional governed deep-learning model through keras3
}
\examples{
\dontshow{if (requireNamespace("keras3", quietly = TRUE) && identical(Sys.getenv("GP3ML_RUN_KERAS_EXAMPLES"), "true")) withAutoprint(\{ # examplesIf}
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")
)
task <- declare_gazepoint_task(
  data = example_data,
  outcome = "quality_status",
  purpose = "Predict predefined recording-quality review status",
  task_type = "classification",
  unit_id = "trial_id",
  participant_id = "participant_id",
  stimulus_id = "stimulus_id",
  generalization_target = "new_participants",
  positive = "review"
)
deep_model <- fit_gazepoint_deep_model(
  data = example_data,
  task = task,
  predictors = c("fixation_duration", "pupil_change"),
  hidden_units = 4L,
  dropout = 0,
  epochs = 1L,
  batch_size = 8L,
  validation_split = 0,
  seed = 101L,
  verbose = 0L
)
deep_model
\dontshow{\}) # examplesIf}
}
