Login
Remember
Register
Questions
Unanswered
Categories
Ask a Question
Tech Blogs
Quiz
Ask a Question
Python: How to use MCC (Matthews correlation coefficient) as eval_metric in XGboost
+3
votes
asked
Aug 2, 2018
in
Programming Languages
by
pythonuser
(
63.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?
xgboost
mcc
evel_metric
matthews correlation coefficient
Please
log in
or
register
to add a comment.
Please
log in
or
register
to answer this question.
1
Answer
+1
vote
answered
Aug 2, 2018
by
pkumar81
(
271k
points)
edited
Jul 16
by
pkumar81
Best answer
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.bitsdiscover.com/python-using-matthews-correlation-coefficient-mcc-as-evaluation-metric-in-xgboost/
Please
log in
or
register
to add a comment.
Related questions
+4
votes
1
answer
XGBoost : how to store train and test data in a DMatrix object in Python
asked
Aug 30, 2020
in
Machine Learning
by
pythonuser
(
63.4k
points)
xgboost
python
dmatrix
+4
votes
1
answer
Python : How to find the optimal parameter values for Xgboost
asked
Mar 21, 2018
in
Machine Learning
by
pythonuser
(
63.4k
points)
python
xgboost
parameter
auc_roc
+3
votes
1
answer
How to Install XGboost for Python on Windows
asked
May 3, 2017
in
General IT Tips
by
pkumar81
(
271k
points)
xgboost
python
windows
install
+2
votes
1
answer
XGboost: How to save a trained model and load it
asked
Nov 21, 2019
in
Machine Learning
by
pythonuser
(
63.4k
points)
xgboost
model
train
load
save
+2
votes
1
answer
XGboost: how to find hyperparameters (parameters) of a trained model
asked
Nov 21, 2019
in
Machine Learning
by
pythonuser
(
63.4k
points)
xgboost
hyperparameter
model
Categories
All categories
Programming Languages
(697)
Machine Learning
(31)
Operating Systems
(114)
Databases
(91)
Web & Google
(85)
CMS Tips
(31)
General IT Tips
(77)
GK Quiz QA
(81)
...