'Convert a matrix to a list of lists.'

def matrix_to_lists(self, matrix):

    (rows, cols) = matrix.shape
    lists = []
    for i in range(rows):
        lists.append(matrix[i, :].tolist()[0])
    return lists
