predict.logicDT: Prediction for logicDT models

View source: R/logicDT.R

predict.logicDTR 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 'geneticLogicPET'
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 classification in 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 four parameter logistic models were fitted for each leaf, shall they be used for the prediction ("4pl") or shall the constant leaf means be used ("constant")?

models

Which models of logicDT model fitted with 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).


logicDT documentation built on Jan. 14, 2023, 5:06 p.m.