Skip to contents

Model$predict() uses this function as a predict method for the predict() generic.

Usage

# S3 method for class 'ptk_zerosum'
predict(object, newx, ...)

Arguments

object

A ptk_patroklos S3 object.

newx

Predictor data as a named numeric matrix. Samples correspond to rows.

...

Further arguments passed to the wrapped function.

Value

A numeric vector with the prediction for every sample. Unlike zeroSum::predict.zeroSum(),

  • if object$type == 2 (i.e., object was fitted with family = "binomial" by ptk_zerosum`), the predictions are binomial probabilities,

  • if object$type == 4 (i.e., object was fitted with family = "cox" by ptk_zerosum), the predictions are the exponential of the linear predictor, i.e., exp(beta_0 + beta^T x)`.

  • If object$binarizePredictions is not NULL, the predictions are binarized via as.numeric(y > object$binarizePredictions).