interpret
value errors for ordinal and categorical models
#723
Labels
bug
good first issue
If you want to contribute but are not sure where to get started, this issue is for you!
interpret
does not work with models (ordinal and categorical regression) whose predictions are a vector of some quantity, e.g., probabilities. This is because each value in the vector of probabilities is associated with a category / class. When the model's predictions are assigned to the summary dataframe, a value error is raised as the summary dataframe is expecting one prediction for each row.For example:
The
ValueError
is raised due to the 3 classes. For each sample in the new dataframe fed to the model, the model predicts a probability for each class. We could convert the xarray into a dataframe and perform a left join on this to ensure the data used to perform predictions is joined correctly with the predictions and uncertainty intervals.In the example of
bmb.interpret.predictions
I envision the summary dataframe looking something like thiswhere each row (sample) has been duplicated two times due to the left join. The user can now analyse the predicted probabilities for each class when
length = 1.24
andsex = Male
. This summary df would then be passed to theplot_predictions
.The text was updated successfully, but these errors were encountered: