def rank_results(results):
    """Ranks the results of the hyperparam search, prints the ranks and returns them.

    Args:
        results (list): list of model configs and their scores.

    Returns:
        list: the results list reordered by performance.
    """
    ranking = sorted(results, key=lambda k: k["score"], reverse=True)
    for i, rank in enumerate(ranking):
        print(f"{i+1}. {rank['name']}: {rank['score']}")
    print("\n")
    return ranking