Random Forest Class Labels

asked 2013-10-24 17:03:29 -0500

slaw gravatar image

updated 2013-10-24 17:21:47 -0500

I have trained my data (using Random Forest) and saved an XML file for my predictor. Normally, the class labels from the training data can be obtained from the "get_class_labels_map()" method. I have class labels that are alphabets so I end up with std::map<std::string, int="">.

However, after I load the predictor, how do I access the class labels in the predictor? In other words, when I make a prediction, the method returns a float. I was hoping that I could somehow then convert this float to its corresponding alphabet based on the class labels from the training data.

Alternatively, is there some way to save the class labels in the XML predictor file?

In case it matters, I am programming this in C++.

Any suggestion would be greatly appreciated!

edit retag flag offensive close merge delete