Skip to content

Commit

Permalink
Change order of datasets in bar chart
Browse files Browse the repository at this point in the history
  • Loading branch information
mariya committed Nov 14, 2024
1 parent d167760 commit c13352e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/conformist/prediction_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,10 @@ def visualize_class_counts_by_dataset(self):
axs = [axs]

# Group by the first level of the index (dataset) and count the number of unique classes
grouped_ccs = ccs.groupby(level=0).apply(lambda x: x.index.get_level_values(1).nunique())
# grouped_ccs = ccs.groupby(level=0).apply(lambda x: x.index.get_level_values(1).nunique())

# No, not number of classes, but sum of their values
grouped_ccs = ccs.groupby(level=0).sum()

# Order datasets by number of unique classes
ordered_datasets = grouped_ccs.sort_values(ascending=False).index
Expand Down

0 comments on commit c13352e

Please sign in to comment.