Exemplo n.º 1
0
 def prepareEnvironment(self):
     # People want to save time
     testingPath = os.path.join(data_io.get_testing_folder(),
                                data_io.get_test_folder())
     testingPathOld = os.path.join(data_io.get_testing_old_folder(),
                                   data_io.get_test_folder())
     Utils.shift(data_io.get_testing_old_folder(), testingPathOld,
                 data_io.get_test_folder(), testingPath)
     os.mkdir(testingPath)
     if not self.load:
         Utils.shift('.', data_io.get_savez_name_test(),
                     data_io.get_savez_name_test(),
                     data_io.get_savez_name_test())
     if not self.loadWndchrm:
         Utils.shift('.', data_io.get_wndchrm_dataset_test(),
                     data_io.get_wndchrm_dataset_test(),
                     data_io.get_wndchrm_dataset_test())
Exemplo n.º 2
0
 def executeWndchrm(self, namesObservations):
     #wndchrm classify -Ttestset.fit dataset.fit folder
     testingFolder = os.path.join(data_io.get_testing_folder(), data_io.get_test_folder())
     command = ["wndchrm", "classify", "-T%s" %(data_io.get_wndchrm_datafit_test()) , 
                data_io.get_wndchrm_datafit(), testingFolder]
     subprocess.call(" ".join(command), shell=True)
     valid = self.parseWndchrmOutput()
     outfile = open(data_io.get_wndchrm_dataset_test(), "wb")
     np.savez(outfile, valid=valid, namesObservations=namesObservations)
     return valid
Exemplo n.º 3
0
 def loadWndchrmFeatures(self):
     outfile = open(data_io.get_wndchrm_dataset_test(), "rb")
     npzfile = np.load(outfile)
     valid = npzfile['valid']
     return valid