def fscore(links_true, links_pred=None):
    """fscore(links_true, links_pred)

    Compute the F-score.

    The F-score is given by 2*(precision*recall)/(precision+recall).

    Parameters
    ----------
    links_true: pandas.MultiIndex, pandas.DataFrame, pandas.Series
        The true (or actual) collection of links.
    links_pred: pandas.MultiIndex, pandas.DataFrame, pandas.Series
        The predicted collection of links.

    Returns
    -------
    float
        The fscore

    Note
    ----
    If there are no pairs predicted as links, this measure will raise a
    ZeroDivisionError.

     """

    prec = precision(links_true, links_pred)
    rec = recall(links_true, links_pred)

    return float(2 * prec * rec / (prec + rec))
fscore(links_true, links_pred)

    Compute the F-score.

    The F-score is given by 2*(precision*recall)/(precision+recall).

    Parameters
    ----------
    links_true: pandas.MultiIndex, pandas.DataFrame, pandas.Series
        The true (or actual) collection of links.
    links_pred: pandas.MultiIndex, pandas.DataFrame, pandas.Series
        The predicted collection of links.

    Returns
    -------
    float
        The fscore

    Note
    ----
    If there are no pairs predicted as links, this measure will raise a
    ZeroDivisionError.