% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/hnp_package.r
\name{base_function}
\alias{base_function}
\title{Built-in Base Learner for H-NP Classification}
\usage{
base_function(x, y, method = "randomforest")
}
\arguments{
\item{x}{A data.frame or matrix of predictors/features.}

\item{y}{A vector or factor of class labels of length \code{nrow(x)}, with at
least two classes. When used inside the H-NP pipeline, labels should
already be internal levels \code{"1"}, ..., \code{"T"}.}

\item{method}{Character string: one of \code{"randomforest"}, \code{"svm"}, or
\code{"logistic"}.}
}
\value{
A fitted model object (\code{randomForest::randomForest},
\code{e1071::svm}, or \code{nnet::multinom}, depending on \code{method}).
}
\description{
Train a multi-class scoring classifier using one of the
built-in methods (random forest, support vector machine, or logistic
regression). The returned fitted model can be used directly or passed to
\code{\link[=hnp_umbrella]{hnp_umbrella()}} via the \code{pretrained_model} argument.
}
\examples{
set.seed(123)
X <- data.frame(x1 = rnorm(60), x2 = rnorm(60))
Y <- factor(sample(c("1", "2", "3"), 60, replace = TRUE))
fit_rf <- base_function(X, Y, method = "randomforest")
fit_svm <- base_function(X, Y, method = "svm")
fit_logistic <- base_function(X, Y, method = "logistic")
}
\seealso{
\code{\link[=hnp_umbrella]{hnp_umbrella()}}, \code{\link[=train_nn_and_get_scores]{train_nn_and_get_scores()}}
}
