<commit_before># -*- coding: utf-8 -*-
import numpy as np


def is_multiclass_classifier(clf):
    """
    Return True if a classifier is multiclass or False if it is binary.
    """
    return clf.coef_.shape[0] > 1


def is_multitarget_regressor(clf):
    """
    Return True if a regressor is multitarget
    or False if it predicts a single target.
    """
    return len(clf.coef_.shape) > 1 and clf.coef_.shape[0] > 1


def is_probabilistic_classifier(clf):
    """ Return True if a classifier can return probabilities """
    return hasattr(clf, 'predict_proba')


def has_intercept(clf):
    """ Return True if classifier has intercept fit. """
    return getattr(clf, 'fit_intercept', False)


class FeatureNames(object):
    def __init__(self, feature_names=None, bias_name=None,
                 unkn_template=None, n_features=None):
        assert (feature_names is not None or<commit_msg>has_intercept: rename 'clf' to 'estimator' as it also supports linear regression models<commit_after># -*- coding: utf-8 -*-
import numpy as np


def is_multiclass_classifier(clf):
    """
    Return True if a classifier is multiclass or False if it is binary.
    """
    return clf.coef_.shape[0] > 1


def is_multitarget_regressor(clf):
    """
    Return True if a regressor is multitarget
    or False if it predicts a single target.
    """
    return len(clf.coef_.shape) > 1 and clf.coef_.shape[0] > 1


def is_probabilistic_classifier(clf):
    """ Return True if a classifier can return probabilities """
    return hasattr(clf, 'predict_proba')


def has_intercept(estimator):
    """ Return True if an estimator has intercept fit. """
    return getattr(estimator, 'fit_intercept', False)


class FeatureNames(object):
    def __init__(self, feature_names=None, bias_name=None,
                 unkn_template=None, n_features=None):
        assert (feature_names is not None or
{'fraction_non_alphanumeric': 0.1, 'fraction_numerical': 0.006349206349206349, 'mean_word_length': 3.4704491725768323, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '473191', 'n_tokens_mistral': 626, 'n_tokens_neox': 589, 'n_words': 187}