% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/BinomialModel.R
\name{Enet}
\alias{Enet}
\title{Elastic Net Model Fitting}
\usage{
Enet(train.x, train.y, lambdamax, nfold = 10)
}
\arguments{
\item{train.x}{Training predictors matrix.}

\item{train.y}{Training binary outcomes (0/1 or factor).}

\item{lambdamax}{Maximum lambda value for the grid search.}

\item{nfold}{Number of CV folds. Default is `10`.}
}
\value{
List containing:
\describe{
  \item{chose_alpha}{Optimal alpha value (0-1)}
  \item{chose_lambda}{Optimal lambda value}
}
}
\description{
Fits elastic net model with cross-validation to find optimal alpha and lambda.
Searches across a grid of alpha values (0 to 1) and lambda values to minimize
cross-validation error.
}
\examples{
if (requireNamespace("glmnet", quietly = TRUE)) {
  set.seed(123)
  train_data <- matrix(rnorm(50 * 5), ncol = 5)
  train_outcome <- rbinom(50, 1, 0.5)
  result <- Enet(train.x = train_data, train.y = train_outcome, lambdamax = 1, nfold = 5)
}
}
