Which MATLAB function is the best for building a decision tree with the CART algorithm?

조회 수: 2 (최근 30일)
Hello there, I want to build a tree using the CART Algorithm and so far I found two different (?) functions in the Matlab statistics toolbox for doing this: ClassificationTree.fit and classregtree, so I am wondering which of them is better or whether they are both based on the same principles, but with different application fields?

답변 (2개)

owr
owr 2012년 5월 16일
I believe they are using the same algorithms. "classregtree" has been around for quite some time, "ClassificationTree.fit" is syntax based on a newer object based framework. Note I havent researched this rigorously, just a hunch.
If I were writing new code, I would go with the object based syntax as that will likely get more bells and whistles down the line.

Muhammad Aasem
Muhammad Aasem 2012년 5월 25일
use classregtree because it will be supported in the future. anyway. both will give you same result (treefit is now calling classregtree)
try this
load fisheriris;
t1 = classregtree(meas,species);
t2 = treefit(meas,species);
view(t1);
view(t2);
  댓글 수: 1
Ines
Ines 2012년 5월 25일
but how can I assess the goodness of the qualification? I would like to take out 20% for validation and use the residual 80% for the training dataset..and then repeat this procedure several times...i think if I use crossval I cannot use a tree from classregtree (since crossval seems to ask for an object/handle (whatever that might be..)

댓글을 달려면 로그인하십시오.

태그

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by