Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
17 changes: 8 additions & 9 deletions .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,20 +59,19 @@ 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}

- 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
Expand Down
11 changes: 5 additions & 6 deletions .github/workflows/pkgdown.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
11 changes: 5 additions & 6 deletions .github/workflows/test-coverage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions tests/testthat/test-linear_reg_keras.R
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
skip("waiting for keras3")
skip_if_not_installed("modeldata")

hpc <- hpc_data[1:150, c(2:5, 8)]
Expand Down
1 change: 1 addition & 0 deletions tests/testthat/test-logistic_reg_keras.R
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
skip("waiting for keras3")
skip_if_not_installed("modeldata")

# ------------------------------------------------------------------------------
Expand Down
1 change: 1 addition & 0 deletions tests/testthat/test-mlp_keras.R
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
skip("waiting for keras3")
skip_if_not_installed("modeldata")

hpc <- hpc_data[1:150, c(2:5, 8)]
Expand Down
1 change: 1 addition & 0 deletions tests/testthat/test-multinom_reg_keras.R
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
skip("waiting for keras3")
skip_if_not_installed("modeldata")

hpc <- hpc_data[1:150, c(2:5, 8)]
Expand Down
10 changes: 10 additions & 0 deletions vignettes/articles/Examples.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
```

Expand Down Expand Up @@ -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
Expand All @@ -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")
Expand Down Expand Up @@ -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
Expand All @@ -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)
```

Expand All @@ -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
Expand All @@ -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")
Expand Down Expand Up @@ -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
Expand All @@ -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")
Expand Down