MATLAB: How to create a table with all the path data from the decision tree

Statistics and Machine Learning Toolbox

I have a tree generated from the "fitrtree" function. I need all paths and it's corresponding data as individual columns in a table. Can I do that?

Best Answer

Unfortunately, there is no direct functionality in MATLAB that can create this type of table.
However, you can create such table manually by using the "fitrtree" class properties such as "PredictorNames" and "ResponseName".
Please refer to the following documentation for more information regarding this properties:
I have conveyed this information to the developers and they may consider this as an enhancement for a future release.