urbanlc.analyze.visualizer.plot_class_distribution#
- urbanlc.analyze.visualizer.plot_class_distribution(data: ndarray, normalize: Optional[bool] = True, outfile: Optional[str] = None, figsize: Optional[Tuple[int]] = (6, 3)) None #
Plot the class distribution based on input labels.
This function takes input data, flattens it, and plots the class distribution using a bar plot. If normalization is specified, the distribution is normalized. The plot can be saved to a file if an output file path is provided. The function does not return any values.
- Parameters:
data (numpy.ndarray) – Input data for which the class distribution is to be plotted.
normalize (bool, optional) – If True, normalize the class distribution such that the sum is 1.0. Defaults to True.
outfile (str, optional) – File path to save the plot. If None, the plot is not saved. Defaults to None.
figsize (tuple, optional) – Size of the plot figure. Defaults to (6, 3).
- Returns:
None
- Return type:
None