FUNCTION REFERENCE

ClassificationTree.predict

Predict class labels and scores from a ClassificationTree model.

Predict class labels and scores from a ClassificationTree model.

Syntax

[label, score] = predict(mdl, Xnew)

Routes each row of Xnew down the fitted decision tree and returns predicted labels and leaf class probabilities.

Example

mdl = fitctree([0; 1; 5; 6], [1; 1; 2; 2], 'MinParentSize', 2); predict(mdl, 5.5)   % 2

Differences from MATLAB: Numeric predictors only; call as predict(mdl, Xnew).

These are the engine’s help pages. Each page keeps its compatibility notes. File operations are unavailable in the browser.