Conditional decision trees
Conditional decision trees
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.
Re: Conditional decision trees
like this?
https://forum.jamovi.org/viewtopic.php?f=2&t=1042#p4359
jonathon
https://forum.jamovi.org/viewtopic.php?f=2&t=1042#p4359
jonathon
Re: Conditional decision trees
If you like those examples or guide me with a working example I will try to add them in a module.like this?
viewtopic.php?f=2&t=1042#p4359
Best wishes.
Re: Conditional decision trees
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))
}))
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))
}))
Re: Conditional decision trees
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
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