predict.nmfkc generates predictions from an object of class nmfkc,
either using the fitted covariates or a new covariate matrix.
When the model was fitted using a formula (Formula Mode), a newdata
data frame can be supplied instead of newA; the covariate matrix is
then constructed automatically from the stored formula metadata.
Usage
# S3 method for class 'nmfkc'
predict(object, newA = NULL, newdata = NULL, type = "response", ...)Arguments
- object
An object of class
nmfkc, i.e., the return value ofnmfkc.- newA
Optional. A new covariate matrix to be used for prediction.
- newdata
Optional data frame. Only available when the model was fitted using a formula. Covariate columns are extracted automatically using the stored formula metadata. If both
newdataandnewAare supplied,newdatatakes precedence (with a warning).- type
Type of prediction to return. Options are "response" (fitted values matrix), "prob" (soft-clustering probabilities), or "class" (hard-clustering labels based on row names of X).
- ...
Further arguments passed to or from other methods.