Which MATLAB function is the best for building a decision tree with the CART algorithm?
Mostra commenti meno recenti
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?
Risposte (2)
owr
il 16 Mag 2012
0 voti
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.
1 Commento
Tom Lane
il 16 Mag 2012
Hunch is correct.
Muhammad Aasem
il 25 Mag 2012
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 Commento
Ines
il 25 Mag 2012
Categorie
Scopri di più su Classification Trees in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!