I have had a great deal of success using Weka for data exploration and deciding what classification algorithm is best for my problem. Now that I have a trained model that works, I would like to integrate it into the rest of my C++ program. Unfortunately, this seems like a difficult task: only Weka has native support for exporting classifiers as Java object files. Has anyone found a way to export Weka-trained model parameters in a useful format?
I would be particularly interested if there is a utility that generates C/C++ code from a J48 decision tree.
right-click in the Results list, select Load model and choose /other/place/j48. model. in the More options dialog, change the Output predictions to CSV or another format (and specify a file in the options of the output format), if you want to store the predictions in a file rather than having to copy/paste them.
My understanding is that J48 is Java implementation of Quinlan C4.5 algorithm with C code freely available at http://www.rulequest.com/Personal/ Is this what you are looking for?
J48 implements the Sourcable interface, meaning it can output a built model as Java source code (you can probably achieve this from the classifier panel of the explorer gui). It might then be possible to automatically translate this into C/C++.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With