Skip to content

Commit 74fe9d0

Browse files
committed
Updated efd and regionprops to match the new score_df return type (linear + randomforest)
1 parent c9c197e commit 74fe9d0

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

scripts/shapeembed/efd.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,9 +86,10 @@ def run_elliptic_fourier_descriptors(dataset, contour_size, logger):
8686
efd_df.to_csv(f"{clargs.output_dir}/{dataset.name}-efd-raw_df.csv")
8787
umap_plot(efd_df, f'{dataset.name}-efd', outputdir=clargs.output_dir)
8888

89-
efd_cm, efd_score_df = score_dataframe(efd_df, 'efd')
89+
efd_cms, efd_score_df = score_dataframe(efd_df, 'efd')
9090

9191
logger.info(f'-- efd on {dataset.name}, score\n{efd_score_df}')
9292
efd_score_df.to_csv(f"{clargs.output_dir}/{dataset.name}-efd-score_df.csv")
93-
logger.info(f'-- confusion matrix:\n{efd_cm}')
94-
confusion_matrix_plot(efd_cm, f'{dataset.name}-efd', clargs.output_dir)
93+
for kind, efd_cm in efd_cms.items():
94+
logger.info(f'-- {kind} confusion matrix:\n{efd_cm}')
95+
confusion_matrix_plot(efd_cm, f'{dataset.name}-{kind}-efd', clargs.output_dir)

scripts/shapeembed/regionprops.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,9 +91,10 @@ def run_regionprops( dataset
9191
regionprops_df.to_csv(f"{clargs.output_dir}/{dataset.name}-regionprops-raw_df.csv")
9292
umap_plot(regionprops_df, f'{dataset.name}-regionprops', outputdir=clargs.output_dir)
9393

94-
regionprops_cm, regionprops_score_df = score_dataframe(regionprops_df, 'regionprops')
94+
regionprops_cms, regionprops_score_df = score_dataframe(regionprops_df, 'regionprops')
9595

9696
logger.info(f'-- regionprops on {dataset.name}, score\n{regionprops_score_df}')
9797
regionprops_score_df.to_csv(f"{clargs.output_dir}/{dataset.name}-regionprops-score_df.csv")
98-
logger.info(f'-- confusion matrix:\n{regionprops_cm}')
99-
confusion_matrix_plot(regionprops_cm, f'{dataset.name}-regionprops', clargs.output_dir)
98+
for kind, regionprops_cm in regionprops_cms.items():
99+
logger.info(f'-- {kind} confusion matrix:\n{regionprops_cm}')
100+
confusion_matrix_plot(regionprops_cm, f'{dataset.name}-{kind}-regionprops', clargs.output_dir)

0 commit comments

Comments
 (0)