import math

num_benign = 29
mean = 0.5
sd = math.sqrt(int(round(num_benign * 0.75)) * 0.5 * 0.5) / float(int(round(num_benign * 0.75)))
threshold = mean + 2 * sd

def save_matrix(path, matrix):
    with open(path, "w") as outFile:
        for rows in matrix:
            for cols in rows:
                outFile.writelines(str(float(cols))+" ")
            outFile.writelines("\n")

def load_matrix(path):
    l = []
    with open(path, "r") as f:
        for line in f:
            line = line.strip()
            if len(line) > 0:
                l.append(map(float, line.split()))
    return l