I have a dataset with 7 classes and 3 features. The data set is hugely imbalanced. So, I referred https://www.mathworks.com/help/stats/classification-with-imbalanced-data.html to classfy the data. I get a prediction accuracy of 94%. But I need the probability of getting each class for a feature or set of features. How to get probability of each class to a given feature?
[Nt Mt] = size(y); % Number of observations in the training sample
t = templateTree('MaxNumSplits',Nt);
rusTree = fitcensemble(X,y,'Method','RUSBoost', 'NumLearningCycles',1000,'Learners',t,'LearnRate',0.1,'nprint',100);
[~,scores] = predict(rusTree,[1 16 3 5])
I get following scores for above code, 0.7345, 3.5105, 1.1893, 0, 0, 0, 0.0082
But above scores are not probablities, how to get values between 0-1 where sum of proabilities in all classes is equal to 1?
Best Answer