predict.seqm {ProcData}R Documentation

Predict method for sequence models

Description

Obtains predictions from a fitted sequence model object.

Usage

## S3 method for class 'seqm'
predict(object, new_seqs, new_covariates = NULL,
  type = "response", ...)

Arguments

object

a fitted object of class "seqm" from seqm.

new_seqs

an object of class "proc" with which to predict.

new_covariates

a new covariate matrix with which to predict.

type

a string specifying whether to predict responses ("response") or features ("feature") or both ("both").

...

further arguments to be passed to predict.keras.engine.training.Model.

Details

It unserialize object$model_fit to obtain a keras model of class "keras.engin.training.Model" and then calls predict to obtain predictions.

Value

If type="response", a vector of predictions. The vector gives the probabilities of the response variable being one if response_type="binary". If type="feature", a matrix of rnn outputs. If type="both", a list containing both the vector of response variable prediction and the rnn output matrix.

See Also

seqm for fitting sequence models.


[Package ProcData version 0.3.2 Index]