library("stablelearner")
library("partykit")
m <- ctree(Species ~ ., data = iris)
getLearner(m)$class
[1] "constparty"
$package
[1] "partykit"
$predict
function(x, newdata, yclass = NULL) {
type <- ifelse(match(yclass, c("ordered", "factor"), nomatch = FALSE), "prob", "response")
predict(x, newdata = newdata, type = type)
}