Skip to contents

Routes each row of newdata down the composite LORT by recursively applying each node's cta_tree model via cta_assign_endpoints.

Usage

# S3 method for class 'cta_ort'
predict(
  object,
  newdata,
  type = c("class", "stratum", "path", "all"),
  missing_action = c("na", "majority"),
  ...
)

Arguments

object

A cta_ort from cta_fit(..., recursive = TRUE).

newdata

Data frame or matrix matching the training X column layout.

type

Character; one of "class" (default), "stratum", "path", or "all".

missing_action

Passed to each node-level cta_assign_endpoints call. "na" (default): observations with a missing split attribute return NA. "majority": route to the majority-class child.

...

Unused.

Value

For type = "class": integer vector of predicted class labels (length nrow(newdata)). For type = "stratum": integer stratum_id vector. For type = "path": character path vector. For type = "all": data.frame with columns predicted_class, stratum_id, path, prop_class1, stop_reason.

Note

predict.cta_ort is a legacy compatibility name; the class cta_ort and all *.cta_ort methods refer to the implemented LORT method. New docs and APIs should use LORT terminology.