Learn R Programming

msgl (version 0.1.3)

predict.msgl: Predict

Description

Computes the linear predictors, the estimated probabilities and the estimated classes for a new data set.

Usage

## S3 method for class 'msgl':
predict(object, x, sparse.data = FALSE,
    ...)

Arguments

object
an object of class msgl, produced with msgl.
x
a data matrix of size $N_\textrm{new} \times p$.
sparse.data
if TRUE x will be treated as sparse, if x is a sparse matrix it will be treated as sparse by default.
...
ignored.

Value

  • linkthe linear predictors -- a list of length length(fit$beta) one item for each model, with each item a matrix of size $K \times N_\textrm{new}$ containing the linear predictors.
  • responsethe estimated probabilities -- a list of length length(fit$beta) one item for each model, with each item a matrix of size $K \times N_\textrm{new}$ containing the probabilities.
  • classesthe estimated classes -- a matrix of size $N_\textrm{new} \times d$ with $d=$length(fit$beta).