def load_data_new(self):

        # instantiate class
        session = Data_New(self.data)

        # implement class methods
        if not session.validate_arg_none():
            session.validate_svm_settings()
            session.validate_mime_type()
            session.check()

            session_entity = session.save_svm_entity('data_new')
            if session_entity['status']:
                session_id = session_entity['id']
                session.validate_id(session_id)
                session.check()

                session.dataset_to_dict(session_id)
                session.check()
                session.save_svm_info()
                session.check()

                session.save_observation_label('data_new', session_id)
                session.check()

                session.save_svm_dataset()
                session.check()

            return 'Dataset(s) properly uploaded into database'
        else:
            print session.get_errors()
            return None
Пример #2
0
    def load_data_new(self):
        '''

        This method validates the supplied parameters, before being stored as
        new entries, into corresponding tables in the SQL database.

        '''

        # instantiate class
        session = Data_New(self.data)

        # implement class methods
        if not session.validate_arg_none():
            session.validate_premodel_settings()
            session.validate_file_extension()
            session.check()

            session_entity = session.save_entity('data_new')
            if session_entity['status']:
                session_id = session_entity['id']
                session.validate_id(session_id)
                session.check()

                session.dataset_to_dict(session_id)
                session.check()
                session.save_feature_count()
                session.check()

                session.save_observation_label('data_new', session_id)
                session.check()

                session.save_premodel_dataset()
                session.check()

            response = {
                'status': 0,
                'msg': 'Dataset(s) properly uploaded into database',
                'type': 'data-new'
            }

        else:
            print session.get_errors()
            response = {
                'status': 1,
                'msg': 'Dataset(s) not uploaded into database',
                'type': 'data-new'
            }

        return json.dumps(response)
Пример #3
0
    def load_data_new(self):

        '''@load_data_new

        This method validates the supplied parameters, before being stored as
        new entries, into corresponding tables in the SQL database.

        '''

        # instantiate class
        session = Data_New(self.data)

        # implement class methods
        if not session.validate_arg_none():
            session.validate_premodel_settings()
            session.validate_file_extension()
            session.check()

            session_entity = session.save_entity('data_new')
            if session_entity['status']:
                session_id = session_entity['id']
                session.validate_id(session_id)
                session.check()

                session.dataset_to_dict(session_id)
                session.check()
                session.save_feature_count()
                session.check()

                session.save_observation_label('data_new', session_id)
                session.check()

                session.save_premodel_dataset()
                session.check()

            return 'Dataset(s) properly uploaded into database'
        else:
            print session.get_errors()
            return None
Пример #4
0
    def load_data_new(self):
        """@load_data_new

        This method validates the supplied parameters, before being stored as
        new entries, into corresponding tables in the SQL database.

        """

        # instantiate class
        session = Data_New(self.data)

        # implement class methods
        if not session.validate_arg_none():
            session.validate_svm_settings()
            session.validate_file_extension()
            session.check()

            session_entity = session.save_svm_entity('data_new')
            if session_entity['status']:
                session_id = session_entity['id']
                session.validate_id(session_id)
                session.check()

                session.dataset_to_dict(session_id)
                session.check()
                session.save_svm_info()
                session.check()

                session.save_observation_label('data_new', session_id)
                session.check()

                session.save_svm_dataset()
                session.check()

            return 'Dataset(s) properly uploaded into database'
        else:
            print session.get_errors()
            return None