def main(self): shutil.rmtree("./log/", ignore_errors=True) obj_for_afm_dafm = afm_data_generator(self.args) data_for_afm_dafm = obj_for_afm_dafm.main() predictions = [] if (not self.args.afm[0] == None): for index, data in enumerate(data_for_afm_dafm): ###print ("testing", index) if index == 0: predictions.append(self.fit_predict_afm(data[0], data[1], data[2], data[3], data[4])) else: if self.args.dafm[1] == "Yes": predictions.append(self.fit_predict_batch_dafm(data[0], data[1])) else: predictions.append(self.fit_predict_dafm(data[0], data[1], data[2], data[3], data[4], data[5], data[6], data[7], data[8])) elif (not self.args.dafm[0] == None): for data in data_for_afm_dafm: if self.args.dafm[1] == "Yes": predictions.append(self.fit_predict_batch_dafm(data[0], data[1])) else: predictions.append(self.fit_predict_dafm(data[0], data[1], data[2], data[3], data[4], data[5], data[6], data[7], data[8])) else: for data in data_for_afm_dafm: predictions.append(self.fit_predict_dkt(data[0], data[1], data[2], data[3], data[4], data[5], data[6], data[7])) print (predictions) outfile = open(workingDir + "output.txt", 'a') outfile.write (str(predictions) + "\n") outfile.close()
def main(self): shutil.rmtree(self.args.source_path + self.args.dataset[0] + "log/", ignore_errors=True) obj_for_afm_dafm = afm_data_generator(self.args) data_for_afm_dafm = obj_for_afm_dafm.main() predictions = [] if (not self.args.afm[0] == None): for index, data in enumerate(data_for_afm_dafm): print("testing", index) if index == 0: predictions.append( self.fit_predict_afm(data[0], data[1], data[2], data[3], data[4])) else: if self.args.dafm[1] == "Yes": predictions.append( self.fit_predict_batch_dafm(data[0], data[1])) else: predictions.append( self.fit_predict_dafm(data[0], data[1], data[2], data[3], data[4], data[5], data[6], data[7], data[8])) elif (not self.args.dafm[0] == None): for data in data_for_afm_dafm: if self.args.dafm[1] == "Yes": predictions.append( self.fit_predict_batch_dafm(data[0], data[1])) else: predictions.append( self.fit_predict_dafm(data[0], data[1], data[2], data[3], data[4], data[5], data[6], data[7], data[8])) else: for data in data_for_afm_dafm: predictions.append( self.fit_predict_dkt(data[0], data[1], data[2], data[3], data[4], data[5], data[6], data[7])) print(predictions)