predict.logicDT {logicDT}R Documentation

Prediction for logicDT models

Description

Supply new input data for predicting the outcome with a fitted logicDT model.

Usage

## S3 method for class 'logic.bagged'
predict(object, X, Z = NULL, type = "prob", ...)

## S3 method for class 'logic.boosted'
predict(object, X, Z = NULL, type = "prob", ...)

## S3 method for class 'logicDT'
predict(
  object,
  X,
  Z = NULL,
  type = "prob",
  ensemble = FALSE,
  leaves = "4pl",
  ...
)

## S3 method for class 'genetic.logicDT'
predict(
  object,
  X,
  Z = NULL,
  models = "best",
  n_models = 10,
  ensemble = NULL,
  leaves = "4pl",
  ...
)

Arguments

object

Fitted logicDT model. Usually a product of a call to logicDT.

X

Matrix or data frame of binary input data. This object should correspond to the binary matrix for fitting the model.

Z

Optional quantitative covariables supplied as a matrix or data frame. Only used (and required) if the model was fitted using them.

type

Prediction type. This can either be "prob" for probability estimates or "class" for (hard) classification of binary responses. Ignored for regression.

...

Parameters supplied to predict.logicDT

ensemble

If the model was fitted using the inner validation approach, shall the prediction be constructed using the final validated ensemble (TRUE) or using the single final tree (FALSE)?

leaves

If leaf regression models (such as four parameter logistic models) were fitted, shall these models be used for the prediction ("4pl") or shall the constant leaf means be used ("constant")?

models

Which logicDT models fitted via genetic programming shall be used for prediction? "best" leads to the single best model in the final generation, "all" uses the average over the final generation and "n_models" uses the n_models best models.

n_models

How many models shall be used if models = "n_models" and genetic programming was employed?

Value

A numeric vector of predictions. For binary outcomes, this is a vector with estimates for P(Y=1 \mid X = x).


[Package logicDT version 1.0.4 Index]