Where
The error occurs in the statistics phase, when the ground_truth_label contains a / in the name like: ground_truth_label: "Parameter(0=mod/well,1=poor)"
What happens
When pathlib constructs the path output_dir / "roc-curve_Parameter(0=mod/well,1=poor)=0.svg", the / inside the string is treated as a directory separator.
It tries to open a file inside a non-existent subdirectory roc-curve_Parameter(0=mod/.
Possible fix:
- Don't allow a
/ in the ground_truth_label setting and raise an error in every phase
- Fix all save or export code lines and replace the
/ with another character like _
In the statistics phase it applies to the following lines of code:
-
|
output_dir / f"roc-curve_{ground_truth_label}={true_class}.svg" |
-
|
output_dir / f"pr-curve_{ground_truth_label}={true_class}.svg" |
-
|
preds_df.to_csv(outpath / f"{ground_truth_label}_categorical-stats_individual.csv") |
-
|
stats_df.to_csv(outpath / f"{ground_truth_label}_categorical-stats_aggregated.csv") |
Where
The error occurs in the
statisticsphase, when the ground_truth_label contains a/in the name like:ground_truth_label: "Parameter(0=mod/well,1=poor)"What happens
When pathlib constructs the path
output_dir / "roc-curve_Parameter(0=mod/well,1=poor)=0.svg", the/inside the string is treated as a directory separator.It tries to open a file inside a non-existent subdirectory
roc-curve_Parameter(0=mod/.Possible fix:
/in the ground_truth_label setting and raise an error in every phase/with another character like_In the statistics phase it applies to the following lines of code:
STAMP/src/stamp/statistics/__init__.py
Line 295 in c54ce06
STAMP/src/stamp/statistics/__init__.py
Line 324 in c54ce06
STAMP/src/stamp/statistics/categorical.py
Line 140 in c54ce06
STAMP/src/stamp/statistics/categorical.py
Line 142 in c54ce06