<commit_before>import numpy as np
from sklearn.base import BaseEstimator, ClassifierMixin
from sklearn.metrics import accuracy_score
from sklearn.externals import six

from ._decode import DECODERS
from ._utils import atleast2d_or_csr, safe_sparse_dot, validate_lengths


# XXX Should we even derive from ClassifierMixin here?
# We override all the methods.
class BaseSequenceClassifier(BaseEstimator, ClassifierMixin):
    def _get_decoder(self):
        try:
            return DECODERS[self.decode]
        except KeyError:
            return ValueError("Unknown decoder {0!r}".format(self.decode))

    def predict(self, X, lengths=None):
        """Predict labels/tags for samples X.

        Parameters<commit_msg>FIX error should be raised, not returned<commit_after>import numpy as np
from sklearn.base import BaseEstimator, ClassifierMixin
from sklearn.metrics import accuracy_score
from sklearn.externals import six

from ._decode import DECODERS
from ._utils import atleast2d_or_csr, safe_sparse_dot, validate_lengths


# XXX Should we even derive from ClassifierMixin here?
# We override all the methods.
class BaseSequenceClassifier(BaseEstimator, ClassifierMixin):
    def _get_decoder(self):
        try:
            return DECODERS[self.decode]
        except KeyError:
            raise ValueError("Unknown decoder {0!r}".format(self.decode))

    def predict(self, X, lengths=None):
        """Predict labels/tags for samples X.

        Parameters
{'fraction_non_alphanumeric': 0.06753069577080491, 'fraction_numerical': 0.002728512960436562, 'mean_word_length': 3.9393939393939394, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '4776792', 'n_tokens_mistral': 430, 'n_tokens_neox': 409, 'n_words': 133}