support=s))
            coefs.append(w)

    return nonzero_rules, coefs, lin_model.intercept_


def get_best_alpha_under_max_rules(X, y, rules: List[str],
                                   penalty=&#39;l1&#39;,
                                   prediction_task=&#39;regression&#39;,
                                   max_rules=30,
                                   cv=True,
                                   random_state=None) -&gt; float:
    coef_zero_threshold = 1e-6 / np.mean(np.abs(y))
    alpha_scor