MakieOrg / GraphMakie.jl

Plotting graphs with Makie
https://graph.makie.org
MIT License
136 stars 23 forks source link

Feature Request: tree-structured regression and classification models #84

Open rikhuijzer opened 2 years ago

rikhuijzer commented 2 years ago

I'm trying to visualize a decision tree. The interpretable ML book has a nice visualization for it:

library("partykit")
set.seed(42)
n = 100
dat_sim = data.frame(feature_x1 = rep(c(3,3,4,4), times = n), feature_x2 = rep(c(1,2,2,2), times = n), y = rep(c(1, 2, 3, 4), times = n))
dat_sim = dat_sim[sample(1:nrow(dat_sim), size = 0.9 * nrow(dat_sim)), ]
dat_sim$y = dat_sim$y + rnorm(nrow(dat_sim), sd = 0.2)
ct = ctree(y ~ feature_x1 + feature_x2, dat_sim)
plot(ct, inner_panel = node_inner(ct, pval = FALSE, id = FALSE),
  terminal_panel = node_boxplot(ct, id = FALSE))

image

Maybe this would be a nice feature for GraphMakie as well

filchristou commented 2 years ago

Actually this would be interesting if we could dispatch on scatter and instead of circles, draw general objects.