<commit_before>import numpy as np
from sklearn.utils import check_X_y

from fri.base import FRIBase
from fri.l1models import L1OrdinalRegressor
from fri.optproblems import BaseOrdinalRegressionProblem


class FRIOrdinalRegression(FRIBase):

    """
        Class for ordinal regression data
    """

    problemType = BaseOrdinalRegressionProblem

    def __init__(self, C=None, random_state=None, optimum_deviation=0.01,
                 shadow_features=False, parallel=False, debug=False, **kwargs):
        super().__init__(isRegression=False, C=C, random_state=random_state,
                         shadow_features=shadow_features, parallel=parallel,
                         debug=debug,
                         optimum_deviation=optimum_deviation,
                         **kwargs)

        self.initModel = L1OrdinalRegressor

        # Define parameters which are optimized in the initial gridsearch
        self.tuned_parameters = {}

        # Only use parameter grid when no parameter is given
        # TODO: Set appropraite values for C
        if self.C is None:
            self.tuned_parameters["C"] = [0.0001, 0.001, 0.01, 0.1, 1, 10, 100]
        else:
            self.tuned_parameters["C"] = [self.C]


    def fit(self, X, y):

        """
        Fit model to data and provide feature relevance intervals
        Parameters
        ----------<commit_msg>removed unused parameters<commit_after>import numpy as np
from sklearn.utils import check_X_y

from fri.base import FRIBase
from fri.l1models import L1OrdinalRegressor
from fri.optproblems import BaseOrdinalRegressionProblem


class FRIOrdinalRegression(FRIBase):

    """
        Class for ordinal regression data
    """

    problemType = BaseOrdinalRegressionProblem

    def __init__(self, C=None, random_state=None, optimum_deviation=0.001,
                 parallel=False, debug=False, **kwargs):
        super().__init__(isRegression=False, C=C, random_state=random_state,
                         parallel=parallel,
                         debug=debug,
                         optimum_deviation=optimum_deviation,
                         **kwargs)

        self.initModel = L1OrdinalRegressor

        # Define parameters which are optimized in the initial gridsearch
        self.tuned_parameters = {}

        # Only use parameter grid when no parameter is given
        # TODO: Set appropraite values for C
        if self.C is None:
            self.tuned_parameters["C"] = [0.0001, 0.001, 0.01, 0.1, 1, 10, 100]
        else:
            self.tuned_parameters["C"] = [self.C]


    def fit(self, X, y):

        """
        Fit model to data and provide feature relevance intervals
        Parameters
        ----------
{'fraction_non_alphanumeric': 0.08324125230202578, 'fraction_numerical': 0.019521178637200737, 'mean_word_length': 2.252694610778443, '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': '1325370', 'n_tokens_mistral': 818, 'n_tokens_neox': 721, 'n_words': 204}