visualize a tree and splitting point in TreeBagger

조회 수: 7 (최근 30일)
Henry
Henry 2013년 10월 11일
답변: Mohammad Abdulla 2018년 7월 5일
Hi, Suppose I fit a TreeBagger with 2 column predictor variables X:
B = TreeBagger(1,X,y, 'Method','classification','NVarToSample',1,'oobpred','on')
I want to visualize any tree that I choose, and the splitting values. How can I do that? Thanks!

채택된 답변

Ilya
Ilya 2013년 10월 13일
doc TreeBagger and take a look at the Trees property. For example, to see the first tree
view(B.Trees{1})
  댓글 수: 3
Ilya
Ilya 2013년 10월 14일
What I said about the view method is not in the TreeBagger doc. Typing
B.Trees{1}
returns an object for a single tree. If you use R2013a or later, the class is included in the display of this object. (If you use an earlier release, you can infer the class of this object from the variable editor, for instance.) You can then go to the doc for that class.
Henry
Henry 2013년 10월 14일
Alright, thanks very much!

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

추가 답변 (1개)

Mohammad Abdulla
Mohammad Abdulla 2018년 7월 5일
Hi, How can I increase the number of iterations for fitting a decision tree or random forest? Also, how can I change the opimizer from Bayesian to other such as grid search

Community Treasure Hunt

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

Start Hunting!

Translated by