causalkit.eda.eda.CausalEDA.outcome_plots#
- CausalEDA.outcome_plots(treatment=None, target=None, bins=30, density=True, alpha=0.5, figsize=(7, 4), sharex=True)[source]#
Plot the distribution of the outcome for every treatment on one plot, and also produce a boxplot by treatment to visualize outliers.
- Parameters:
treatment (Optional[str]) – Treatment column name. Defaults to the treatment stored in the CausalEDA data.
target (Optional[str]) – Target/outcome column name. Defaults to the outcome stored in the CausalEDA data.
bins (int) – Number of bins for histograms when the outcome is numeric.
density (bool) – Whether to normalize histograms to form a density.
alpha (float) – Transparency for overlaid histograms.
figsize (tuple) – Figure size for the plots.
sharex (bool) – If True and the outcome is numeric, use the same x-limits across treatments.
- Returns:
(fig_distribution, fig_boxplot)
- Return type:
Tuple[matplotlib.figure.Figure, matplotlib.figure.Figure]