What is Matthews correlation coefficient (MCC)

In classification problem, if the dataset is imbalanced, accuracy as well as weighted f1-score can be extremely misleading. Matthews correlation coefficient (MCC) is a very good alternative in that case.
MCC can be calculated as:
image

The values of MCC range from -1 to 1, while 0 is the expected values for the coin tossing classifier.

Reference: The advantages of the Matthews correlation coefficient (MCC) over F1 score and accuracy in binary classification evaluation | BMC Genomics | Full Text