def Fit(fn):
    """ Fit with a wrapper """

    def wrapper(self):
        self.paramFROMinput()
        if 'track_header' in self.parameters:
            self.header = self.parameters.pop('track_header')
        else:
            self.header = True
        if 'func_method' in self.parameters:
            self.method = self.parameters.pop('func_method')
        else:
            self.method = None
        available_methods = self.metadata.WParameters.func_method.options
        if self.method not in available_methods:
            msg = (
                "@Task #%i(%s): The method '%s' is not available for the function '%s'."
                 % (self.iblock, self.Task, self.method, self.Function))
            raise NameError(msg)
        elif self.method is None:
            api = self.import_sklearn()
            self.set_value('api', api)
            fn(self)
        elif self.method is 'fit_transform':
            api = self.import_sklearn()
            self.required('df', req=True)
            df = self.inputs['df'].value
            df = api.fit_transform(df)
            self.set_value('api', api)
            self.set_value('df', df)
            fn(self)
        elif self.method is 'transform':
            self.required('df', req=True)
            self.required('api', req=True)
            df = self.inputs['df'].value
            api = self.inputs['api'].value
            df = api.transform(df)
            self.set_value('api', api)
            self.set_value('df', df)
            fn(self)
        elif self.method is 'inverse_transform':
            self.required('df', req=True)
            self.required('api', req=True)
            df = self.inputs['df'].value
            api = self.inputs['api'].value
            df = api.inverse_transform(df)
            self.set_value('api', api)
            self.set_value('df', df)
        elif self.method is 'fit':
            api = self.import_sklearn()
            self.required('dfx', req=True)
            self.required('dfy', req=True)
            dfx = self.inputs['dfx'].value
            dfy = self.inputs['dfy'].value
            api.fit(dfx, dfy)
            dfy_predict = api.predict(dfx)
            self.set_value('api', api)
            self.set_value('dfy_predict', dfy_predict)
            fn(self)
        elif self.method is 'predict':
            self.required('dfx', req=True)
            self.required('api', req=True)
            dfx = self.inputs['dfx'].value
            api = self.inputs['api'].value
            dfy_predict = api.predict(dfx)
            self.set_value('api', api)
            self.set_value('dfy_predict', dfy_predict)
            fn(self)
        self.Send()
        del self.inputs
