es = []

    if prediction_task == &#39;regression&#39;:
        alphas = _alpha_grid(X, y)
    elif prediction_task == &#39;classification&#39;:
        # LogisticRegression accepts inverse of regularization
        alphas = np.flip(np.logspace(-4, 4, num=100, base=10))

    # alphas are sorted from highest to lowest regularization
    for i, alpha in enumerate(alphas):

        if prediction_task == &#39;regression&#39;:
            m = Lasso(alpha=alpha, random_state=random_state, max_iter=2000)
        