From 6fb47bf13104ccfb2d5db39abee9ccdc88082dd0 Mon Sep 17 00:00:00 2001 From: Emil Hvitfeldt Date: Thu, 13 Nov 2025 12:33:36 -0800 Subject: [PATCH 1/4] add keras skips --- tests/testthat/test-linear_reg_keras.R | 1 + tests/testthat/test-logistic_reg_keras.R | 1 + tests/testthat/test-mlp_keras.R | 1 + tests/testthat/test-multinom_reg_keras.R | 1 + 4 files changed, 4 insertions(+) diff --git a/tests/testthat/test-linear_reg_keras.R b/tests/testthat/test-linear_reg_keras.R index d9ddbfaa4..071d9725e 100644 --- a/tests/testthat/test-linear_reg_keras.R +++ b/tests/testthat/test-linear_reg_keras.R @@ -1,3 +1,4 @@ +skip("waiting for keras3") skip_if_not_installed("modeldata") hpc <- hpc_data[1:150, c(2:5, 8)] diff --git a/tests/testthat/test-logistic_reg_keras.R b/tests/testthat/test-logistic_reg_keras.R index 51dd7044e..ef697b347 100644 --- a/tests/testthat/test-logistic_reg_keras.R +++ b/tests/testthat/test-logistic_reg_keras.R @@ -1,3 +1,4 @@ +skip("waiting for keras3") skip_if_not_installed("modeldata") # ------------------------------------------------------------------------------ diff --git a/tests/testthat/test-mlp_keras.R b/tests/testthat/test-mlp_keras.R index 65e265a54..89dd05f25 100644 --- a/tests/testthat/test-mlp_keras.R +++ b/tests/testthat/test-mlp_keras.R @@ -1,3 +1,4 @@ +skip("waiting for keras3") skip_if_not_installed("modeldata") hpc <- hpc_data[1:150, c(2:5, 8)] diff --git a/tests/testthat/test-multinom_reg_keras.R b/tests/testthat/test-multinom_reg_keras.R index 94d356258..25c51043b 100644 --- a/tests/testthat/test-multinom_reg_keras.R +++ b/tests/testthat/test-multinom_reg_keras.R @@ -1,3 +1,4 @@ +skip("waiting for keras3") skip_if_not_installed("modeldata") hpc <- hpc_data[1:150, c(2:5, 8)] From c99ce7df47ffba07e80975fca57b22b8d3e5ead7 Mon Sep 17 00:00:00 2001 From: Emil Hvitfeldt Date: Thu, 13 Nov 2025 13:16:18 -0800 Subject: [PATCH 2/4] update tensorflow install in GHA --- .github/workflows/R-CMD-check.yaml | 13 ++++++------- .github/workflows/pkgdown.yaml | 11 +++++------ .github/workflows/test-coverage.yaml | 11 +++++------ 3 files changed, 16 insertions(+), 19 deletions(-) diff --git a/.github/workflows/R-CMD-check.yaml b/.github/workflows/R-CMD-check.yaml index 0756c6de3..5040439f1 100644 --- a/.github/workflows/R-CMD-check.yaml +++ b/.github/workflows/R-CMD-check.yaml @@ -63,16 +63,15 @@ jobs: run: pak::pkg_install('reticulate') shell: Rscript {0} - - name: Install Miniconda - # conda can fail at downgrading python, so we specify python version in advance - env: - RETICULATE_MINICONDA_PYTHON_VERSION: "3.8" - run: reticulate::install_miniconda() # creates r-reticulate conda env by default - shell: Rscript {0} + - uses: actions/setup-python@v4 + with: + python-version: 3.11 - name: Install TensorFlow run: | - tensorflow::install_tensorflow(version='2.13', conda_python_version = NULL) + reticulate::virtualenv_create('r-reticulate', python='3.11') + reticulate::use_virtualenv('r-reticulate') + tensorflow::install_tensorflow(version='2.16') shell: Rscript {0} - uses: r-lib/actions/check-r-package@v2 diff --git a/.github/workflows/pkgdown.yaml b/.github/workflows/pkgdown.yaml index 04ab57518..da6adfff2 100644 --- a/.github/workflows/pkgdown.yaml +++ b/.github/workflows/pkgdown.yaml @@ -37,15 +37,14 @@ jobs: needs: website - name: Install Miniconda - # conda can fail at downgrading python, so we specify python version in advance - env: - RETICULATE_MINICONDA_PYTHON_VERSION: "3.8" - run: reticulate::install_miniconda() # creates r-reticulate conda env by default + run: | + reticulate::install_miniconda() shell: Rscript {0} - + - name: Install TensorFlow run: | - tensorflow::install_tensorflow(version='2.13', conda_python_version = NULL) + reticulate::conda_create('r-reticulate', packages = c('python==3.11')) + tensorflow::install_tensorflow(version='2.16') shell: Rscript {0} - name: Install Torch diff --git a/.github/workflows/test-coverage.yaml b/.github/workflows/test-coverage.yaml index a0bb07591..6e56ef9a4 100644 --- a/.github/workflows/test-coverage.yaml +++ b/.github/workflows/test-coverage.yaml @@ -32,15 +32,14 @@ jobs: shell: Rscript {0} - name: Install Miniconda - # conda can fail at downgrading python, so we specify python version in advance - env: - RETICULATE_MINICONDA_PYTHON_VERSION: "3.8" - run: reticulate::install_miniconda() # creates r-reticulate conda env by default + run: | + reticulate::install_miniconda() shell: Rscript {0} - + - name: Install TensorFlow run: | - tensorflow::install_tensorflow(version='2.13', conda_python_version = NULL) + reticulate::conda_create('r-reticulate', packages = c('python==3.11')) + tensorflow::install_tensorflow(version='2.16') shell: Rscript {0} - name: Test coverage From 1d51c2ce7e198dc4f19f97719385ae9cd09f2866 Mon Sep 17 00:00:00 2001 From: Emil Hvitfeldt Date: Fri, 14 Nov 2025 08:15:37 -0800 Subject: [PATCH 3/4] install dev reticulate --- .github/workflows/R-CMD-check.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/R-CMD-check.yaml b/.github/workflows/R-CMD-check.yaml index 5040439f1..150ed5e7a 100644 --- a/.github/workflows/R-CMD-check.yaml +++ b/.github/workflows/R-CMD-check.yaml @@ -59,8 +59,8 @@ jobs: extra-packages: any::rcmdcheck needs: check - - name: Install reticulate - run: pak::pkg_install('reticulate') + - name: Install dev reticulate + run: pak::pkg_install('rstudio/reticulate') shell: Rscript {0} - uses: actions/setup-python@v4 From 5ee6400fc25f566bd1e8bcff72093f1000a88168 Mon Sep 17 00:00:00 2001 From: Emil Hvitfeldt Date: Fri, 14 Nov 2025 11:06:17 -0800 Subject: [PATCH 4/4] add eval: false to keras examples in examples.Rmd --- vignettes/articles/Examples.Rmd | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/vignettes/articles/Examples.Rmd b/vignettes/articles/Examples.Rmd index bdb979936..b1bb7a6c5 100644 --- a/vignettes/articles/Examples.Rmd +++ b/vignettes/articles/Examples.Rmd @@ -553,6 +553,7 @@ The following examples use consistent data sets throughout. For regression, we u Now we create the model fit object: ```{r} + #| eval: false set.seed(1) linreg_reg_fit <- linreg_reg_spec |> fit(ridership ~ ., data = Chicago_train) linreg_reg_fit @@ -561,6 +562,7 @@ The following examples use consistent data sets throughout. For regression, we u The holdout data can be predicted: ```{r} + #| eval: false predict(linreg_reg_fit, Chicago_test) ``` @@ -791,6 +793,7 @@ The following examples use consistent data sets throughout. For regression, we u Now we create the model fit object: ```{r} + #| eval: false set.seed(1) logreg_cls_fit <- logreg_cls_spec |> fit(Class ~ ., data = data_train) logreg_cls_fit @@ -799,6 +802,7 @@ The following examples use consistent data sets throughout. For regression, we u The holdout data can be predicted for both hard class predictions and probabilities. We'll bind these together into one tibble: ```{r} + #| eval: false bind_cols( predict(logreg_cls_fit, data_test), predict(logreg_cls_fit, data_test, type = "prob") @@ -1103,6 +1107,7 @@ The following examples use consistent data sets throughout. For regression, we u Now we create the model fit object: ```{r} + #| eval: false set.seed(1) mlp_reg_fit <- mlp_reg_spec |> fit(ridership ~ ., data = Chicago_train) mlp_reg_fit @@ -1111,6 +1116,7 @@ The following examples use consistent data sets throughout. For regression, we u The holdout data can be predicted: ```{r} + #| eval: false predict(mlp_reg_fit, Chicago_test) ``` @@ -1136,6 +1142,7 @@ The following examples use consistent data sets throughout. For regression, we u Now we create the model fit object: ```{r} + #| eval: false set.seed(1) mlp_cls_fit <- mlp_cls_spec |> fit(Class ~ ., data = data_train) mlp_cls_fit @@ -1144,6 +1151,7 @@ The following examples use consistent data sets throughout. For regression, we u The holdout data can be predicted for both hard class predictions and probabilities. We'll bind these together into one tibble: ```{r} + #| eval: false bind_cols( predict(mlp_cls_fit, data_test), predict(mlp_cls_fit, data_test, type = "prob") @@ -1365,6 +1373,7 @@ The following examples use consistent data sets throughout. For regression, we u Now we create the model fit object: ```{r} + #| eval: false set.seed(1) mr_cls_fit <- mr_cls_spec |> fit(island ~ ., data = penguins_train) mr_cls_fit @@ -1373,6 +1382,7 @@ The following examples use consistent data sets throughout. For regression, we u The holdout data can be predicted for both hard class predictions and probabilities. We'll bind these together into one tibble: ```{r} + #| eval: false bind_cols( predict(mr_cls_fit, penguins_test), predict(mr_cls_fit, penguins_test, type = "prob")