Skip to content

Commit 85b6927

Browse files
committed
fix cran
1 parent ed3c700 commit 85b6927

13 files changed

+83
-66
lines changed

R/modelStudio.R

+5-4
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
#' @param eda Compute EDA plots and Residuals vs Feature plot, which adds the data to the dashboard. Default is \code{TRUE}.
4343
#' @param show_info Verbose a progress on the console. Default is \code{TRUE}.
4444
#' @param parallel Speed up the computation using \code{parallelMap::parallelMap()}.
45-
#' See \href{https://modeloriented.github.io/modelStudio/articles/ms-perks-features.html#parallel-computation}{\bold{vignette}}.
45+
#' See \href{https://modelstudio.drwhy.ai/articles/ms-perks-features.html#parallel-computation}{\bold{vignette}}.
4646
#' This might interfere with showing progress using \code{show_info}.
4747
#' @param options Customize \code{modelStudio}. See \code{\link{ms_options}} and
4848
#' \href{https://modelstudio.drwhy.ai/articles/ms-perks-features.html#additional-options-1}{\bold{vignette}}.
@@ -74,8 +74,8 @@
7474
#' }
7575
#'
7676
#' @seealso
77-
#' Vignettes: \href{https://modeloriented.github.io/modelStudio/articles/ms-r-python-examples.html}{\bold{modelStudio - R & Python examples}}
78-
#' and \href{https://modeloriented.github.io/modelStudio/articles/ms-perks-features.html}{\bold{modelStudio - perks and features}}
77+
#' Vignettes: \href{https://modelstudio.drwhy.ai/articles/ms-r-python-examples.html}{\bold{modelStudio - R & Python examples}}
78+
#' and \href{https://modelstudio.drwhy.ai/articles/ms-perks-features.html}{\bold{modelStudio - perks and features}}
7979
#'
8080
#' @examples
8181
#' library("DALEX")
@@ -98,7 +98,8 @@
9898
#'
9999
#' # make a studio for the model
100100
#' modelStudio(explainer_titanic,
101-
#' new_observations)
101+
#' new_observations,
102+
#' N = 200, B = 5) # faster example
102103
#'
103104
#' \donttest{
104105
#'

R/ms_options.R

+2-2
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,8 @@
5757
#' }
5858
#'
5959
#' @seealso
60-
#' Vignettes: \href{https://modeloriented.github.io/modelStudio/articles/ms-r-python-examples.html}{\bold{modelStudio - R & Python examples}}
61-
#' and \href{https://modeloriented.github.io/modelStudio/articles/ms-perks-features.html}{\bold{modelStudio - perks and features}}
60+
#' Vignettes: \href{https://modelstudio.drwhy.ai/articles/ms-r-python-examples.html}{\bold{modelStudio - R & Python examples}}
61+
#' and \href{https://modelstudio.drwhy.ai/articles/ms-perks-features.html}{\bold{modelStudio - perks and features}}
6262
#'
6363
#' @examples
6464
#' library("DALEX")

R/ms_update_observations.R

+5-4
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
#' See \href{https://modelstudio.drwhy.ai/articles/ms-perks-features.html#more-calculations-means-more-time}{\bold{vignette}}
1616
#' @param show_info Verbose a progress on the console. Default is \code{TRUE}.
1717
#' @param parallel Speed up the computation using \code{parallelMap::parallelMap()}.
18-
#' See \href{https://modeloriented.github.io/modelStudio/articles/ms-perks-features.html#parallel-computation}{\bold{vignette}}.
18+
#' See \href{https://modelstudio.drwhy.ai/articles/ms-perks-features.html#parallel-computation}{\bold{vignette}}.
1919
#' This might interfere with showing progress using \code{show_info}.
2020
#' @param widget_id Use an explicit element ID for the widget (rather than an automatically generated one).
2121
#' Useful e.g. when using \code{modelStudio} with Shiny.
@@ -37,8 +37,8 @@
3737
#' }
3838
#'
3939
#' @seealso
40-
#' Vignettes: \href{https://modeloriented.github.io/modelStudio/articles/ms-r-python-examples.html}{\bold{modelStudio - R & Python examples}}
41-
#' and \href{https://modeloriented.github.io/modelStudio/articles/ms-perks-features.html}{\bold{modelStudio - perks and features}}
40+
#' Vignettes: \href{https://modelstudio.drwhy.ai/articles/ms-r-python-examples.html}{\bold{modelStudio - R & Python examples}}
41+
#' and \href{https://modelstudio.drwhy.ai/articles/ms-perks-features.html}{\bold{modelStudio - perks and features}}
4242
#'
4343
#' @examples
4444
#' library("DALEX")
@@ -53,7 +53,8 @@
5353
#' y = titanic_imputed$survived)
5454
#'
5555
#' # make a studio for the model
56-
#' ms <- modelStudio(explainer_titanic)
56+
#' ms <- modelStudio(explainer_titanic,
57+
#' N = 200, B = 5) # faster example
5758
#'
5859
#' \donttest{
5960
#'

R/ms_update_options.R

+4-3
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@
2323
#' }
2424
#'
2525
#' @seealso
26-
#' Vignettes: \href{https://modeloriented.github.io/modelStudio/articles/ms-r-python-examples.html}{\bold{modelStudio - R & Python examples}}
27-
#' and \href{https://modeloriented.github.io/modelStudio/articles/ms-perks-features.html}{\bold{modelStudio - perks and features}}
26+
#' Vignettes: \href{https://modelstudio.drwhy.ai/articles/ms-r-python-examples.html}{\bold{modelStudio - R & Python examples}}
27+
#' and \href{https://modelstudio.drwhy.ai/articles/ms-perks-features.html}{\bold{modelStudio - perks and features}}
2828
#'
2929
#' @examples
3030
#' library("DALEX")
@@ -39,7 +39,8 @@
3939
#' y = titanic_imputed$survived)
4040
#'
4141
#' # make a studio for the model
42-
#' ms <- modelStudio(explainer_titanic)
42+
#' ms <- modelStudio(explainer_titanic,
43+
#' N = 200, B = 5) # faster example
4344
#'
4445
#' # update the options
4546
#' new_ms <- ms_update_options(ms,

README.md

+8-8
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,11 @@ explainer <- explain(model,
5353
modelStudio(explainer)
5454
```
5555

56-
[Save the output](http://modelstudio.drwhy.ai/#save--share) in the form of a HTML file - [**Demo Dashboard**](https://modeloriented.github.io/modelStudio/demo.html).
56+
[Save the output](http://modelstudio.drwhy.ai/#save--share) in the form of a HTML file - [**Demo Dashboard**](https://modelstudio.drwhy.ai/demo.html).
5757

5858
![](man/figures/long.gif)
5959

60-
## R & Python Examples [more](http://modelstudio.drwhy.ai/articles/ms-r-python-examples.html)
60+
## R & Python Examples [more](https://modelstudio.drwhy.ai/articles/ms-r-python-examples.html)
6161

6262
-------------------------------
6363

@@ -69,7 +69,7 @@ install.packages("DALEX")
6969
install.packages("DALEXtra")
7070
```
7171

72-
### mlr [dashboard](https://modeloriented.github.io/modelStudio/mlr.html)
72+
### mlr [dashboard](https://modelstudio.drwhy.ai/mlr.html)
7373

7474
Make a studio for the regression `ranger` model on `apartments` data.
7575

@@ -111,7 +111,7 @@ modelStudio(explainer,
111111

112112
</details>
113113

114-
### xgboost [dashboard](https://modeloriented.github.io/modelStudio/xgboost.html)
114+
### xgboost [dashboard](https://modelstudio.drwhy.ai/xgboost.html)
115115

116116
Make a studio for the classification `xgboost` model on `titanic` data.
117117

@@ -173,7 +173,7 @@ Use `pickle` Python module and `reticulate` R package to easily make a studio fo
173173
install.packages("reticulate")
174174
```
175175

176-
### scikit-learn [dashboard](https://modeloriented.github.io/modelStudio/scikitlearn.html)
176+
### scikit-learn [dashboard](https://modelstudio.drwhy.ai/scikitlearn.html)
177177

178178
Make a studio for the regression `Pipeline SVR` model on `fifa` data.
179179

@@ -224,7 +224,7 @@ modelStudio(explainer, B = 5,
224224

225225
</details>
226226

227-
### lightgbm [dashboard](https://modeloriented.github.io/modelStudio/lightgbm.html)
227+
### lightgbm [dashboard](https://modelstudio.drwhy.ai/lightgbm.html)
228228

229229
Make a studio for the classification `Pipeline LGBMClassifier` model on `titanic` data.
230230

@@ -339,9 +339,9 @@ If you use `modelStudio`, please cite our [JOSS article](https://joss.theoj.org/
339339

340340
- Theoretical introduction to the plots: [Explanatory Model Analysis: Explore, Explain and Examine Predictive Models](https://pbiecek.github.io/ema)
341341

342-
- Vignettes: [modelStudio - perks and features](https://modeloriented.github.io/modelStudio/articles/ms-perks-features.html) and [modelStudio - R & Python examples](https://modeloriented.github.io/modelStudio/articles/ms-r-python-examples.html)
342+
- Vignettes: [modelStudio - perks and features](https://modelstudio.drwhy.ai/articles/ms-perks-features.html) and [modelStudio - R & Python examples](https://modelstudio.drwhy.ai/articles/ms-r-python-examples.html)
343343

344-
- Changelog: [NEWS](https://modeloriented.github.io/modelStudio/news/index.html)
344+
- Changelog: [NEWS](https://modelstudio.drwhy.ai/news/index.html)
345345

346346
- Conference poster: [MLinPL2019](https://github.com/ModelOriented/modelStudio/blob/master/misc/MLinPL2019_modelStudio_poster.pdf)
347347

man/modelStudio.Rd

+5-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/ms_options.Rd

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/ms_update_observations.Rd

+5-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/ms_update_options.Rd

+4-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/testthat/test_2_0.R

+2-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@ testthat::expect_true(!isTRUE(case1$x$options$telemetry))
4040
case2 <- testthat::expect_silent(
4141
modelStudio::modelStudio(exp_fifa, data_fifa[1:2,],
4242
max_vars = 5, rounding_funtion = signif,
43-
digits = 3, show_info = v))
43+
digits = 3,
44+
N = 5, B = 2, show_info = v))
4445
testthat::expect_true(
4546
all(c("mse:", "rmse:", "r2:", "mad:") %in%
4647
strsplit(case2$x$options$measure_text, split=" ")[[1]]))

tests/testthat/test_modelStudio.R

+29-19
Original file line numberDiff line numberDiff line change
@@ -2,71 +2,76 @@ context("Check modelStudio() function")
22

33
source("test_objects.R")
44

5+
N = 10
6+
B = 2
7+
58
ms1 <- testthat::expect_silent(modelStudio::modelStudio(explain_glm,
69
new_observation = titanic_test[1,-9],
710
show_info = v))
811

912
ms4 <- testthat::expect_silent(modelStudio::modelStudio(explain_glm_numerical,
1013
new_observation = titanic_test[1:2, c(2,6,7,8)],
11-
N = 50, B = 10,
14+
N = N, B = B,
1215
show_info = v))
1316

1417
ms5 <- testthat::expect_silent(modelStudio::modelStudio(explain_glm_not_numerical,
1518
new_observation = titanic_test[1:2, c(1,3,4,5)],
16-
N = 50, B = 10,
19+
N = N, B = B,
1720
show_info = v))
1821

1922
ms6 <- testthat::expect_silent(modelStudio::modelStudio(explain_model_small,
2023
new_observation = titanic_test[1:2, c(1,2)],
21-
N = 50, B = 10,
24+
N = N, B = B,
2225
show_info = v))
2326

2427
ms_readme <- testthat::expect_silent(modelStudio::modelStudio(explain_titanic_glm,
2528
new_observations,
26-
facet_dim = c(2,2), N = 200, B = 20, time = 0,
29+
facet_dim = c(2,2),
30+
N = N, B = B, time = 0,
2731
show_info = v))
2832

2933
ms_rf_apartments <- testthat::expect_silent(modelStudio::modelStudio(explain_rf,
3034
new_observation = apartments[1:2,-1],
31-
N = 50, B = 10, facet_dim = c(3,3),
35+
N = N, B = B, facet_dim = c(3,3),
3236
time = 50, max_features = 4,
3337
show_info = v))
3438

3539
both_without_target <- testthat::expect_silent(modelStudio::modelStudio(explain_both_without_target,
3640
new_observation = nx,
37-
N = 10,
38-
B = 2,
41+
N = N,
42+
B = B,
3943
show_info = v))
4044

4145
both_full <- testthat::expect_silent(modelStudio::modelStudio(explain_both_full,
4246
new_observation = nz,
43-
N = 10,
44-
B = 2,
47+
N = N,
48+
B = B,
4549
show_info = v))
4650

4751
obs_without_target_data_full <- testthat::expect_silent(modelStudio::modelStudio(explain_obs_without_target_data_full,
4852
new_observation = nx,
49-
N = 10,
50-
B = 2,
53+
N = N,
54+
B = B,
5155
show_info = v))
5256

5357
obs_full_data_without_target <- testthat::expect_silent(modelStudio::modelStudio(explain_obs_full_data_without_target,
5458
new_observation = nz,
55-
N = 10,
56-
B = 2,
59+
N = N,
60+
B = B,
5761
show_info = v))
5862

5963
ms_big <- testthat::expect_silent(modelStudio::modelStudio(explain_artifficial,
60-
new_observation = artifficial[1:2,], N = 5, B = 2,
64+
new_observation = artifficial[1:2,],
65+
N = N, B = B,
6166
facet_dim = c(3,3),
6267
show_info = v))
6368

6469
ms_parallel <- modelStudio::modelStudio(explain_glm, new_observation = titanic_test[1:2,-9],
65-
N = 5, B = 2, parallel = TRUE,
70+
N = N, B = B, parallel = TRUE,
6671
show_info = v)
6772

6873
ms_parallel_rf <- modelStudio::modelStudio(explain_rf, new_observation = apartments[1:5,-1],
69-
N = 5, B = 2, parallel = TRUE,
74+
N = N, B = B, parallel = TRUE,
7075
show_info = v)
7176

7277
# tests
@@ -115,13 +120,18 @@ testthat::test_that("parallel rf", {
115120
})
116121

117122
testthat::test_that("show_info_and_new_observation_y", {
118-
testthat::expect_is(modelStudio::modelStudio(explain_glm), "r2d3")
123+
testthat::expect_is(modelStudio::modelStudio(explain_glm,
124+
titanic_test[1:2,-9],
125+
titanic_test[1:2, 9],
126+
N = N, B = B, show_info = TRUE), "r2d3")
119127
})
120128

121129
testthat::test_that("eda = FALSE", {
122-
testthat::expect_is(modelStudio::modelStudio(explain_glm, eda = FALSE), "r2d3")
130+
testthat::expect_is(modelStudio::modelStudio(explain_glm, eda = FALSE,
131+
N = N, B = B, show_info = v), "r2d3")
123132
})
124133

125134
testthat::test_that("xgboost matrix", {
126-
testthat::expect_is(modelStudio::modelStudio(explainer_xgb), "r2d3")
135+
testthat::expect_is(modelStudio::modelStudio(explainer_xgb,
136+
N = N, B = B, show_info = v), "r2d3")
127137
})

0 commit comments

Comments
 (0)