Azzera filtri
Azzera filtri

How does 'InBagFraction' work in Treebagger?

5 visualizzazioni (ultimi 30 giorni)
Kyeong-Ho Ryu
Kyeong-Ho Ryu il 22 Mag 2020
Risposto: Raunak Gupta il 26 Mag 2020
I have created a TREEBAGGER object setting 'oobvarimp' to 'on'. I want to determine what fraction of observations are used as out-of-bag observations.
I know the default value of InBagFraction is one and that the training data set is two-thirds of the total. How can I set the training data set to 80%?

Risposte (1)

Raunak Gupta
Raunak Gupta il 26 Mag 2020
Hi,
The ‘InBagFraction’ is a fraction of input data to be used while creating a new tree. It has nothing to do with amount of out-of-bag sample as mentioned here. Since maximum value for ‘InBagFraction can be 1 so it is not possible to get 80% of the input data as in-bag observations. From the trained Model you may see that Mdl.OOBIndices will return a matrix. The true (1) values in matrix represent out-of-bag observation for that tree. Counting all non-zero value in that matrix will return overall out-of-bag samples count and thus give you the fraction.

Prodotti

Community Treasure Hunt

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

Start Hunting!

Translated by