% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/kaf-fit.R
\name{kaf_fit}
\alias{kaf_fit}
\title{Fit a Kolmogorov-Arnold Fourier Network}
\usage{
kaf_fit(
  x,
  y,
  task = c("auto", "regression", "binary", "multiclass"),
  hidden = c(64, 64),
  num_grids = 16,
  dropout = 0,
  use_layernorm = TRUE,
  fourier_init_scale = 0.01,
  epochs = 1000,
  lr = 0.001,
  batch_size = NULL,
  shuffle = TRUE,
  validation_split = 0,
  x_val = NULL,
  y_val = NULL,
  weight_decay = 0,
  standardize_x = TRUE,
  standardize_y = NULL,
  patience = NULL,
  verbose = TRUE,
  print_every = 100,
  seed = NULL,
  restore_best = TRUE,
  min_delta = 0
)
}
\arguments{
\item{x}{Matrix, data frame, vector, or 2D torch tensor of predictors.}

\item{y}{Vector, matrix, data frame, or torch tensor of targets.}

\item{task}{Character. One of \code{"auto"}, \code{"regression"}, \code{"binary"}, or
\code{"multiclass"}. With \code{"auto"}, factor, character, and logical targets are
treated as classification; numeric targets are treated as regression.}

\item{hidden}{Integer vector. Hidden layer sizes.}

\item{num_grids}{Integer. Number of Fourier frequencies per KAF layer.}

\item{dropout}{Numeric. Dropout probability.}

\item{use_layernorm}{Logical. Whether to apply layer normalization.}

\item{fourier_init_scale}{Numeric. Initial scale of the Fourier branch.}

\item{epochs}{Integer. Maximum number of training epochs.}

\item{lr}{Numeric. Learning rate.}

\item{batch_size}{Optional integer. Mini-batch size. If \code{NULL}, full-batch
training is used.}

\item{shuffle}{Logical. Whether to shuffle training rows each epoch.}

\item{validation_split}{Numeric in \verb{[0, 1)}. Fraction of rows to reserve for
validation. Ignored if \code{x_val} and \code{y_val} are supplied.}

\item{x_val}{Optional validation predictors.}

\item{y_val}{Optional validation targets.}

\item{weight_decay}{Numeric. Adam weight decay.}

\item{standardize_x}{Logical. Whether to standardize predictors using the
training-set mean and standard deviation.}

\item{standardize_y}{Logical or \code{NULL}. Whether to standardize regression
targets using the training-set mean and standard deviation. If \code{NULL},
targets are standardized for regression and not standardized for
classification. Predictions are automatically transformed back to the
original target scale.}

\item{patience}{Optional integer. Number of epochs without improvement before
early stopping.}

\item{verbose}{Logical. Whether to print progress.}

\item{print_every}{Integer. Print frequency.}

\item{seed}{Optional integer random seed.}

\item{restore_best}{Logical. Whether to restore the best observed model state
after training.}

\item{min_delta}{Numeric. Minimum loss improvement required to update the
best model state.}
}
\value{
An object of class \code{"kaf_fit"}.
}
\description{
Fits a KAF model for regression using mean squared error loss.
}
