How to get every tree's prediction value after using "TreeBagger" function
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Hi guys.
I trained bagging trees using TreeBagger function and set 200 for number of trees.
As I know, TreeBagger's prediction is mean value of 200 trees prediction value.
This is my question. Can I get every 200 tree's prediction value? before TreeBagger determined prediction value.
I need 200 tree's prediction value to ananlye my study but I can't find a way to do it. :(
I would greatly appreciate it if anyone tells me how to solve this problem.
Have a nice day :)
0 comentarios
Respuestas (1)
TED MOSBY
el 4 de Abr. de 2024
Hi Hyeon,
To individually get every tree’s prediction value you can use the ‘oobPredict’ method.
The ‘oobPredict’ method allows you to obtain the out-of-bag predictions made by each tree in the ensemble.
% ………..your code……….
yourModel = TreeBagger(numTrees, X, Y, ….)
% use one of the following two syntaxes depending on whichever works to get oob predictions for each tree
oobPredictions = oobPredict(yourmodel) or oobPredictions = yourmodel.oobPredict()
% …………your remaining code…………..
In the “oobPredictions” variable, you will have a matrix where each row corresponds to an observation in your dataset, and each column corresponds to the prediction made by a specific tree in the ensemble.
Alternatively, you can check out the following method as well in which you can turn the status for ‘OOBPrediction” attribute in the TreeBagger model as “on”:
Feel free to check out the following links for the “oobPredict” function to get more understanding for the same:
0 comentarios
Ver también
Categorías
Más información sobre Classification Ensembles en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!