import matplotlib.pyplot as plt import time from evaluation import TotalResults, SampleResult from input_output import get_pkls_from_directory, get_attributes_from_foldername, save_results, load_results """ IMPORTANT!!! SET GEPARD TO EVALUATION BRANCH (WITHOUT THE TILING STUFF), OTHERWISE SOME OF THE LEGACY CONVERTS MIGHT FAIL.. """ # results: TotalResults = TotalResults() # pklsInFolders = get_pkls_from_directory(r'C:\Users\xbrjos\Desktop\temp MP\NewDatasets') # # for folder in pklsInFolders.keys(): # for samplePath in pklsInFolders[folder]: # newSampleResult: SampleResult = results.add_sample(samplePath) # for attr in get_attributes_from_foldername(folder): # newSampleResult.set_attribute(attr) # # t0 = time.time() # results.update_all() # print('updating all took', time.time()-t0, 'seconds') # # save_results('results1.res', results) results: TotalResults = load_results('results1.res') errorPerFraction: dict = results.get_error_vs_fraction_data(methods=['spiral', 'cross']) plt.clf() for methodLabel in errorPerFraction.keys(): fractions: list = list(errorPerFraction[methodLabel].keys()) errors: list = list(errorPerFraction[methodLabel].values()) plt.plot(fractions, errors, label=methodLabel) plt.title('Spiral or Box Layouts') plt.xscale('log') plt.xlabel('measured fraction') plt.ylabel('mpCountError') plt.legend() plt.show()