% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/BinomialModel.R
\name{BinomialModel}
\alias{BinomialModel}
\title{Binomial Model Construction}
\usage{
BinomialModel(
  x,
  y,
  seed = 123456,
  scale = TRUE,
  train_ratio = 0.7,
  nfold = 10,
  plot = TRUE,
  palette = "jama",
  cols = NULL
)
}
\arguments{
\item{x}{A data frame containing sample ID and features. First column must be sample ID.}

\item{y}{A data frame where first column is sample ID and second column is outcome
(numeric or factor).}

\item{seed}{Integer for random seed. Default is `123456`.}

\item{scale}{Logical indicating whether to scale features. Default is `TRUE`.}

\item{train_ratio}{Numeric between 0 and 1 for training proportion. Default is `0.7`.}

\item{nfold}{Integer for cross-validation folds. Default is `10`.}

\item{plot}{Logical indicating whether to generate AUC plots. Default is `TRUE`.}

\item{palette}{Character string for color palette. Default is `"jama"`.}

\item{cols}{Optional color vector for ROC curves. Default is `NULL`.}
}
\value{
List containing:
\describe{
  \item{lasso_result}{Lasso model results}
  \item{ridge_result}{Ridge model results}
  \item{train.x}{Training data with IDs}
}
}
\description{
Constructs and evaluates binomial logistic regression models using Lasso and Ridge
regularization. Processes input data, scales features if specified, splits data into
training/testing sets, and fits both Lasso and Ridge models. Optionally generates
AUC plots for model evaluation.
}
\examples{
set.seed(123)
x <- data.frame(
  ID = paste0("Sample", 1:50),
  Feature1 = rnorm(50),
  Feature2 = rnorm(50),
  Feature3 = rnorm(50)
)
y <- data.frame(
  ID = x$ID,
  Outcome = factor(rbinom(50, 1, 0.5))
)
result <- BinomialModel(x = x, y = y, plot = FALSE, nfold = 5)
str(result, max.level = 1)
}
\author{
Dongqiang Zeng
}
