How to use append function in treebagger?

4 Ansichten (letzte 30 Tage)
vijay sabawat
vijay sabawat am 30 Jul. 2012
I have two different trees which are made from different data of same variables. When i was trying to append the two trees to form one tree using append function it is showing the error.
My Code
Storm29= TreeBagger(70,x,y,'OOBPred','on','categorical',[1,2,6],'method','regression'); Strom18= TreeBagger(70,x1,y1,'OOBPred','on','categorical',[1,2,6],'method','regression'); Strom29 = append(Storm29,Strom18);
Error: Error using TreeBagger/append (line 782) The two objects have incompatible X data.
Note: The variables are used in the tree are same but different data

Antworten (2)

Ilya
Ilya am 30 Jul. 2012
TreeBagger/append is intended for combining two ensembles grown on the same data. If you have two different sets of data, the best way is to merge them and grow an ensemble on the merged set. If this is not possible for some reason, combine predictions from the two ensembles, that is, compute an overall prediction using the predicted scores from ensemble 1 and the predicted scores from ensemble 2. The simplest recipe is to take an average. There are other, more involved recipes, of course.
  1 Kommentar
vijay sabawat
vijay sabawat am 30 Jul. 2012
Thank You!!!
My objective is to keep updating tree based on the newly available data sets. Is there anyway to do this except for running the tree model with all the data set each and every time (My data set is huge so it is difficult for me to store the data and append it with new data and to run treebagger all again).

Melden Sie sich an, um zu kommentieren.


Ilya
Ilya am 30 Jul. 2012
Bearbeitet: Ilya am 30 Jul. 2012
You are asking for an online-learning algorithm, that is, one capable of incremental updates. This is a subject for research. I saw online versions of decision tree algorithms and online versions of various ensemble algorithms. You can google for those or I can send you some references if you are up to coding them yourself. Stats Tlbx does not provide them.
You can cheat by compact-ing the two TreeBagger objects and then executing combine method on the compact objects. That way the data checks will be skipped. Do it at your own risk. I do not know what the statistical properties of such combining would be and if there is any literature to support it.
  2 Kommentare
vijay sabawat
vijay sabawat am 31 Jul. 2012
Hi, Is there a way to plot the tree of a treebagger. I know that the treebagger is made of many trees but i am curious to know how exactly the split is occurring in tree.
Ilya
Ilya am 31 Jul. 2012
Please do not ask a new unrelated question in the same thread. Start a new one.
If you found my answer useful, please accept it.
If B is a TreeBagger object, type
B.Trees{1}
or
view(B.Trees{1})

Melden Sie sich an, um zu kommentieren.

Community Treasure Hunt

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

Start Hunting!

Translated by