# Do we need to apply weights if we are using the AUC PR for imbalanced data?

**URL:** <https://discourse.julialang.org/t/do-we-need-to-apply-weights-if-we-are-using-the-auc-pr-for-imbalanced-data/89533>\
**Category:** Machine Learning\
**Created:** [October 30, 2022, 10:58pm UTC](https://discourse.julialang.org/t/do-we-need-to-apply-weights-if-we-are-using-the-auc-pr-for-imbalanced-data/89533 "2022-10-30T22:58:16Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Juan](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/juan/32/7657_2.png) [@Juan](https://discourse.julialang.org/u/Juan)\
**Post date:** [October 30, 2022, 10:58pm UTC](https://discourse.julialang.org/t/do-we-need-to-apply-weights-if-we-are-using-the-auc-pr-for-imbalanced-data/89533/1 "2022-10-30T22:58:16Z")

</div>

If we want to apply a classification model to imbalanced data we should

- Apply weights to the classes or use a cost matrix.
- Use the metrics more robust to imbalance, for example the AUC PR better than the AUC ROC, and the Phi MCC better than the F1, and the F1 better than the Accuracy.

Should we use only one of these recommendations or both simultaneously?

I mean,  
if we are using the AUC\_PR… Do we still need to apply weights to the input?

and vice versa

if we are using weights… Is it still recommended to use the AUC\_PR instead of the Accuracy?

Is it more important to properly weight the classes or use the proper metric/score?
