def validate(self):
        '''@validate

        This method validates the SVM settings for the 'data_new',
        'data_append', 'model_generate', or 'model_predict' sessions.

        Note: This method does not validate the associated 'file upload(s)'.
              The latter is validated via 'validate_file_extension.py', and
              'validate_dataset.py'.

        '''

        # local variables
        list_error = []

        # validation on 'data_new' session
        if self.svm_session == 'data_new':
            try:
                validate = Draft4Validator(jsonschema_data_new())
                validate.validate(self.svm_settings)
            except Exception, error:
                list_error.append(str(error))

        # validation on 'data_append' session
        if self.svm_session == 'data_append':
            try:
                validate = Draft4Validator(jsonschema_data_append())
                validate.validate(self.svm_settings)
            except Exception, error:
                list_error.append(str(error))

        # validation on 'model_generate' session
        if self.svm_session == 'model_generate':
            try:
                validate = Draft4Validator(jsonschema_model_generate())
                validate.validate(self.svm_settings)
            except Exception, error:
                list_error.append(str(error))

        # validation on 'model_predict' session
        elif self.svm_session == 'model_predict':
            try:
                validate = Draft4Validator(jsonschema_model_predict())

                int(self.svm_settings['svm_model_id'])
                for value in self.svm_settings['prediction_input[]']:
                    float(value)

                validate.validate(self.svm_settings)
            except Exception, error:
                list_error.append(str(error))

        # return error
        if 0 > len(list_error):
            return {'status': False, 'error': list_error}
        else:
            return {'status': True, 'error': None}
dataset/ETHPy150Open jeff1evesque/machine-learning/brain/validator/validate_settings.py/Validate_Settings.validate/swapped operands of `>`