From 1bc1069a1c79902c5f3313221609d3ac15254b79 Mon Sep 17 00:00:00 2001 From: Andrew Latham Date: Mon, 5 Aug 2024 13:46:23 -0700 Subject: [PATCH 1/3] Changed purity to precision Changed "purity" to "precision" in spatiotemporal, in line with the definition in the manuscript --- modules/spatiotemporal/README.md | 4 ++-- modules/spatiotemporal/pyext/src/analysis.py | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/modules/spatiotemporal/README.md b/modules/spatiotemporal/README.md index 6734c40acf..3c6b3c0234 100644 --- a/modules/spatiotemporal/README.md +++ b/modules/spatiotemporal/README.md @@ -87,8 +87,8 @@ labaled_pdf2_fn - labeled_pdf from another independent sampling output_fn - name of output file (default: 'temporal_precision.txt') -### purity(labeled_pdf_fn,output_fn) -Function that reads in one labeled_pdf from create_DAG and returns the purity, defined as the sum of the squared probability of all trajectories. +### precision(labeled_pdf_fn,output_fn) +Function that reads in one labeled_pdf from create_DAG and returns the precision, defined as the sum of the squared probability of all trajectories. labeled_pdf_fn - labeled_pdf from the total model diff --git a/modules/spatiotemporal/pyext/src/analysis.py b/modules/spatiotemporal/pyext/src/analysis.py index 4ed5bd2b86..c79050a3b6 100644 --- a/modules/spatiotemporal/pyext/src/analysis.py +++ b/modules/spatiotemporal/pyext/src/analysis.py @@ -78,16 +78,16 @@ def temporal_precision(labeled_pdf1_fn, labeled_pdf2_fn, print(precision) -def purity(labeled_pdf_fn, output_fn='purity.txt'): +def precision(labeled_pdf_fn, output_fn='precision.txt'): """ Function that reads in one labeled_pdf from create_DAG and returns the - purity, defined as the sum of the squared probability of all trajectories. + precision, defined as the sum of the squared probability of all trajectories. @param labeled_pdf_fn: string, labeled pdf file name (including the path); labeled_pdf from the total model @param output_fn: string, name of output file (default: 'temporal_precision.txt') - @return temporal purity, written to output_fn + @return temporal precision, written to output_fn """ # create blank dictonary to store the results prob_list = [] @@ -114,7 +114,7 @@ def purity(labeled_pdf_fn, output_fn='purity.txt'): for prob in prob_list: pure += prob * prob with open(output_fn, 'w') as new: - new.write('Purity of ' + labeled_pdf_fn + ':\n') + new.write('Precision of ' + labeled_pdf_fn + ':\n') new.write(str(pure)) - print('Purity of ' + labeled_pdf_fn) + print('Precision of ' + labeled_pdf_fn) print(str(pure)) From 17904518bdb5cf3cd3b56d2b0cab8f94040e0b57 Mon Sep 17 00:00:00 2001 From: Andrew Latham Date: Mon, 5 Aug 2024 13:50:38 -0700 Subject: [PATCH 2/3] Update analysis.py Updated for flake8 --- modules/spatiotemporal/pyext/src/analysis.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/spatiotemporal/pyext/src/analysis.py b/modules/spatiotemporal/pyext/src/analysis.py index c79050a3b6..3ddc2faffb 100644 --- a/modules/spatiotemporal/pyext/src/analysis.py +++ b/modules/spatiotemporal/pyext/src/analysis.py @@ -81,7 +81,8 @@ def temporal_precision(labeled_pdf1_fn, labeled_pdf2_fn, def precision(labeled_pdf_fn, output_fn='precision.txt'): """ Function that reads in one labeled_pdf from create_DAG and returns the - precision, defined as the sum of the squared probability of all trajectories. + precision, defined as the sum of the squared + probability of all trajectories. @param labeled_pdf_fn: string, labeled pdf file name (including the path); labeled_pdf from the total model From 34b88ac5ebecb94d9824979f2fc79b6192d851a8 Mon Sep 17 00:00:00 2001 From: Andrew Latham Date: Mon, 5 Aug 2024 13:52:37 -0700 Subject: [PATCH 3/3] Update analysis.py --- modules/spatiotemporal/pyext/src/analysis.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/spatiotemporal/pyext/src/analysis.py b/modules/spatiotemporal/pyext/src/analysis.py index 3ddc2faffb..18976feb24 100644 --- a/modules/spatiotemporal/pyext/src/analysis.py +++ b/modules/spatiotemporal/pyext/src/analysis.py @@ -81,7 +81,7 @@ def temporal_precision(labeled_pdf1_fn, labeled_pdf2_fn, def precision(labeled_pdf_fn, output_fn='precision.txt'): """ Function that reads in one labeled_pdf from create_DAG and returns the - precision, defined as the sum of the squared + precision, defined as the sum of the squared probability of all trajectories. @param labeled_pdf_fn: string, labeled pdf file name (including the path);