check_results.py
def classify_results(final_results, threshold):
    """
    Inputs:
      - final_results : list of dictionaries of results, that contain info as to whether or not
          this is an actual attack

    Returns:
      - total_unique_TP : total number unique attacks classified as attacks
      - total_FP : total number of false positives
    """
    total_unique_TP = 0
    total_TP_per_day = {}
    total_FP = 0
    total_FP_per_day = {}
    for result in final_results:
        if result["score"] > threshold:
            if result["isAttack"]:
                total_unique_TP += 1
                if result["date"] not in list(total_TP_per_day.keys()):
                    total_TP_per_day[result["date"]] = 1
                else:
                    total_TP_per_day[result["date"]] += 1
            else:
                total_FP += 1
                if result["date"] not in list(total_FP_per_day.keys()):
                    total_FP_per_day[result["date"]] = 1
                else:
                    total_FP_per_day[result["date"]] += 1
    return total_unique_TP, total_TP_per_day, total_FP, total_FP_per_day

    Inputs:
      - final_results : list of dictionaries of results, that contain info as to whether or not
          this is an actual attack

    Returns:
      - total_unique_TP : total number unique attacks classified as attacks
      - total_FP : total number of false positives
    
final_results : list of dictionaries of results, that contain info as to whether or not
this is an actual attack
final_results : list of dictionaries of results that contain info as to whether or not this is an actual attack
def classify_results(final_results, threshold):
    total_unique_TP = 0
    total_TP_per_day = {}
    total_FP = 0
    total_FP_per_day = {}
    for result in final_results:
        if result["score"] > threshold:
            if result["isAttack"]:
                total_unique_TP += 1
                if result["date"] not in list(total_TP_per_day.keys()):
                    total_TP_per_day[result["date"]] = 1
                else:
                    total_TP_per_day[result["date"]] += 1
            else:
                total_FP += 1
                if result["date"] not in list(total_FP_per_day.keys()):
                    total_FP_per_day[result["date"]] = 1
                else:
                    total_FP_per_day[result["date"]] += 1
    return total_unique_TP, total_TP_per_day, total_FP, total_FP_per_day
def classify_results ( final_results , threshold ) : total_unique_TP = 0 total_TP_per_day = { } total_FP = 0 total_FP_per_day = { } for result in final_results : if result [ "score" ] > threshold : if result [ "isAttack" ] : total_unique_TP += 1 if result [ "date" ] not in list ( total_TP_per_day . keys ( ) ) : total_TP_per_day [ result [ "date" ] ] = 1 else : total_TP_per_day [ result [ "date" ] ] += 1 else : total_FP += 1 if result [ "date" ] not in list ( total_FP_per_day . keys ( ) ) : total_FP_per_day [ result [ "date" ] ] = 1 else : total_FP_per_day [ result [ "date" ] ] += 1 return total_unique_TP , total_TP_per_day , total_FP , total_FP_per_day
Inputs:
 final_results : list of dictionaries of results, that contain info as to whether or not
this is an actual attack
Inputs : final_results : list of dictionaries of results that contain info as to whether or not this is an actual attack
"""
    Inputs:
      - final_results : list of dictionaries of results, that contain info as to whether or not
          this is an actual attack

    Returns:
      - total_unique_TP : total number unique attacks classified as attacks
      - total_FP : total number of false positives
    """
total_unique_TP : total number unique attacks classified as attacks
total_FP : total number of false positives
total_unique_TP : total number unique attacks classified as attacks total_FP : total number of false positives
final_results
threshold