def METHOD_NAME(self):
    true_sum = tf.reduce_sum(self.conf_mtx, axis=1)
    pred_sum = tf.reduce_sum(self.conf_mtx, axis=0)
    num_correct = tf.linalg.trace(self.conf_mtx)
    num_samples = tf.reduce_sum(pred_sum)
    # covariance true-pred
    cov_ytyp = num_correct * num_samples - tf.tensordot(true_sum, pred_sum, axes=1)
    # covariance pred-pred
    cov_ypyp = num_samples**2 - tf.tensordot(pred_sum, pred_sum, axes=1)
    # covariance true-true
    cov_ytyt = num_samples**2 - tf.tensordot(true_sum, true_sum, axes=1)
    mcc = cov_ytyp / tf.math.sqrt(cov_ytyt * cov_ypyp)
    if tf.math.is_nan(mcc):
        mcc = tf.constant(0, dtype=self.dtype)
    return mcc