def mcc ( y , z ) : tp , tn , fp , fn = contingency_table ( y , z ) return ( tp * tn - fp * fn ) / K . sqrt ( ( tp + fp ) * ( tp + fn ) * ( tn + fp ) * ( tn + fn ) )
python three labels matthews correlation coefficient
Matthews correlation coefficient
def mcc(y, z):
    """Matthews correlation coefficient
    """
    tp, tn, fp, fn = contingency_table(y, z)
    return (tp * tn - fp * fn) / K.sqrt((tp + fp) * (tp + fn) * (tn + fp) * (tn + fn))