Skip to content

Commit

Permalink
Merge pull request #156 from NSAPH-Software/release_v0.2.6
Browse files Browse the repository at this point in the history
Release v0.2.6
  • Loading branch information
Naeemkh authored Apr 21, 2024
2 parents 91bdaf3 + c8205a2 commit 608e8e9
Show file tree
Hide file tree
Showing 18 changed files with 752 additions and 521 deletions.
1 change: 1 addition & 0 deletions .covrignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ R/plot.R
R/print.R
R/check_hyper_params.R
R/logger_utils.R
R/inTrees.R
2 changes: 1 addition & 1 deletion .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
matrix:
config:
- {os: windows-latest, r: '4.2'}
# - {os: macOS-latest, r: '4.2'}
#- {os: macOS-latest, r: '4.2'}
- {os: ubuntu-20.04, r: 'release', rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest"}
- {os: ubuntu-20.04, r: 'devel', rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest", http-user-agent: "R/4.1.0 (ubuntu-20.04) R (4.1.0 x86_64-pc-linux-gnu x86_64 linux-gnu) on GitHub Actions" }

Expand Down
23 changes: 0 additions & 23 deletions .github/workflows/draft-pdf.yml

This file was deleted.

6 changes: 3 additions & 3 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Type: Package
Package: CRE
Title: Interpretable Discovery and Inference of Heterogeneous Treatment Effects
Version: 0.2.5.9000
Version: 0.2.6
Authors@R: c(
person("Naeem", "Khoshnevis", , "[email protected]", role = c("aut", "cre"),
comment = c(ORCID = "0000-0003-4315-1426", AFFILIATION = "FASRC")),
Expand All @@ -23,7 +23,7 @@ Description: Provides a new method for interpretable heterogeneous
it is supported by theoretical convergence guarantees. Bargagli-Stoffi,
F. J., Cadei, R., Lee, K., & Dominici, F. (2023) Causal rule ensemble:
Interpretable Discovery and Inference of Heterogeneous Treatment Effects.
arXiv preprint <arXiv:2009.09036>.
arXiv preprint <doi:10.48550/arXiv.2009.09036>.
License: GPL-3
URL: https://github.com/NSAPH-Software/CRE
BugReports: https://github.com/NSAPH-Software/CRE/issues
Expand All @@ -47,7 +47,7 @@ Imports:
SuperLearner,
magrittr,
ggplot2,
inTrees
arules
Suggests:
grf,
BART,
Expand Down
8 changes: 8 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
# CRE 0.2.5 (2024-4-21)

## Added
* A copy of inTrees package source code.

## Removed
* The inTrees package dependency

# CRE 0.2.5 (2023-12-6)

## Added
Expand Down
4 changes: 2 additions & 2 deletions R/extract_rules.R
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ extract_rules <- function(treelist, X, max_depth, digits = 2) {
if (nrow(tree) <= 1) next # skip if there is no split
ruleSet <- vector("list", length(which(tree[, "status"] == -1)))
for (max_length in 1:max_depth) {
res <- inTrees::treeVisit(tree,
res <- inTrees_treeVisit(tree,
rowIx = rowIx,
count,
ruleSet,
Expand All @@ -45,6 +45,6 @@ extract_rules <- function(treelist, X, max_depth, digits = 2) {
}

allRulesList <- allRulesList[!unlist(lapply(allRulesList, is.null))]
rules <- inTrees::ruleList2Exec(X, allRulesList)
rules <- inTrees_ruleList2Exec(X, allRulesList)
return(rules)
}
4 changes: 2 additions & 2 deletions R/filter_irrelevant_rules.R
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ filter_irrelevant_rules <- function(rules, X, ite, t_decay) {

rules_matrix <- matrix(rules)
colnames(rules_matrix) <- "condition"
metric <- inTrees::getRuleMetric(rules_matrix,
metric <- inTrees_getRuleMetric(rules_matrix,
X,
ite_)

pruned <- inTrees::pruneRule(rules = metric,
pruned <- inTrees_pruneRule(rules = metric,
X = X,
target = ite_,
maxDecay = t_decay)
Expand Down
2 changes: 1 addition & 1 deletion R/generate_rules.R
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ generate_rules <- function(X, ite, ntrees, node_size, max_rules, max_depth) {
nodesize = node_size,
mtry = ncol(X)*2/3)

treelist <- inTrees::RF2List(forest)
treelist <- inTrees_RF2List(forest)
rules <- extract_rules(treelist, X, max_depth)
} else {
rules <- NULL
Expand Down
Loading

0 comments on commit 608e8e9

Please sign in to comment.