Skip to contents

predict.nmfkc generates predictions from an object of class nmfkc, either using the fitted covariates or a new covariate matrix.

Usage

# S3 method for class 'nmfkc'
predict(x, newA = NULL, type = "response")

Arguments

x

An object of class nmfkc, i.e., the return value of nmfkc.

newA

Optional. A new covariate matrix to be used for prediction. If NULL (default), the fitted covariates are used.

type

Type of prediction to return. Options are:

  • "response" (default): Returns the reconstructed matrix \(X B\).

  • "prob": Returns probabilities using B.prob instead of B.

  • "class": Returns the class label corresponding to the maximum in each column of B.prob.

See also