MCPcopy Create free account
hub / github.com/Riley702/enhanced_benchmark_tool / plot_class_distribution

Function plot_class_distribution

src/visualizations.py:125–140  ·  view source on GitHub ↗

Plots the distribution of class labels in a dataset. Args: y (array-like): Target labels.

(y)

Source from the content-addressed store, hash-verified

123
124
125def plot_class_distribution(y):
126 """
127 Plots the distribution of class labels in a dataset.
128
129 Args:
130 y (array-like): Target labels.
131 """
132 unique, counts = np.unique(y, return_counts=True)
133
134 plt.figure(figsize=(8, 5))
135 plt.bar(unique.astype(str), counts, color="salmon")
136 plt.xlabel("Class Labels")
137 plt.ylabel("Frequency")
138 plt.title("Class Distribution")
139 plt.grid(axis="y", linestyle="--", alpha=0.7)
140 plt.show()
141
142
143def plot_correlation_matrix(df):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected