Skip to content

Commit

Permalink
Merge branch 'verbose' into convergence
Browse files Browse the repository at this point in the history
  • Loading branch information
martinju committed Oct 2, 2024
2 parents a02c9c9 + 91de6ec commit fde5a3e
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ Suggests:
ranger,
xgboost,
mgcv,
testthat (>= 3.0.0),
testthat,
knitr,
rmarkdown,
roxygen2,
Expand Down
2 changes: 1 addition & 1 deletion R/finalize_explanation.R
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ iter_list_to_dt <- function(iter_list, what = c(
"est_required_coalitions", "est_remaining_coalitions"
)) {
extracted <- lapply(iter_list, function(x) x[what])
ret <- do.call(rbind, lapply(extracted, as.data.table))
ret <- do.call(rbindlist, list(l=lapply(extracted, as.data.table),fill=TRUE))
return(ret)
}

Expand Down
12 changes: 8 additions & 4 deletions vignettes/understanding_shapr.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -943,7 +943,8 @@ MSEv_plots <- plot_MSEv_eval_crit(explanation_list_named,

# 5 plots are made
names(MSEv_plots)
#> [1] "MSEv_explicand_bar" "MSEv_explicand_line_point" "MSEv_coalition_bar" "MSEv_coalition_line_point" "MSEv_bar"
#> [1] "MSEv_explicand_bar" "MSEv_explicand_line_point" "MSEv_coalition_bar" "MSEv_coalition_line_point"
#> [5] "MSEv_bar"
```
The main plot if interest is the `MSEv_bar`, which displays the $\operatorname{MSE}_{v}$ evaluation criterion for each method averaged over both the combinations/coalitions and test observations/explicands. However, we can also look at the other plots where
we have only averaged over the observations or the combinations (both as bar and line plots).
Expand Down Expand Up @@ -1768,10 +1769,9 @@ ex_further <- explain(
)
#> Note: Feature classes extracted from the model contains NA.
#> Assuming feature classes from the data are correct.
#> Error in rbindlist(l, use.names, fill, idcol): Item 3 has 10 columns, inconsistent with item 1 which has 11 columns. To fill missing columns use fill=TRUE.

print(ex_further$internal$parameters$adaptive_arguments$saving_path)
#> [1] "/tmp/RtmpMe6y80/shapr_obj_2cd2e287d6d35.rds"
#> [1] "/tmp/RtmpoIJVki/shapr_obj_9f92c1daf800a.rds"

# Using the ex_init object to continue the computation for the remaining coalition samples
# but this time using the path to the saved intermediate estimation object
Expand All @@ -1784,7 +1784,11 @@ ex_even_further <- explain(
max_n_coalitions = NULL,
prev_shapr_object = ex_further$internal$parameters$adaptive_arguments$saving_path
)
#> Error in gzfile(file, "rb"): cannot open the connection
#> Note: Feature classes extracted from the model contains NA.
#> Assuming feature classes from the data are correct.
#> Success with message:
#> max_n_coalitions is NULL or larger than or 2^n_features = 32,
#> and is therefore set to 2^n_features = 32.
```

## Explaining a forecasting model using `explain_forecast`
Expand Down

0 comments on commit fde5a3e

Please sign in to comment.