Skip to content
This repository has been archived by the owner on Nov 11, 2024. It is now read-only.

Commit

Permalink
more bins in dvc hists and new plots in 3d models
Browse files Browse the repository at this point in the history
  • Loading branch information
TimOliverMaier committed Sep 22, 2022
1 parent 88089ef commit 709387a
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pipelines/pipe_A/plot_templates/histogram_template.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
},
"encoding": {
"x": {
"bin": true,
"bin": {"maxbins":50},
"field": "<DVC_METRIC_Y>",
"title": "<DVC_METRIC_Y_LABEL>"
},
Expand Down
37 changes: 37 additions & 0 deletions src/pystoms/models_3d/abstract_3d.py
Original file line number Diff line number Diff line change
Expand Up @@ -481,6 +481,43 @@ def arviz_plots(
else:
plt.show()

# posterior predictive lm
az.plot_lm(y=idata_sliced.observed_data.obs,
y_hat=idata_sliced.posterior_predictive.obs,
num_samples=500)
if save_fig:
plt.savefig(feature_path + "posterior_predictive_lm.png")
plt.close()
else:
plt.show()

# prior predictive lm
fig,ax = plt.subplots(1,1)
az.plot_lm(y=idata_sliced.observed_data.obs,
y_hat=idata_sliced.prior_predictive.obs,
num_samples=500,
legend=False,
axes=ax)
h,l = ax.get_legend_handles_labels()
for idx,lab in enumerate(l):
if lab == "Posterior predictive samples":
l[idx] = "Prior predictive samples"
ax.legend(h,l)
if save_fig:
fig.savefig(feature_path + "prior_predictive_lm.png")
fig.close()
else:
fig.show()

az.plot_parallel(idata_sliced,norm_method="minmax")
if save_fig:
fig.savefig(feature_path + "plot_parallel.png")
fig.close()
else:
fig.show()



def evaluation(
self,
prior_pred_in: bool = True,
Expand Down

0 comments on commit 709387a

Please sign in to comment.