You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: tools/regression/README.md
+112Lines changed: 112 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,6 +10,10 @@ For this reason, the "regression testing" setup is somewhat informal. It is desi
10
10
11
11
## Usage
12
12
13
+
The primary scripts for running the regression tests are located in the `tools/regression/bart` and `tools/regression/bcf` directories. Here, there are scripts that run each models on a variety of datasets and combine and summarize their results (RMSE, coverage, runtime).
14
+
15
+
This section documents how to run the end-to-end regression test suite for both the R and Python packages of `stochtree`. For more information on the individual tests, see the following section for documentation on the data generating processes tested and the test script parameters.
16
+
13
17
### R Package
14
18
15
19
To run the regression tests for the R package, first navigate to the `stochtree` repository in your terminal and then run:
This can be compared against any previously saved results. We are currently figuring out a solution for hosting previous regression results, so for now, you will need to manually save and compare outputs of the tests locally before and after after making your changes.
34
+
35
+
### Python Package
36
+
37
+
To run the regression tests for the Python package, first navigate to the `stochtree` repository in your terminal and then run:
1.**DGP 1**: Basic BART without basis or random effects
58
+
2.**DGP 2**: BART with basis but no random effects
59
+
3.**DGP 3**: BART with random effects but no basis
60
+
4.**DGP 4**: BART with both basis and random effects
61
+
62
+
#### Script
63
+
64
+
The individual regression tests are dispatched by a `tools/regression/bart/regression_test_dispatch_bart` script for R or Python, both of which accept the following (options) command line arguments:
65
+
66
+
-`n_iter`: Number of iterations (default: 5)
67
+
-`n`: Sample size (default: 1000)
68
+
-`p`: Number of covariates (default: 5)
69
+
-`num_gfr`: Number of GFR iterations (default: 10)
70
+
-`num_mcmc`: Number of MCMC iterations (default: 100)
71
+
-`dgp_num`: Data generating process number 1-4 (default: 1)
72
+
-`snr`: Signal-to-noise ratio (default: 2.0)
73
+
-`test_set_pct`: Test set percentage (default: 0.2)
74
+
-`num_threads`: Number of threads, -1 for all available (default: -1)
BART results are saved to CSV files in the `tools/regression/bart/stochtree_bart_python_results/` or `tools/regression/bart/stochtree_bart_r_results/` directory with filenames that encode the parameter values. Each file contains:
2.**DGP 2**: BCF with multivariate treatment but no random effects
104
+
3.**DGP 3**: BCF with random effects but univariate treatment
105
+
4.**DGP 4**: BCF with both multivariate treatment and random effects
106
+
107
+
#### Script
108
+
109
+
The individual regression tests are dispatched by a `tools/regression/bcf/regression_test_dispatch_bcf` script for R or Python, both of which accept the following (options) command line arguments:
110
+
111
+
-`n_iter`: Number of iterations (default: 5)
112
+
-`n`: Sample size (default: 1000)
113
+
-`p`: Number of covariates (default: 5)
114
+
-`num_gfr`: Number of GFR iterations (default: 10)
115
+
-`num_mcmc`: Number of MCMC iterations (default: 100)
116
+
-`dgp_num`: Data generating process number 1-4 (default: 1)
117
+
-`snr`: Signal-to-noise ratio (default: 2.0)
118
+
-`test_set_pct`: Test set percentage (default: 0.2)
119
+
-`num_threads`: Number of threads, -1 for all available (default: -1)
BCF results are saved to CSV files in the `tools/regression/bcf/stochtree_bcf_python_results/` or `tools/regression/bcf/stochtree_bcf_r_results/` directory with filenames that encode the parameter values. Each file contains:
0 commit comments