Decision trees, only binary branches?

4 ビュー (過去 30 日間)
Radoslav Vandzura
Radoslav Vandzura 2016 年 1 月 31 日
コメント済み: Radoslav Vandzura 2016 年 2 月 3 日
Hello, I need do classification trees in Matlab. I have preprocess my dataset into intervals (because i don't want to have many branches). But after studiing Mathworks documentation I detected that:'Statistics and Machine Learning Toolbox™ trees are binary'....What does it mean? Can I use only two branches when i want to do decision trees in Matlab? Thank you for your answer in advance...:)

採用された回答

Tom Lane
Tom Lane 2016 年 2 月 2 日
If you fit a classification tree to the famous Fisher iris data, you get this:
>> load fisheriris
>> f = fitctree(meas,species);
>> view(f)
Decision tree for classification
1 if x3<2.45 then node 2 elseif x3>=2.45 then node 3 else setosa
2 class = setosa
3 if x4<1.75 then node 4 elseif x4>=1.75 then node 5 else versicolor
4 if x3<4.95 then node 6 elseif x3>=4.95 then node 7 else versicolor
5 class = virginica
6 if x4<1.65 then node 8 elseif x4>=1.65 then node 9 else versicolor
7 class = virginica
8 class = versicolor
9 class = virginica
So you can see:
  1. The tree has more than two branches
  2. It can predict more than two classes (three in this case)
  3. However, at each branch it makes a binary decision, X<s or X>=s
If X happens to be a categorical predictor, then it still makes a binary decision of the form "X is among this group of categories" or "X is among this other group."
  1 件のコメント
Radoslav Vandzura
Radoslav Vandzura 2016 年 2 月 3 日
And, how should I preprocess my data before making classification trees? Is making intervals good way of preprocessing data? Are any steps before making trees? Thank you in advance :)

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeClassification Trees についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by