Usage
## S3 method for class 'rda':
predict(object, x, y, xnew, prior, alpha, delta,
type=c("class", "posterior", "nonzero"),
trace=FALSE, ...)Arguments
object
An rda fit object obtained from the function
rda.
x
The training data matrix as used in the 'fit' object.
y
The class labels for the columns of 'x' as used in the
'fit' object.
xnew
The new data matrix used to predict the class labels of the
new samples. Must be a numerical matrix with rows corresponding to
variables and columns corresponding to the samples. The number of rows
must be the same as 'x'.
prior
A numerical vector that gives the prior proportion of
each class. By default, it is set to the fit component from the
training step unless users want to specify a new one for prediction.
alpha
A particular regularization value for alpha. Often, this
is the optimal alpha value obtained from the cross-validation step.
But it could be any other value that users set. A vector of values is also
acceptable. If missing, the function will use the defau
delta
A particular threshold value for delta. Often, this is
the optimal delta value obtained from the cross-validation step. But
it could be any other value that users set. A vector of values is also
acceptable. If missing, the function will use the default va
type
A character string specifying which type of prediction
is desired. If 'class', then the predicted class labels are returned;
if 'posterior', then the predicted posterior probabilities for each
sample belonging to a class are returned; if 'nonzero', then t
trace
A logical flag indicating whether the intermediate steps
should be printed.
...
Additional arguments for generic predict.