kenders2000/decisio​nTreeMat2Cpp

converts TreeBagger class, or ClassificationTree Class to text file for use with included C ++ class

https://github.com/kenders2000/decisionTreeMat2Cpp

You are now following this Submission

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 (2026). kenders2000/decisionTreeMat2Cpp (https://github.com/kenders2000/decisionTreeMat2Cpp), GitHub. Retrieved .

General Information

MATLAB Release Compatibility

  • Compatible with any release

Platform Compatibility

  • Windows
  • macOS
  • Linux

Versions that use the GitHub default branch cannot be downloaded

Version Published Release Notes Action
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.