Performance Imbalance Dataset Decision Tree I have a imbalance dataset for a classification task, with the minority class accounting for about 21% of the total.
When I use a decision tree based model for prediction, let's say a classification tree or a Random Forest (with scikit-learn), I get a global accuracy of 76%. The detection rate of the minority class (also called sensitivity), is only about 43%.
So, to get an higher detection rate for the minority class, I penalize it more heavily. In sklearn, one can do it with the parameter class_weight={'0':1, '1':penal_value} (here, 0 being the majority class, and 1 the minority).
Of course penal_value is >= 1.
For example, when I set it to 2, I get a 71 global accuracy, but a 55 minority class detection rate.
When I set it to 3.76 (= to 81% / 21%, the rate of the majority on the minority), I get 64 global accuracy, and 60 detection rate.
When I set it to 5, ... Well, you understand the procedure.
What I whant is a measure, that tell what is a "good" value for the penalization. Because it seems that, at the beginning, so with penal_value between 1 and 3.76, it's in some way interesting to lose some global accuracy, because we gain enough sensitivity. It's worth the trade-off.
But past this point, 3.76, it's "not worth" it. The loose in global accuracy "is not compensated" by the gain in sensitivity.
How could I put in a more "objective" way/measure?
 A: When dealing with classification, the most intuitive metric to evaluate a model's perfomance is the accuracy, because it tells how many registers have been classified correctly: the higher, the better. However, as you have noticed, accuracy is not a good measure of the model's performance when dealing with an imbalanced dataset. Imagine that the minority class is the 1% of the total dataset... if your model predicted every register as the majority class, you would get a very high accuracy.
It's preferable in cases such us yours to maximize other metrics rather than accuracy. ROC's AUC (Area Under de ROC Curve) can give you a better idea about how is the model predicting correctly both the positive and the negative class. Moreover, this metric is independent of the classification threshold, in contrast with sensitivity (also known as recall) or especificity. However, if you are specially interested in the performance of the possitive class rather than the negative one, it's recommnended to maximize the F1 Score, the harmonic averagte of precision and recall. 
You can read more about all this terms in this article.
Good luck!
