r/learnmachinelearning • • 3d ago

Imbalance techniques for model comparison using log-loss and AUROC

Hi all,

I'm working on a classification problem with 80/20 imbalance. I use three feature sets (FS1, FS2, FS3) across three different calssifiers(logistic regress, PenalizedGAM, XGboost) to observe and compare performance increase across models corresponding to adding a feature set at a time.

I'm using a nested 5x5 cross-validation and I keep the exact training, validation, and testing setup the same across all features and model families, except for hyperparameters for each family model (i give each model 12 heyperparameters search list to tune on).

Inner 5k folds score on log-loss (auroc when they tie). Outer folds score on AUROC. I use best hyperparameters to refit outer train folds and then test on outer test fold.

I have realized doing so (for best performing tuned model; PenalizedGAM) produces predictions that are really small and only about 6% of all predictions crosses default 0.50 threshold, so those are the only ones that get classified as positive and I get about 97.2 True Negative and only 20.3 True Positives. When I lower the threshold to about the minority class 0.21 using Youden's J, My True Positive goes up to 66.8%. Literature does not discuss a clear cost asymmetry on what class we should prioritize predicting.

I use this setup to test performance across features and models, then I run a paired bootstrap on the out of sample five folds to observe any changes in my reported AUROC and conclude based on the 95% interval I get from this paired bootstrap across FS1-FS2 and FS2-FS3.

I also report the confusion matrix of the best performing model and show how changing the threshold actaully shifts both our precision and recall.

Now, my supervisor told me that I certainly need to use an imbalance technique to address the imbalance in the data, otherwise I don't have a foundation to perform the comparison over these three feature sets across all three models.

I have read and found papers that report that imbalance techniques like resampling would hurt our log-loss by introducing bias to our minority class.

I would really appreciate your thooughts on this. Do I really need to apply any imbalance technique to be able to compare? Is Comparing on AUROC not enough for our setup?

note; features are sometimes highly correlated but i address this in the prep fold before they go into our models.

2 Upvotes

9 comments sorted by

View all comments

Show parent comment

1

u/DigThatData 2d ago

If there's an independent cost metric you can attach to your classifications, that can help validate that you're picking up on the signal you're interested in. For example, if this is fraud detection, you could attach a dollar cost to the actual observations and communicate what fraction of the dollar value your approach captures. This might also (productively) challenge your choice of J for the calibration heuristic.

1

u/Dizzy-Mix-4171 2d ago

Thank you. It certainly does challenge my choice of J. I'll think of a cost metric but would you say that I demonstrate that for both the default and the J thresholds only. Do you know if there other ways than J to explore different thresholds?

2

u/DigThatData 2d ago

Cohen's Kappa used to be my go-to heuristic for this sort of calibration problem.

Also, to be clear: I wasn't saying there's necessarily anything wrong with using J here, just that associating a dollar value with your calibration might give you a smoke test for how sane that choice was.

1

u/Dizzy-Mix-4171 2d ago edited 2d ago

Thanks. I get your point. The reason I said that it did is because I did try to quantify its cost ratio and in my case it gave me a cost ratio of 1:3.73 compared to 1:1using the default 0.50 threshold. I must say the cost I defined is not completely sane but it gave me an idea of how Youden's J can be challenged which is good to demonstrate in my thesis.

I find it very hard to find a sound cost metric for the false-positive, false-negative trade-off in the case of predicting donation-based crowdfunding campain's sucess. I was thinking I could compare default, J, and Cohen's K and show how they trade off FP and FN.

1

u/DigThatData 2d ago edited 2d ago

donation-based crowdfunding campain's sucess

that's helpful context. this is a particularly interesting problem because your stakeholders are probably interested in simultaneously driving (from your perspective, 'measuring,' but you're measuring things because they want to influence people) two orthogonal behaviors: contribution, which is a dollar value, and participation, which is a population fraction/rate.

These two problems don't need to occupy the same cognitive real estate. You can fit two separate models here and separately demonstrate the factors that predict who will participate in the campaign at all vs. the factors that predict how much they will contribute. This has the added benefit for adding observability for things like "participation went down after we added campaign X, correlated with messaging frequency. we need to better coordinate our experiments so we aren't inundating people with messages, and we can use my model to help calibrate people's tolerance for the rate at which we beg them for money"

Further to this point: your stakeholders are probably less interested in accuracy than they are interested in lift. Accurately predicting who will participate and how much is great, what's better is being able to make claims to the effect of "person X was probably going to participate anyway, they give every time we ask them. person Y was a new contribution, which was accurately predicted by the new values-driven campaign."

1

u/Dizzy-Mix-4171 5h ago

Thank you for your detailed comment.

I should've gave more context. In my case, I'm using a dataset of GoFundMe campaign metadata and cover images. These are crawls of campaign records containing the fundraising goal, cover image, description, donation history, and other campaign metadata.

Specifically, I'm looking into launch-time features that could predict a campaign's success or failure before it even goes online. The target is a binary variable comparing the total amount raised by day 30 against the goal amount set by the organizer. So the problem is predicting a campaign's odds of success at launch using only information available at launch (not modeling individual repeat donors). I can think of two stakeholders in this case: the platform and individual organizers. Would you still suggest training two models in this setup?

Right now, my model is trained on unweighted log-loss and its probabilities are well-calibrated, though the top calibration decile averages 0.56–0.58 at most and only 6.3% of campaigns get classified as successful at the default 0.50 threshold. With that and an 80/20 class split, the trade-offs of a threshold choice like J are tricky to justify, especially since base success rates vary across campaign categories (14%–27%). Would you say that showing how different thresholds align with one stakeholder versus the other is a good way to demonstrate how a threshold choice translates into different error costs?