def sokalmichener(u, v):
u = _validate_vector(u)<EOL>v = _validate_vector(v)<EOL>if u.dtype == np.bool:<EOL><INDENT>ntt = (u & v).sum()<EOL>nff = (~u & ~v).sum()<EOL><DEDENT>else:<EOL><INDENT>ntt = (u * v).sum()<EOL>nff = ((<NUM_LIT:1.0> - u) * (<NUM_LIT:1.0> - v)).sum()<EOL><DEDENT>(nft, ntf) = _nbool_correspond_ft_tf(u, v)<EOL>return float(<NUM_LIT> * (ntf + nft)) / float(ntt + nff + <NUM_LIT> * (ntf + nft))<EOL>
Computes the Sokal-Michener dissimilarity between two boolean 1-D arrays.

The Sokal-Michener dissimilarity between boolean 1-D arrays `u` and `v`,
is defined as

.. math::

   \\frac{R}
        {S + R}

where :math:`c_{ij}` is the number of occurrences of
:math:`\\mathtt{u[k]} = i` and :math:`\\mathtt{v[k]} = j` for
:math:`k < n`, :math:`R = 2 * (c_{TF} + c_{FT})` and
:math:`S = c_{FF} + c_{TT}`.

Parameters
----------
u : (N,) array_like, bool
    Input array.
v : (N,) array_like, bool
    Input array.

Returns
-------
sokalmichener : double
    The Sokal-Michener dissimilarity between vectors `u` and `v`.