Applies the learned selected-step sequence to newdata. For each
observation, steps are applied in order; the first step whose rule
classifies the observation is authoritative. Observations not classified
by any step are returned as NA (resolved = FALSE).
Usage
# S3 method for class 'sda_fit'
predict(object, newdata, type = "class", ...)Arguments
- object
A
sda_fitobject.- newdata
Data frame or matrix. Must contain columns with names matching all selected attributes in
object$selected_attributes. Extra columns are ignored (wide-newdata is supported).- type
Output type. One of
"class"(default),"stage","rule", or"trace"."propensity"and"weights"are reserved for SDA-5 and error in SDA-1.- ...
Unused.
Value
"class"Integer vector of predicted class labels;
NAfor unresolved observations."stage"Integer vector of step_id at which each observation was classified;
NAfor unresolved."rule"Character vector of the selected attribute name at the classifying step;
NAfor unresolved."trace"Data frame with one row per observation x step:
obs_id,step_id,attribute,classified,class_pred.