Conditional decision trees

Discuss the jamovi platform, possible improvements, etc.
Post Reply
daniloap
Posts: 2
Joined: Thu May 07, 2020 12:52 am

Conditional decision trees

Post by daniloap »

One of the coolest tools in statistics and machine learning is conditional decision trees. It would be nice to see this on jamovi, using k-fold cross validation.
User avatar
jonathon
Posts: 2625
Joined: Fri Jan 27, 2017 10:04 am

Re: Conditional decision trees

Post by jonathon »

like this?

https://forum.jamovi.org/viewtopic.php?f=2&t=1042#p4359

jonathon
sbalci
Posts: 125
Joined: Sat Jan 06, 2018 10:25 pm
Contact:

Re: Conditional decision trees

Post by sbalci »

If you like those examples or guide me with a working example I will try to add them in a module.

Best wishes.
daniloap
Posts: 2
Joined: Thu May 07, 2020 12:52 am

Re: Conditional decision trees

Post by daniloap »

Yeees... it is very beautiful... how can I install this module on jamovi?

In R you can do something like this:

library(caret)
library(partykit)
detach("package:partykit", unload=TRUE)
library(party)

# Conditional Trees

set.seed(3456)
model <- train(
yvar ~ .,
data = df,
method = 'ctree2',
trControl = trainControl("cv", number = 10, classProbs = FALSE),
tuneGrid = expand.grid(maxdepth = 3, mincriterion = 0.95)
)
plot(model$finalModel)

t(sapply(unique(where(model$finalModel)), function(x) {
n <- nodes(model$finalModel, x)[[1]]
yvar <- df[as.logical(n$weights), "yvar"]
cbind.data.frame("Node" = as.integer(x),
psych::describe(yvar, quant=c(.25,.50,.75), skew = FALSE))
}))
sbalci
Posts: 125
Joined: Sat Jan 06, 2018 10:25 pm
Contact:

Re: Conditional decision trees

Post by sbalci »

Thank you for the code. I will try to use it as well.
I am planning to add those decision trees as a function to ClinicoPath module. It is on the to do list :)
I regularly push draft codes here: https://github.com/sbalci/ClinicoPathJamoviModule
Post Reply