kenders2000/decisio​nTreeMat2Cpp

Version 1.0.0.0 (11.4 KB) by Paul
converts TreeBagger class, or ClassificationTree Class to text file for use with included C ++ class
126 Downloads
Updated 17 Aug 2015

Introduction
--------------------------------------------------------------------------------
This program takes a decision tree trained in Matlab using TreeBagger or the classification tree function ClassificationTree and outputs a textile containing all the branch information. This text file can be read by the attached C++ class, and then used to make decisions based on presented features in deployed applications.
It is useful for deploying code developed in matlab into other applications / systems as the TreeBagger class is not included in the matlab Coder.

Usage
--------------------------------------------------------------------------------
extractDecTreeStruct.m matlab files takes as input a trained ClassificationTree tree or a TreeBagger classification ensemble, and outputs a text file which can be read by the C++ class DTree in DecisionTreeClass.hpp. in DTree are two methods, readTextFilesTrees reads the decision tree text file outputted by extractDecTreeStruct.m into a number of private arrays. The method decisionTreeFun, then takes as input a series of features and outputs the class (integer number). The files must always have the following postfix : _bag_x.txt, where x is the bag number.

Cite As

Paul (2024). kenders2000/decisionTreeMat2Cpp (https://github.com/kenders2000/decisionTreeMat2Cpp), GitHub. Retrieved .

MATLAB Release Compatibility
Created with R2013b
Compatible with any release
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

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

Start Hunting!

Versions that use the GitHub default branch cannot be downloaded

Version Published Release Notes
1.0.0.0

To view or report issues in this GitHub add-on, visit the GitHub Repository.
To view or report issues in this GitHub add-on, visit the GitHub Repository.