src.explore.summary.plot_hierarchical_labels

plot_hierarchical_labels(all_data, label_type, label_level, plot=True, fig_size=(15, 7))[source]

Bar plots for hierarchical labels.

0 is the least granular level while 3 is the most granular level.

Parameters
  • all_data – Dictionary of numpy arrays which contains all data.

  • label_type – Can be “train” or “test”.

  • label_level – Integer denoting the label level. Possible values are 0, 1, 2 and 3.

  • plot – If True, plots the graph. Else, returns the label array.

  • fig_size (optional) – The size of the plot.

Returns

A numpy array with labels of the given level.

Return type

np.ndarray

Raises

ValueError – If label_level is not 0, 1, 2, or 3.

Return type

ndarray