Predictive model comparison

Predictive model comparison#

Compare multiple models using predictive accuracy estimated using PSIS-LOO-CV. Usually the DataFrame cmp_df is generated using ArviZ’s ```compare` function.

Matplotlib version of plot_compare

Link to this page with the bokeh tab selected

Link to this page with the plotly tab selected

import pandas as pd

import arviz_plots as azp

azp.style.use("arviz-variat")


cmp_df = pd.DataFrame({"elpd": [-4.5, -14.3, -16.2], 
                       "p": [2.6, 2.3, 2.1], 
                       "elpd_diff": [0, 9.7, 11.3], 
                       "weight": [0.9, 0.1, 0], 
                       "se": [2.3, 2.7, 2.3], 
                       "dse": [0, 2.7, 2.3], 
                       "warning": [False, False, False], 
                       },
                       index=["Model B", "Model A", "Model C"])

pc = azp.plot_compare(cmp_df,
                      backend="none",  # change to preferred backend
                      )
pc.show()

See also

API Documentation: plot_compare

Other examples with plot_compare#