def getMetricSummaries(metrics):
    """This function takes in a list of confusion metric summaries (usually from cross validation over a range of factors) and
    then computes the listing of precision, recall, and accuracy for each factor then returns precision, recall and accuracy in that order."""
    precision = []
    recall = []
    acc = []
    for i in metrics:
        #the max(...,1) is in the case of 0 being in the denominator so precision shows up as 0 instead of error
        precision.append(i[1][1]/max((i[0][1]+i[1][1]),1))
        recall.append(i[1][1]/max(sum(i[1]),1))
        acc.append((i[0][0]+i[1][1])/max(1,(sum(i[0])+sum(i[1]))))
    
    return precision, recall, acc