From cad771d377baf0fe33284f30891d25b1cd3263a2 Mon Sep 17 00:00:00 2001 From: Phil Tooley Date: Tue, 23 Apr 2019 15:46:41 +0100 Subject: [PATCH] add R^2 to validation tool --- benchmarking/pfire_benchmarking/validate.py | 14 +++++++------- benchmarking/setup.py | 2 ++ 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/benchmarking/pfire_benchmarking/validate.py b/benchmarking/pfire_benchmarking/validate.py index 212c91b..295edf3 100644 --- a/benchmarking/pfire_benchmarking/validate.py +++ b/benchmarking/pfire_benchmarking/validate.py @@ -193,14 +193,14 @@ def main(): shirt_map = fio.load_map(shirt_result.map_path)[0][0:3] pfire_map = load_pfire_map(pfire_result.map_path) - print("Map correlation coefficients, per dimension:") + print("Map coefficients of determination (R^2), per dimension:") plt.plot(shirt_map[0].flatten(), marker='x', ls='none', label="ShIRT") plt.plot(pfire_map[0].flatten(), marker='+', ls='none', label="pFIRE") corr_info = sps.linregress(shirt_map[0].flatten(), pfire_map[0].flatten()) - print("X: {:0.3}".format(corr_info[2])) - plt.title("Map X component, R={:0.3}".format(corr_info[2])) + print("X: {:0.3}".format(corr_info[2]**2)) + plt.title("Map X component, R^2={:0.3}".format(corr_info[2]**2)) plt.legend() plt.savefig("{}_map_x.png".format(os.path.splitext(args.pfire_config)[0])) plt.close() @@ -208,8 +208,8 @@ def main(): plt.plot(shirt_map[1].flatten(), marker='x', ls='none', label="ShIRT") plt.plot(pfire_map[1].flatten(), marker='+', ls='none', label="pFIRE") corr_info = sps.linregress(shirt_map[1].flatten(), pfire_map[1].flatten()) - plt.title("Map Y component, R={:0.3}".format(corr_info[2])) - print("Y: {:0.3}".format(corr_info[2])) + plt.title("Map Y component, R^2={:0.3}".format(corr_info[2]**2)) + print("Y: {:0.3}".format(corr_info[2]**2)) plt.legend() plt.savefig("{}_map_y.png".format(os.path.splitext(args.pfire_config)[0])) plt.close() @@ -217,8 +217,8 @@ def main(): plt.plot(shirt_map[2].flatten(), marker='x', ls='none', label="ShIRT") plt.plot(pfire_map[2].flatten(), marker='+', ls='none', label="pFIRE") corr_info = sps.linregress(shirt_map[2].flatten(), pfire_map[2].flatten()) - plt.title("Map Z component, R={:0.3}".format(corr_info[2])) - print("Z: {:0.3}".format(corr_info[2])) + plt.title("Map Z component, R^2={:0.3}".format(corr_info[2]**2)) + print("Z: {:0.3}".format(corr_info[2]**2)) plt.legend() plt.savefig("{}_map_z.png".format(os.path.splitext(args.pfire_config)[0])) plt.close() diff --git a/benchmarking/setup.py b/benchmarking/setup.py index fcbec8f..1ade5d4 100644 --- a/benchmarking/setup.py +++ b/benchmarking/setup.py @@ -10,6 +10,8 @@ url='insigneo.org', packages=find_packages(''), include_package_data=True, + install_requires=['numpy', 'scipy', 'h5py', 'matplotlib', 'flannel', + 'configObj'], entry_points={ 'console_scripts': [ 'pfire-shirt-compare = pfire_benchmarking.validate:main',