When 2 model performances are compared, each with their own validation file, through compare-model-performance
and no samples are present for a consequence for one of the 2 models, seaborn will throw an error stating that both hue levels must be present.
Violinplot only shows 1 hue. In the case that no samples are present, show plot with "no data" instead of no plot at all.
Traceback (most recent call last):
File "/home/robert/git/capice-resources/venv/bin/compare-model-performance", line 33, in <module>
sys.exit(load_entry_point('capice-resources', 'console_scripts', 'compare-model-performance')())
File "/home/robert/git/capice-resources/src/molgenis/capice_resources/compare_model_performance/__main__.py", line 367, in main
CompareModelPerformance().run()
File "/home/robert/git/capice-resources/src/molgenis/capice_resources/core/__init__.py", line 53, in run
output = self.run_module(args)
File "/home/robert/git/capice-resources/src/molgenis/capice_resources/compare_model_performance/__main__.py", line 174, in run_module
plots = plotter.plot(model_1, model_2)
File "/home/robert/git/capice-resources/src/molgenis/capice_resources/compare_model_performance/plotter.py", line 241, in plot
self._plot_consequences(merged_model_1_data, merged_model_2_data)
File "/home/robert/git/capice-resources/src/molgenis/capice_resources/compare_model_performance/plotter.py", line 311, in _plot_consequences
self._plot_score_dist(subset_m1, m1_samples, subset_m2, m2_samples, consequence)
File "/home/robert/git/capice-resources/src/molgenis/capice_resources/compare_model_performance/plotter.py", line 685, in _plot_score_dist
self._create_violinplot_for_column(
File "/home/robert/git/capice-resources/src/molgenis/capice_resources/compare_model_performance/plotter.py", line 880, in _create_violinplot_for_column
sns.violinplot(
File "/home/robert/git/capice-resources/venv/lib/python3.10/site-packages/seaborn/categorical.py", line 2305, in violinplot
plotter = _ViolinPlotter(x, y, hue, data, order, hue_order,
File "/home/robert/git/capice-resources/venv/lib/python3.10/site-packages/seaborn/categorical.py", line 920, in __init__
raise ValueError(msg)
ValueError: There must be exactly two hue levels to use `split`.
If applicable, add screenshots to help explain your problem.
Add any other context about the problem here.