Random Forest ClassifierReport
I have just begun to use Python script in Unscrambler 11, and I have created my first Random Forest Classification model. I have first crated the model with “RandomForestClassifierBuildModel”, then I applied it to data with RandomForestClassifierClassify”. Apparently all went well, but when I checked result I found a small but annoying issue.
Unlike usual Unscrambler classifiers, RF Classifier did NOT list categories in predicted class vector in the same order of true class vector. Therefore, not only different markers were assigned to the same class in scatter plots (this would be a lesser problem), but when I created the confusion matrix using the “Contingency Table” tool, correctly classified sample were not on the main diagonal as they should be.
OK, I could rearrange them by hand, but it would not be an optimal solution, especially when many class are involved.
I have tried to change order of categories, using “Category Property”, but it not worked, because it changed the predicted class to all samples.
In other word, samples are not associated to a particular label, but to a particular position in the modality list. If you invert, say, the order of labels “A” and “B” in the list, all “A” samples become “B” and vice versa.
Therefore, I don’t know how to fix such issue. Do you have any suggestion?