diff --git a/scripts/shapeembed/efd.py b/scripts/shapeembed/efd.py index 9b9525f8..b6924ba3 100755 --- a/scripts/shapeembed/efd.py +++ b/scripts/shapeembed/efd.py @@ -86,9 +86,10 @@ def run_elliptic_fourier_descriptors(dataset, contour_size, logger): efd_df.to_csv(f"{clargs.output_dir}/{dataset.name}-efd-raw_df.csv") umap_plot(efd_df, f'{dataset.name}-efd', outputdir=clargs.output_dir) - efd_cm, efd_score_df = score_dataframe(efd_df, 'efd') + efd_cms, efd_score_df = score_dataframe(efd_df, 'efd') logger.info(f'-- efd on {dataset.name}, score\n{efd_score_df}') efd_score_df.to_csv(f"{clargs.output_dir}/{dataset.name}-efd-score_df.csv") - logger.info(f'-- confusion matrix:\n{efd_cm}') - confusion_matrix_plot(efd_cm, f'{dataset.name}-efd', clargs.output_dir) + for kind, efd_cm in efd_cms.items(): + logger.info(f'-- {kind} confusion matrix:\n{efd_cm}') + confusion_matrix_plot(efd_cm, f'{dataset.name}-{kind}-efd', clargs.output_dir) diff --git a/scripts/shapeembed/regionprops.py b/scripts/shapeembed/regionprops.py index a2325c86..063769da 100755 --- a/scripts/shapeembed/regionprops.py +++ b/scripts/shapeembed/regionprops.py @@ -91,9 +91,10 @@ def run_regionprops( dataset regionprops_df.to_csv(f"{clargs.output_dir}/{dataset.name}-regionprops-raw_df.csv") umap_plot(regionprops_df, f'{dataset.name}-regionprops', outputdir=clargs.output_dir) - regionprops_cm, regionprops_score_df = score_dataframe(regionprops_df, 'regionprops') + regionprops_cms, regionprops_score_df = score_dataframe(regionprops_df, 'regionprops') logger.info(f'-- regionprops on {dataset.name}, score\n{regionprops_score_df}') regionprops_score_df.to_csv(f"{clargs.output_dir}/{dataset.name}-regionprops-score_df.csv") - logger.info(f'-- confusion matrix:\n{regionprops_cm}') - confusion_matrix_plot(regionprops_cm, f'{dataset.name}-regionprops', clargs.output_dir) + for kind, regionprops_cm in regionprops_cms.items(): + logger.info(f'-- {kind} confusion matrix:\n{regionprops_cm}') + confusion_matrix_plot(regionprops_cm, f'{dataset.name}-{kind}-regionprops', clargs.output_dir)