    cv_scoring = &#39;neg_mean_squared_error&#39;
        else:
            m = LogisticRegression(
                penalty=penalty, C=(1 / alpha), solver=&#39;liblinear&#39;, random_state=random_state)
            cv_scoring = &#39;accuracy&#39;

        m.fit(X, y)
        rule_coefs = m.coef_.flatten()
        rule_count = np.sum(np.abs(rule_coefs) &gt; coef_zero_threshold)

        if rule_count &gt; max_rules:
            break

        if cv:
            fold_scores = cross_val_score(m, X, y, cv=5, sc