ctree = compact(tree)
A classification tree created using
A compact decision tree.
Compare the size of the classification tree for Fisher's iris data to the compact version of the tree.
load fisheriris fulltree = fitctree(meas,species); ctree = compact(fulltree); b = whos('fulltree'); % b.bytes = size of fulltree c = whos('ctree'); % c.bytes = size of ctree [b.bytes c.bytes] % shows ctree uses half the memory
ans = 1×2 11613 4924