\name{predict.combss}
\alias{predict.combss}
\title{Predict from a \code{combss} fit.}
\usage{
\method{predict}{combss}(object, newx, x_train, y_train, k = NULL, ...)
}
\arguments{
\item{object}{A \code{combss} object.}

\item{newx}{Numeric matrix of new observations.}

\item{x_train, y_train}{Original training data used to refit on the chosen
subset.}

\item{k}{Subset size to use. Defaults to the best \code{k} if validation data
was used, else the largest \code{k} evaluated.}

\item{...}{Unused.}
}
\value{
Numeric vector of predictions for \code{newx}.
}
\description{
Refits the chosen subset on the original training data via OLS or ridge
(Gaussian / binomial / multinomial as appropriate) and predicts on \code{newx}.
Note: the training data is not stored on the fit object, so \code{newx} must be
supplied along with \code{x_train} and \code{y_train}.
}
\examples{
set.seed(1)
x <- matrix(rnorm(100 * 20), 100, 20)
y <- as.numeric(x[, 1] + x[, 2] + rnorm(100) * 0.1)
fit <- combss(x, y, family = "gaussian", q = 5)
newx <- matrix(rnorm(5 * 20), 5, 20)
predict(fit, newx = newx, x_train = x, y_train = y, k = 2)
}
