Skip to content

Commit

Permalink
Function description added
Browse files Browse the repository at this point in the history
  • Loading branch information
lim185 committed Sep 30, 2025
1 parent 92092c3 commit fe00fc6
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion visualize/visualize.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,15 @@
import matplotlib.pyplot as plt

def visualize_data_distribution(data: DataFrame) -> None:
"""
Visualize the distribution of treatment and target categories in the
dataset.
Args:
data (DataFrame): The input DataFrame containing treatment and target
columns.
"""

for category in ["treatment", "target"]:
select = data.select(category) \
.groupby(category) \
Expand All @@ -18,7 +27,8 @@ def visualize_data_distribution(data: DataFrame) -> None:
.squeeze())
plt.xlabel("Count")
plt.ylabel(category)
plt.savefig(f"{category}_counts.png", bbox_inches="tight")
plt.savefig(f"/app/workdir/figures/{category}_counts.png",
bbox_inches="tight")
plt.close()

# EOF

0 comments on commit fe00fc6

Please sign in to comment.