pat2vec.util.evaluation_methods_ploting

Functions

generate_pie_charts(all_batch_annots[, ...])

Generates and saves pie charts of annotation distributions for each client.

pat2vec.util.evaluation_methods_ploting.generate_pie_charts(all_batch_annots, save_plots=True, types=None)[source]

Generates and saves pie charts of annotation distributions for each client.

For each unique client_idcode in the input DataFrame, this function creates pie charts summarizing the distribution of pretty_name for annotations. It generates one chart for all annotation types combined and separate charts for each type specified in the types list.

To improve readability, concepts in the bottom 25th percentile by count are grouped into an “other” category.

Parameters:
  • all_batch_annots (DataFrame) – DataFrame containing annotation data with columns like ‘client_idcode’, ‘pretty_name’, and ‘types’.

  • save_plots (bool) – If True, saves the charts as PNG files in a local ‘plot_outputs_folder_piechart’ directory.

  • types (Optional[List[str]]) – A list of annotation types (e.g., “[‘disorder’]”) to generate separate pie charts for. Defaults to a predefined list of common types.

Return type:

None