plot_cates_histogram

extensions.plots.plot_cates_histogram(estimated_cates, *, true_cates=None, figure_kwargs={}, hist_kwargs={})

Plots a histogram the estimated CATEs.

Parameters

Name Type Description Default
estimated_cates numpy.typing.ArrayLike The estimated CATEs. required
true_cates numpy.typing.ArrayLike | None The true CATEs. None
figure_kwargs dict Matplotlib figure arguments. {}
hist_kwargs dict Matplotlib hist arguments. {}

Returns

Type Description
matplotlib.figure.Figure The histogram figure object.

Examples

import numpy as np
from caml.extensions.plots import plot_cates_histogram

np.random.seed(42)
true_cates = np.random.normal(0, 1, 1000)
estimated_cates = true_cates + np.random.normal(0, 0.5, 1000)

fig = plot_cates_histogram(estimated_cates, true_cates=true_cates, hist_kwargs={'bins': 25})
fig

Back to top