def average_error(state_edges_predicted, state_edges_actual):
    """
    Given predicted state edges and actual state edges, returns
    the average error of the prediction.
    """
    total=0 
    for key in state_edges_predicted.keys(): 
        #print(key)
        total+=abs(state_edges_predicted[key]-state_edges_actual[key]) 
        #print(state_edges_predicted[state])
    return total/len(state_edges_predicted)		#Returns weighted average error