Predict class labels or estimate conditional probabilities for the specified new data.
# S3 method for abclass
predict(
object,
newx,
type = c("class", "probability"),
selection = c("cv_1se", "cv_min", "all"),
...
)
A vector representing the predictions or a list containing the predictions for each set of estimates along the solution path.
An object of class abclass
.
A numeric matrix representing the design matrix for predictions.
A character value specifying the desired type of predictions.
The available options are "class"
for predicted labels and
"probability"
for class conditional probability estimates.
An integer vector for the solution indices or a character
value specifying how to select a particular set of coefficient estimates
from the entire solution path for prediction. If the specified
object
contains the cross-validation results, one may set
selection
to "cv_min"
(or "cv_1se"
) for using the
estimates giving the smallest cross-validation error (or the set of
estimates resulted from the largest lambda within one standard
error of the smallest cross-validation error) or prediction. The
prediction for the entire solution path will be returned in a list if
selection = "all"
or no cross-validation results are available in
the specified object
.
Other arguments not used now.
## see examples of `abclass()`.
Run the code above in your browser using DataLab