Skip to content

Commit

Permalink
nomatch force for the no macthing leaf case
Browse files Browse the repository at this point in the history
  • Loading branch information
mnwright committed Jun 13, 2024
1 parent 6b28747 commit 8d294f2
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion R/utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,15 @@ cforde <- function(params,
}
}
conds_impossible <- conds_conditioned[!(conds_conditioned %in% relevant_leaves[,unique(c_idx)])]
relevant_leaves <- setorder(rbind(relevant_leaves, data.table(c_idx = conds_impossible, f_idx = NA_integer_, f_idx_uncond = NA_integer_)))

if (grepl("^force", nomatch)) {
# All leaves
impossible_leaves <- data.table(c_idx = conds_impossible, f_idx = forest$f_idx, f_idx_uncond = forest$f_idx)
} else {
# Set to NA -> no leaves -> Sample NA
impossible_leaves <- data.table(c_idx = conds_impossible, f_idx = NA_integer_, f_idx_uncond = NA_integer_)
}
relevant_leaves <- setorder(rbind(relevant_leaves, impossible_leaves))
}
}

Expand Down

0 comments on commit 8d294f2

Please sign in to comment.