def precision_recall_etc(classification, actual_classification):
    """Given a pair of classifications and actual classifications,
    calculates various assessment parameters of the classification

    Parameters calculated: precision, recall, specificity, NPV, f1,
         tp (true positive), tn (true negative), fp (false positive),
         fn (false negative), accuracy

    Arguments:
        classification {[type]} -- the classifications you want to evaluate
        actual_classification {[list-like]} -- the reference, actual
                                  classifications to evaluate against

    Returns:
         dict -- a dictionary which can access all the values in the
                description above, with keys matching the values in the
                description above.


    Raises:
        RuntimeError -- len() of the two function arguments not the same
    """
    if len(classification) != len(actual_classification):  # if lengths don't match
        raise RuntimeError("Lengths of arguments to accuracy_percentage \
                not the same")
    tp = fp = tn = fn = 0  # t=true, f=false, p=postive, n=negative
    for i in range(len(classification)):
        if actual_classification[i] == 1:  # actual sentiment is positive
            if classification[i] == actual_classification[i]:  # if matches
                tp += 1
            else:  # if doesn't match
                fn += 1
        else:  # actual sentiment is negative
            if classification[i] == actual_classification[i]:  # if matches
                tn += 1
            else:  # if doesn't match
                fp += 1

    # calculate the various performance metrics
    precision = float(tp)/float(tp + fp)
    recall = float(tp)/float(tp + fn)
    specificity = float(tn)/float(fp + tn)
    NPV = float(tn)/float(tn + fn)
    f1 = 2.*float(precision*recall)/float(precision + recall)

    return {'precision': precision, 'recall': recall,
            'specificity': specificity, 'NPV': NPV,
            'f1': f1, 'tp': tp, 'tn': tn, 'fp': fp, 'fn': fn,
            'accuracy': float(tp + tn)/float(tp + fp + tn + fn)}