示例#1
0
    def find_all(self):
        session = Session()

        query = [self.get_as_list(entry) for entry in session.query(TrainingFeatureSelected).all()]
        training_feature_selected = pd.DataFrame(query, columns=self.columns_header)
        print(len(training_feature_selected))

        session.close()
        return training_feature_selected
    def find_all(self):
        session = Session()

        query = [
            self.get_as_list(entry)
            for entry in session.query(TestFeatureExtracted).all()
        ]
        test_feature_extracted = pd.DataFrame(query,
                                              columns=self.columns_header)
        print(len(test_feature_extracted))

        session.close()
        return test_feature_extracted
示例#3
0
    def insert_all(self):
        session = Session()

        test_file = pd.read_csv(self.test_feature_selected_file_location, sep=",", usecols=self.columns_header,
                                index_col=None)
        test_data = np.array(test_file.values[:, :len(self.columns_header)])
        for test in test_data:
            test = test.reshape(1, len(self.columns_header))
            test_entity = TrainingFeatureSelected(
                test[0][0],
                test[0][1],
                test[0][2],
                test[0][3],
                test[0][4],
                test[0][5],
                test[0][6],
                test[0][7],
                test[0][8],
                test[0][9],
                test[0][10],
                test[0][11],
                test[0][12],
                test[0][13],
                test[0][14],
                test[0][15],
                test[0][16],
            )
            session.add(test_entity)

        session.commit()
        session.close()
    def insert_all(self):
        session = Session()

        test_file = pd.read_csv(self.test_feature_extracted_file_location,
                                sep=",",
                                usecols=self.columns_header,
                                index_col=None)
        test_data = np.array(test_file.values[:, :4])
        for test in test_data:
            test = test.reshape(1, 4)
            test_entity = TestFeatureExtracted(test[0][0], test[0][1],
                                               test[0][2], test[0][3])
            session.add(test_entity)

        session.commit()
        session.close()