Skip to content

Commit

Permalink
styler + lint
Browse files Browse the repository at this point in the history
  • Loading branch information
martinju committed Dec 16, 2024
1 parent 4de47fa commit 6c67a13
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion R/prepare_next_iteration.R
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ prepare_next_iteration <- function(internal) {
est_remaining_coalitions <- internal$iter_list[[iter]]$est_remaining_coalitions
n_coal_next_iter_factor <- internal$iter_list[[iter]]$n_coal_next_iter_factor
current_n_coalitions <- internal$iter_list[[iter]]$n_sampled_coalitions + 2 # Used instead of n_coalitions to
# deal with forecast special case
# deal with forecast special case
current_coal_samples <- internal$iter_list[[iter]]$coal_samples

if (is.null(fixed_n_coalitions_per_iter)) {
Expand Down
4 changes: 2 additions & 2 deletions R/setup.R
Original file line number Diff line number Diff line change
Expand Up @@ -915,8 +915,8 @@ adjust_max_n_coalitions <- function(internal) {
message(
paste0(
"Success with message:\n",
"n_groups is smaller than or equal to 3, meaning there are so few unique coalitions (", 2^n_shapley_values, ") ",
"that we should use all to get reliable results.\n",
"n_groups is smaller than or equal to 3, meaning there are so few unique coalitions (",
2^n_shapley_values, ") that we should use all to get reliable results.\n",
"max_n_coalitions is therefore set to 2^n_groups = ", 2^n_shapley_values, ".\n"
)
)
Expand Down
4 changes: 2 additions & 2 deletions R/shapley_setup.R
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ shapley_setup <- function(internal) {
# Updating n_coalitions in the end based on what is actually used.
internal$iter_list[[iter]]$n_coalitions <- nrow(S)
# The number of sampled coalitions to be used for convergence detection only (exclude the zero and full prediction)
internal$iter_list[[iter]]$n_sampled_coalitions <- internal$iter_list[[iter]]$n_coalitions-2
internal$iter_list[[iter]]$n_sampled_coalitions <- internal$iter_list[[iter]]$n_coalitions - 2


# This will be obsolete later
Expand Down Expand Up @@ -763,7 +763,7 @@ shapley_setup_forecast <- function(internal) {

# The number of sampled coalitions *per horizon* to be used for convergence detection only
# Exclude the zero and full prediction
internal$iter_list[[iter]]$n_sampled_coalitions <- length(unique(id_coalition_mapper_dt$horizon_id_coalition))-2
internal$iter_list[[iter]]$n_sampled_coalitions <- length(unique(id_coalition_mapper_dt$horizon_id_coalition)) - 2

# This will be obsolete later
internal$parameters$group_num <- NULL # TODO: Checking whether I could just do this processing where needed
Expand Down

0 comments on commit 6c67a13

Please sign in to comment.