% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/wrap_caret.R
\name{predict.wrap_caret}
\alias{predict.wrap_caret}
\title{Predict method for mlS3 caret wrapper}
\usage{
\method{predict}{wrap_caret}(object, newx, type = NULL, ...)
}
\arguments{
\item{object}{Object from wrap_caret}

\item{newx}{New features (matrix or data frame)}

\item{type}{Prediction type: "raw" (default), "class", "prob", or NULL}

\item{...}{Additional arguments to caret::predict.train}
}
\value{
Vector or matrix of predictions
}
\description{
Predict method for mlS3 caret wrapper
}
\examples{

# Only runs if caret is installed

data(mtcars)

# Prepare data
X_reg <- mtcars[, -1]  # All except mpg
y_reg <- mtcars$mpg     # Target variable

# Split into train/test
set.seed(123)
idx_reg <- sample(nrow(X_reg), 0.7 * nrow(X_reg))
X_train <- X_reg[idx_reg, ]
y_train <- y_reg[idx_reg]
X_test <- X_reg[-idx_reg, ]
y_test <- y_reg[-idx_reg]

mod <- wrap_caret(X_train, y_train, method = "rf", mtry = 3)
(pred <- predict(mod, X_test))

}
