Which accuracy metric of a ML classifier can maximize map@K of a recommender system for an unbalanced dataset? I have to build a recommender system &amp; it will be evaluated using map@10 criteria.
I have rolled up the data/rows at user-item level &amp; is using Gradient Boosting in scikit learn to build the model.

Challenge

But there is a big class imbalance where only 6%( out of 40 K use-item pairs) have actually purchased the item in the entire base. Given this challenge i want to know the accuracy metric I should use to tune the parameters of GBM model.

Question

I thought about using recall, precision, f1 score etc. to tune the hyperparameters of GBM. But which one will maximize map@10 given the class imbalance?

Thanks
If you want to stay in Python, I would suggest going for xgboost instead of GradientBoostingClassifier - among other advantages, it supports map / ndcg as metrics. If you are considering R, gbm supports both map and ndcg.