+2 votes
in Programming Languages by (12.4k points)
I want to use MCC as the eval_metric in XGBoost classifier, but MCC is not in the list of the values for eval_metric. Is there any way to use user-defined function as eval_metric in xgboost?

1 Answer

0 votes
by (22k points)
edited by

You can use MCC as eval_metric in XGboost. You need to define a small function to use MCC as eval_metric. Have a look at the sample code here. https://www.discoverbyts.com/post/python-using-matthews-correlation-coefficient-mcc-as-evaluation-metric-in-xgboost/