Skip to content

Commit

Permalink
Fix R devel notes (#389)
Browse files Browse the repository at this point in the history
* Enabling the MSEv criterion in the explain function for python wrapper

* Update the examples to upack the `MSEv` criterion from the call to `explain()`.

* Added `MSEv_uniform_comb_weights` as a parameter

* Corrected the documentation.

* Add something and ...

* then remove it to make github check tests again.

* running all examples and adding MSEv to them

* fix R CMD check notes from R-devel

* fix names

* last_epoch -> last_state

* Update R/approach_vaeac_torch_modules.R

---------

Co-authored-by: LHBO <[email protected]>
  • Loading branch information
martinju and LHBO authored Apr 12, 2024
1 parent 54d8551 commit fb80d6b
Show file tree
Hide file tree
Showing 11 changed files with 15 additions and 21 deletions.
2 changes: 1 addition & 1 deletion R/approach_vaeac.R
Original file line number Diff line number Diff line change
Expand Up @@ -2393,7 +2393,7 @@ vaeac_save_state <- function(state_list, file_name, return_state = FALSE) {
#'
#' @param best_epoch Positive integer. The epoch with the lowest validation error.
#' @param best_epoch_running Positive integer. The epoch with the lowest running validation error.
#' @param last_epoch The state list (i.e., the saved `vaeac` object)
#' @param last_state The state list (i.e., the saved `vaeac` object)
#' of `vaeac` model at the epoch with the lowest IWAE.
#'
#' @return This function only prints out a message.
Expand Down
4 changes: 0 additions & 4 deletions R/approach_vaeac_torch_modules.R
Original file line number Diff line number Diff line change
Expand Up @@ -815,7 +815,6 @@ vaeac_compute_normalization <- function(data, one_hot_max_sizes) {
#' features are strictly positive, as for Burr and Abalone data, it can be advantageous to log-transform
#' the data to unbounded form before using vaeac. If TRUE, then `vaeac_postprocess_data` will
#' take the exp of the results to get back to strictly positive values.
#' @param x_torch Torch tensor. A 2D matrix containing the data to normalize.
#' @param norm_mean Torch tensor (optional). A 1D array containing the means of the columns of `x_torch`.
#' @param norm_std Torch tensor (optional). A 1D array containing the stds of the columns of `x_torch`.
#'
Expand Down Expand Up @@ -1995,9 +1994,6 @@ specified_prob_mask_generator <- torch::nn_module(
#' If TRUE, then batch must be sampled using 'paired_sampler' which creates batches where
#' the first half and second half of the rows are duplicates of each other. That is,
#' `batch = [row1, row1, row2, row2, row3, row3, ...]`.
#' @param batch Matrix/Tensor. Only used to get the dimensions and to check if any of the
#' entries are missing. If any are missing, then the returned mask will ensure that
#' these missing entries are masked.
#'
#' @examples
#' \dontrun{
Expand Down
4 changes: 2 additions & 2 deletions R/documentation.R
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
#'
#'
#' @keywords internal
default_doc <- function() {
default_doc <- function(internal, model, predict_model, output_size, extra, ...) {
NULL
}

Expand All @@ -36,6 +36,6 @@ default_doc <- function() {
#' apply to the present method. `NULL` means all combinations. Only used internally.
#'
#' @keywords internal
default_doc_explain <- function() {
default_doc_explain <- function(internal, index_features) {
NULL
}
4 changes: 3 additions & 1 deletion R/finalize_explanation.R
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,10 @@ get_p <- function(dt_vS, internal) {
}

#' Compute shapley values
#' @param explainer An `explain` object.
#' @param dt_vS The contribution matrix.
#'
#' @inheritParams default_doc
#'
#' @return A `data.table` with Shapley values for each test observation.
#' @export
#' @keywords internal
Expand Down
6 changes: 4 additions & 2 deletions man/compute_shapley_new.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/default_doc.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/default_doc_explain.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions man/shapr-package.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 0 additions & 4 deletions man/specified_masks_mask_generator.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions man/vaeac_preprocess_data.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/vaeac_print_train_summary.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit fb80d6b

Please sign in to comment.