def _calculate_positives_negatives(target_details):
    """
    Takes expected and actual target values, generating true and false positives and negatives,
    including the actual correct # of positive and negative values.
    """

    true_positive = 0
    true_negative = 0
    false_negative = 0
    false_positive = 0
    actual_positive = 0
    actual_negative = 0
    for idx in range(len(target_details)):
        predicted_target = target_details[idx]["predicted_target"]
        expected_target = target_details[idx]["expected_target"]

        if expected_target == 1:
            actual_positive = actual_positive + 1
        else:
            actual_negative = actual_negative + 1

        if predicted_target == 1 and expected_target == 1:
            true_positive = true_positive + 1
        elif predicted_target == 0 and expected_target == 0:
            true_negative = true_negative + 1
        elif predicted_target == 1 and expected_target == 0:
            false_positive = false_positive + 1
        elif predicted_target == 0 and expected_target == 1:
            false_negative = false_negative + 1

    return {
        "true_positive": float(true_positive),
        "false_positive": float(false_positive),
        "actual_positive": float(actual_positive),

        "true_negative": float(true_negative),
        "false_negative": float(false_negative),
        "actual_negative": float(actual_negative),
    }