Skip to content

Commit cce5bc1

Browse files
committed
Deploying to gh-pages from @ fc38e16 🚀
1 parent 5a679f8 commit cce5bc1

38 files changed

Lines changed: 726 additions & 318 deletions

404.html

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

articles/faster-pdp.html

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

articles/faster-pdp.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ system.time( # batched: score up to one million rows per predict() call
3838
batch.size = 1e6)
3939
)
4040
#> user system elapsed
41-
#> 0.177 0.000 0.177
41+
#> 0.176 0.000 0.176
4242
identical(pd1, pd2)
4343
#> [1] TRUE
4444
```
@@ -112,7 +112,7 @@ system.time(
112112
recursive = FALSE, train = boston, batch.size = 1e6)
113113
)
114114
#> user system elapsed
115-
#> 0.287 0.003 0.291
115+
#> 0.289 0.000 0.290
116116
```
117117

118118
Overlaying the results shows that the two methods produce nearly the

articles/ice-curves.html

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

articles/index.html

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

articles/pdp.html

Lines changed: 33 additions & 16 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

articles/pdp.md

Lines changed: 37 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -58,17 +58,17 @@ head(pd)
5858
By default
5959
[`partial()`](https://bgreenwell.github.io/pdp/reference/partial.md)
6060
returns a data frame, which makes it easy to plot with whatever graphics
61-
package you prefer. **pdp** ships with two plotting options:
62-
63-
- [`plot()`](https://rdrr.io/r/graphics/plot.default.html) — lightweight
64-
base R graphics via [tinyplot](https://grantmcdermott.com/tinyplot/);
65-
- [`plotPartial()`](https://bgreenwell.github.io/pdp/reference/plotPartial.md)
66-
[lattice](https://cran.r-project.org/package=lattice) graphics.
61+
package you prefer. **pdp** ships with a
62+
[`plot()`](https://rdrr.io/r/graphics/plot.default.html) method that
63+
draws lightweight base R graphics via
64+
[tinyplot](https://grantmcdermott.com/tinyplot/) by default, or
65+
[lattice](https://cran.r-project.org/package=lattice) graphics whenever
66+
`lattice = TRUE`:
6767

6868
``` r
6969

70-
# tinyplot-based plot() method; rug marks show the min/max and deciles of
71-
# lstat to help avoid interpreting the plot where there's little data
70+
# tinyplot-based display; rug marks show the min/max and deciles of lstat to
71+
# help avoid interpreting the plot where there's little data
7272
plot(pd, rug = TRUE, train = boston)
7373
```
7474

@@ -77,10 +77,10 @@ plot(pd, rug = TRUE, train = boston)
7777
``` r
7878

7979
# lattice-based equivalent
80-
plotPartial(pd, rug = TRUE, train = boston)
80+
plot(pd, rug = TRUE, train = boston, lattice = TRUE)
8181
```
8282

83-
![](pdp_files/figure-html/boston-plotPartial-1.png)
83+
![](pdp_files/figure-html/boston-plot-lattice-1.png)
8484

8585
You can also let
8686
[`partial()`](https://bgreenwell.github.io/pdp/reference/partial.md)
@@ -106,6 +106,33 @@ training values of `lstat` and `rm`, which reduces the risk of
106106
extrapolating outside the region of the data. Factor predictors are
107107
handled automatically and result in faceted displays.
108108

109+
## 3-D surfaces and three predictors (lattice)
110+
111+
The lattice engine (`lattice = TRUE`) additionally supports 3-D surfaces
112+
and paneled three-predictor displays, like the figures in the [R Journal
113+
paper](https://journal.r-project.org/articles/RJ-2017-016/):
114+
115+
``` r
116+
117+
# 3-D surface instead of a false color level plot
118+
plot(pd2, lattice = TRUE, levelplot = FALSE, zlab = "cmedv", drape = TRUE,
119+
colorkey = FALSE, screen = list(z = -20, x = -60))
120+
```
121+
122+
![](pdp_files/figure-html/boston-wireframe-1.png)
123+
124+
``` r
125+
126+
# Three predictors: the third is binned into overlapping intervals and used
127+
# to panel the display (see the `number` and `overlap` arguments)
128+
pd3 <- partial(boston.rf, pred.var = c("lstat", "rm", "age"),
129+
grid.resolution = 10, chull = TRUE, batch.size = 1e6,
130+
train = boston)
131+
plot(pd3, lattice = TRUE)
132+
```
133+
134+
![](pdp_files/figure-html/boston-three-1.png)
135+
109136
## Classification
110137

111138
For classification models, partial dependence is computed for the
20 KB
Loading
27.9 KB
Loading
196 KB
Loading

0 commit comments

Comments
 (0)