Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

merging tbrick changes #74

Merged
merged 69 commits into from
Sep 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
69 commits
Select commit Hold shift + click to select a range
5243f4c
Merge pull request #59 from brandmaier/boruta
brandmaier Sep 13, 2023
90e3fe8
some cleanup
brandmaier Sep 14, 2023
456bb97
changed default of toTable() such that all parameters are shown by de…
brandmaier Sep 15, 2023
54c16c4
add CRAN skip to tests
brandmaier Oct 13, 2023
f93f950
update date
brandmaier Oct 13, 2023
2f19f52
tidying up for CRAN submission
brandmaier Oct 13, 2023
e88f845
removed OpenMx tryHard() outputs from vignettes
brandmaier Nov 23, 2023
052b7de
updated Description and News for upcoming CRAN release
brandmaier Nov 23, 2023
450924d
updated vignette and man files
brandmaier Nov 23, 2023
ddc76f1
extended vignettes
brandmaier Nov 24, 2023
989334a
removed dependencies of digest, plotrix and sets packages
brandmaier Nov 24, 2023
e8aa359
some more package cleanup to avoid CRAN warnings
brandmaier Nov 24, 2023
f5a6c75
minor fixes to roxygen docs
brandmaier Nov 24, 2023
20b7f72
updated README
brandmaier Nov 24, 2023
7766aae
updated Readme
brandmaier Nov 24, 2023
ce711aa
updated ignore files
brandmaier Nov 24, 2023
546412a
fixed S3 prune.semforest issue
brandmaier Nov 24, 2023
e08c44f
added github action via usethis
brandmaier Nov 24, 2023
c2c6140
rearranged badges
brandmaier Nov 25, 2023
cb9289f
added a test for dummy splits
brandmaier Dec 6, 2023
7cc97e2
fix for bug with dummy variables in growTree()
brandmaier Dec 6, 2023
90d60bd
added error wrapper around vcov computation, which could fail, thus s…
brandmaier Mar 6, 2024
3774930
started coding heuristic for control objects
brandmaier Mar 14, 2024
ea21b03
add grand total badge
brandmaier Mar 21, 2024
6261764
sketch for testthat testing
brandmaier Mar 24, 2024
b650ecb
ran through styler
brandmaier Mar 24, 2024
bb2db4d
ran through styler
brandmaier Mar 24, 2024
03f49e8
applied styler package to some files
brandmaier Mar 24, 2024
089d0bd
Merge branch 'master' of https://github.com/brandmaier/semtree
brandmaier Mar 24, 2024
6e90ff6
fixed readme
brandmaier Mar 24, 2024
90a9333
added installation via devtools
brandmaier Mar 24, 2024
3bef14e
re-added checkout
brandmaier Mar 24, 2024
bc33654
changed cache flag
brandmaier Mar 24, 2024
e6e5a63
added styling using styler package
brandmaier Mar 24, 2024
be81e59
Merge branch 'master' of https://github.com/brandmaier/semtree
brandmaier Mar 24, 2024
5080099
added test coverage action
brandmaier Mar 24, 2024
c1f3d72
Update R-tests.yml
brandmaier Mar 24, 2024
3227363
removed bitops dependency
brandmaier Mar 25, 2024
7d1246e
removed stringr dependency
brandmaier Mar 25, 2024
11ff3c7
added new test for control object
brandmaier Mar 25, 2024
0a1f762
merge
brandmaier Mar 25, 2024
93edaea
fixed conflict
brandmaier Mar 25, 2024
1f41266
Create R-devel-check
brandmaier Mar 25, 2024
a778fb6
improved devel check
brandmaier Mar 25, 2024
69a1cdb
Update R-devel-check
brandmaier Mar 25, 2024
db1a0c5
Merge branch 'master' of https://github.com/brandmaier/semtree
brandmaier Mar 25, 2024
34ebcdf
added shell cmd
brandmaier Mar 25, 2024
f393e07
speed up vim test with score-based tests
brandmaier Mar 25, 2024
fe726ca
Merge branch 'master' of https://github.com/brandmaier/semtree
brandmaier Mar 25, 2024
31c0348
moving ctsem dependency to suggests
brandmaier Mar 26, 2024
f439b98
updated NEWS and README
brandmaier Mar 26, 2024
8c3fa39
added tests for control object
brandmaier Apr 8, 2024
e2ad7d0
moved invariance test out of standard tests
brandmaier Apr 8, 2024
22a7126
added cstsem install test
brandmaier Apr 8, 2024
6af4ae7
added utils::
brandmaier Apr 8, 2024
bc6bfeb
Create R-CMD-check-windows
brandmaier Apr 8, 2024
b479679
Rename R-CMD-check-windows to R-CMD-check-windows.yaml
brandmaier Apr 8, 2024
8661dee
export boruta
brandmaier Apr 16, 2024
17d92d1
updated docs
brandmaier Apr 16, 2024
45f3cce
test for single predictor chi2 vs multigroup
brandmaier Apr 17, 2024
cffd547
adding forced_split functionality proposed by CvL
brandmaier Apr 17, 2024
0907def
fixed problem with NULL defaults in semtree control check
brandmaier May 21, 2024
4db3cd2
Merge pull request #67 from brandmaier/forcedsplit
brandmaier May 21, 2024
cdca892
added strucchange.to param to model check (NULL)
brandmaier May 21, 2024
02d6cc4
data.frame type check
brandmaier Jul 4, 2024
3c4997e
Merge branch 'master' of https://github.com/brandmaier/semtree
brandmaier Jul 4, 2024
9e93dda
fake parameter labelling for matrix derivatives
brandmaier Jul 4, 2024
985740e
Merge pull request #71 from brandmaier/scorelabels
brandmaier Sep 5, 2024
a57768d
Merge branch 'boruta' into merging_tbrick_boruta
brandmaier Sep 5, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,7 @@ Makefile
^pkgdown$
^LICENSE\.md$
^\.travis\.yml$
misc
cran-comments.md
^CRAN-SUBMISSION$
^\.github$
1 change: 1 addition & 0 deletions .github/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.html
29 changes: 29 additions & 0 deletions .github/workflows/R-CMD-check-windows.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
on:
push:
branches: [main, master]
pull_request:
branches: [main, master]

name: R-CMD-check-Win

jobs:
R-CMD-check:
runs-on: windows-latest
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
R_KEEP_PKG_SOURCE: yes
steps:
- uses: actions/checkout@v3

- uses: r-lib/actions/setup-r@v2
with:
use-public-rspm: true

- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: any::rcmdcheck
needs: check

- uses: r-lib/actions/check-r-package@v2
29 changes: 29 additions & 0 deletions .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
on:
push:
branches: [main, master]
pull_request:
branches: [main, master]

name: R-CMD-check

jobs:
R-CMD-check:
runs-on: ubuntu-latest
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
R_KEEP_PKG_SOURCE: yes
steps:
- uses: actions/checkout@v3

- uses: r-lib/actions/setup-r@v2
with:
use-public-rspm: true

- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: any::rcmdcheck
needs: check

- uses: r-lib/actions/check-r-package@v2
17 changes: 17 additions & 0 deletions .github/workflows/R-devel-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# check package on latest R devel version
#
on: workflow-dispatch

name: R-CMD-check

jobs:
devel-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: r-lib/actions/setup-r@v2
with:
r-version: 'devel'
# Use "renv" to retrieve R version recorded in renv.lock file.
- run: 'R CMD build ./'
- run: 'R CMD check semtree*.tar.gz'
31 changes: 31 additions & 0 deletions .github/workflows/R-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
on:
workflow_dispatch

name: Tests

jobs:
document:
name: run tests
runs-on: ubuntu-latest
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v3
- uses: r-lib/actions/setup-r@v2
with:
use-public-rspm: true

- uses: r-lib/actions/setup-r-dependencies@v2
with:
cache-version: 2
extra-packages: |
any::testthat
any::devtools
# needs: pr-document
- name: install package
run: devtools::install_github("brandmaier/semtree")
shell: Rscript {0}

- name: run test
run: testthat::test_dir("tests/testthat/")
shell: Rscript {0}
50 changes: 50 additions & 0 deletions .github/workflows/test-coverage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
on:
push:
branches: [main, master]
pull_request:
branches: [main, master]

name: test-coverage

jobs:
test-coverage:
runs-on: ubuntu-latest
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}

steps:
- uses: actions/checkout@v3

- uses: r-lib/actions/setup-r@v2
with:
use-public-rspm: true

- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: any::covr
needs: coverage

- name: Test coverage
run: |
covr::codecov(
quiet = FALSE,
clean = FALSE,
install_path = file.path(Sys.getenv("RUNNER_TEMP"), "package")
)
shell: Rscript {0}

- name: Show testthat output
if: always()
run: |
## --------------------------------------------------------------------
find ${{ runner.temp }}/package -name 'testthat.Rout*' -exec cat '{}' \; || true
shell: bash

- name: Upload test results
if: failure()
uses: actions/upload-artifact@v3
with:
name: coverage-test-failures
path: ${{ runner.temp }}/package
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,9 @@
inst/doc
doc
Meta
/doc/
/Meta/
cran_comments.md
CRAN*
.DS_Store

46 changes: 0 additions & 46 deletions .travis.yml

This file was deleted.

19 changes: 8 additions & 11 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,10 @@ Depends:
R (>= 2.10),
OpenMx (>= 2.6.9),
Imports:
bitops,
sets,
digest,
rpart,
rpart.plot (>= 3.0.6),
plotrix,
cluster,
stringr,
lavaan,
cluster,
ggplot2,
tidyr,
methods,
Expand All @@ -30,7 +25,6 @@ Imports:
clisymbols,
future.apply,
data.table,
ctsemOMX,
expm,
gridBase
Suggests:
Expand All @@ -39,7 +33,9 @@ Suggests:
viridis,
MASS,
psychTools,
testthat
testthat,
future,
ctsemOMX
Description: SEM Trees and SEM Forests -- an extension of model-based decision
trees and forests to Structural Equation Models (SEM). SEM trees hierarchically
split empirical data into homogeneous groups each sharing similar data patterns
Expand All @@ -53,9 +49,10 @@ Description: SEM Trees and SEM Forests -- an extension of model-based decision
License: GPL-3
Encoding: UTF-8
LazyLoad: yes
Version: 0.9.19
Date: 2023-03-03
RoxygenNote: 7.3.1
Version: 0.9.20
Date: 2024-03-25
RoxygenNote: 7.2.3
VignetteBuilder: knitr
BugReports: https://github.com/brandmaier/semtree/issues
URL: https://github.com/brandmaier/semtree
Language: en-US
6 changes: 4 additions & 2 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,13 @@ S3method(print,summary.semtree)
S3method(proximity,semforest)
S3method(proximity,semforest_node_id)
S3method(proximity,semforest_stripped)
S3method(prune,semforest)
S3method(prune,semtree)
S3method(strip,semforest)
S3method(strip,semtree)
S3method(summary,semforest)
S3method(summary,semtree)
S3method(toLatex,semtree)
export(biodiversity)
export(boruta)
export(diversityMatrix)
Expand Down Expand Up @@ -59,10 +61,12 @@ export(prune)
export(se)
export(semforest)
export(semforest.control)
export(semforest_control)
export(semforest_score_control)
export(semtree)
export(semtree.constraints)
export(semtree.control)
export(semtree_control)
export(strip)
export(subforest)
export(subtree)
Expand All @@ -72,7 +76,6 @@ export(varimpConvergencePlot)
import(OpenMx)
import(data.table)
import(rpart)
importFrom(bitops,bitAnd)
importFrom(data.table,data.table)
importFrom(grDevices,heat.colors)
importFrom(graphics,barplot)
Expand All @@ -92,7 +95,6 @@ importFrom(methods,is)
importFrom(parallel,clusterMap)
importFrom(parallel,parLapply)
importFrom(sandwich,bread)
importFrom(sets,as.set)
importFrom(stats,as.dist)
importFrom(stats,as.formula)
importFrom(stats,cmdscale)
Expand Down
18 changes: 13 additions & 5 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,20 @@
# semtree 0.9.20 (2023)
# semtree 0.9.20 (2024)

- changed default behavior of print function of varimp, such that na.omit=TRUE,
which is consistent with other packages like party or partykit
- added an error handler for score-based tests when the vcov matrix cannot be computed (e.g., models with Heywood cases)
- leaner package imports: removed dependency on bitops and stringr package
- prefer `semforest_control()` over `semforest.control()` and `semtree_control()` over `semtree.control()`
- added heuristics for choosing `mtry` in forests (if `NULL`) and for choosing `min.N` and `min.bucket` (if `NULL`)
- moved dependency on `ctsemOMX` to suggested package

# semtree 0.9.19 (2022)
# semtree 0.9.19 (2023)

- changed default behavior of print function of `varimp`, such that na.omit=TRUE, which is consistent with other packages like party or partykit
- fixed issues with `toTable()`-command, by default, all parameters are shown now, also fixed a bug with score-based tests and toTable()
- fixed problem with focus-parameters and variable importance
- bugfix in score-based tests that sometimes did not respect min.N constraints
- new functionality for parameter contribution evaluation
- more verbose vignettes
- removed dependency on set, plotrix and digest package to make package imports leaner

# semtree 0.9.18 (2022)

Expand Down Expand Up @@ -65,6 +73,6 @@
- deprecated partialDependencePlot and introduced partialDependence() function with S3 plotting method
- added parallel computation option to partialDependence
- added new demo scripts
- added extra.legend paramter to varimpConvergencePlot
- added extra.legend parameter to varimpConvergencePlot
- bugfix in traverse() that led to underestimations of variable importance in some cases
- added error message when trying to use lavaan and global constraints
19 changes: 19 additions & 0 deletions R/OpenMx_scores_input.R
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,25 @@ OpenMx_scores_input <- function(x, control) {
p_star <- p * (p + 1) / 2
p_star_means <- p * (p + 3) / 2

# AB: give pseudo-labels to matrices if
# unlabelled parameters are given
candidate_param_id <- which(startsWith(x=names(x$output$estimate), prefix=x$name))
if (length(candidate_param_id)>0) {
for (k in candidate_param_id) {
candidate_param_name <- names(x$output$estimate)[k]
cplen <- nchar(x$name)
candidate_matrix <- substr(candidate_param_name, cplen+2,cplen+2)
candidate_pos <- as.integer(strsplit(substr(candidate_param_name, cplen+4, nchar(candidate_param_name)-1),",")[[1]])
if (candidate_matrix=="A") {
x$A$labels[candidate_pos[1], candidate_pos[2]]<-candidate_param_name
} else if (candidate_matrix=="S") {
x$S$labels[candidate_pos[1], candidate_pos[2]]<-candidate_param_name
} else if (candidate_matrix == "M") {
x$M$labels[candidate_pos]<-candidate_param_name
}
}
}

if (control$linear | imxHasDefinitionVariable(x)) {

param_names <- names(x$output$estimate)
Expand Down
1 change: 0 additions & 1 deletion R/aggregateVarimp.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

aggregateVarimp <-
function(vimp,
aggregate = "mean",
Expand Down
Loading