diff --git a/articles/parttree-art.html b/articles/parttree-art.html index fc6996c..b80beb5 100644 --- a/articles/parttree-art.html +++ b/articles/parttree-art.html @@ -130,7 +130,7 @@

Example 1: Peale’s “Portrait o rosalba #> Image. Width: 850 pix Height: 400 pix Depth: 1 Colour channels: 3 plot(rosalba, axes = FALSE) -

+

With our cropped image in hand, let’s walk through the 4-step recipe from above.

Step 1 is converting the image into a data frame.

@@ -213,7 +213,7 @@

Example 1: Peale’s “Portrait o fill_alpha = NULL, lwd = 0.1, border = "grey15" ) ) -

+

#> $`1`
 #> NULL
 #> 
@@ -233,7 +233,7 @@ 

Example 1: Peale’s “Portrait o scale_y_reverse(limits=c(max(rosalba_df$y), 0), expand=c(0,0)) + coord_fixed(ratio = Reduce(x = dim(rosalba)[2:1], f = "/") * 2) + theme_void()

-

+

-

+

 
 # Coerce to data frame
@@ -313,7 +313,7 @@ 
-

+

#> $`1`
 #> NULL
 #> 
@@ -333,7 +333,7 @@ 
-

+

Postscript @@ -354,7 +354,7 @@

Postscript) } )

-

+

#> [[1]]
 #> NULL
 #> 
diff --git a/articles/parttree-art_files/figure-html/bonzai_glass-1.png b/articles/parttree-art_files/figure-html/bonzai_glass-1.png
index ea84743..0db96e1 100644
Binary files a/articles/parttree-art_files/figure-html/bonzai_glass-1.png and b/articles/parttree-art_files/figure-html/bonzai_glass-1.png differ
diff --git a/articles/parttree-art_files/figure-html/bonzai_glass-2.png b/articles/parttree-art_files/figure-html/bonzai_glass-2.png
index 5d36ee5..6562ccd 100644
Binary files a/articles/parttree-art_files/figure-html/bonzai_glass-2.png and b/articles/parttree-art_files/figure-html/bonzai_glass-2.png differ
diff --git a/articles/parttree-art_files/figure-html/bonzai_glass-3.png b/articles/parttree-art_files/figure-html/bonzai_glass-3.png
index 9c1e480..56c642d 100644
Binary files a/articles/parttree-art_files/figure-html/bonzai_glass-3.png and b/articles/parttree-art_files/figure-html/bonzai_glass-3.png differ
diff --git a/articles/parttree-intro.html b/articles/parttree-intro.html
index 37e3a65..a2257f8 100644
--- a/articles/parttree-intro.html
+++ b/articles/parttree-intro.html
@@ -112,7 +112,7 @@ 

Motivating example: Clas
 plot(tree, compress = TRUE)
 text(tree, use.n = TRUE)
-

+

While this is okay, I don’t feel that it provides much intuition about the model’s prediction on the scale of the actual data. In other words, what I’d prefer to see is: How has our tree partitioned @@ -124,7 +124,7 @@

Motivating example: Clas
 ptree = parttree(tree)
 plot(ptree)
-

+

Et voila! Now we can clearly see how our model has divided up the Cartesian space of the data. Gentoo penguins typically have longer flippers than Chinstrap or Adelie penguins, while the latter have @@ -152,7 +152,7 @@

Motivating example: Clas For example:

 plot(ptree, pch = 16, palette = "classic", alpha = 0.75, grid = TRUE)
-

+

Continuous predictions

@@ -165,7 +165,7 @@

Continuous predictionstree_cont |> parttree() |> plot(pch = 16, palette = "viridis")

-

+

@@ -186,7 +186,7 @@

Supported model classesctree(species ~ flipper_length_mm + bill_length_mm, data = penguins) |> parttree() |> plot(pch = 19, palette = "classic", alpha = 0.5)

-

+

parttree also supports a variety of “frontend” modes that call rpart::rpart() as the underlying engine. This includes packages from both the mlr3 and tidymodels (parsnip or workflows) ecosystems. Here @@ -210,7 +210,7 @@

Supported model classesti_tree |> parttree() |> plot(pch = 16, jitter = TRUE, palette = "dark", alpha = 0.7) -

+

ggplot2 @@ -227,7 +227,7 @@

ggplot2ggplot(data = penguins, aes(x = flipper_length_mm, y = bill_length_mm)) + geom_point(aes(col = species)) + geom_parttree(data = tree, aes(fill=species), alpha = 0.1)

-

+

Compared to the “native” plot.parttree method, note that the ggplot2 workflow requires a few tweaks: