How to extract the split points of mob() In rpart I can simply extract the split points of the tree using
fit <- rpart(Kyphosis ~ Age + Number + Start, data = kyphosis)
fit$splits

Is there a simple way to extract the split points of a lmtree or mob model fitted by the partykit package? 
 A: I am using an example to show how to do it. You can adapt it for your specific case. I hope this does what you are looking for. You can either extract rules from the tree or just the split points.


library("partykit")
data("BostonHousing", package = "mlbench")
BostonHousing <- transform(BostonHousing, chas = factor(chas, levels = 0:1, 
  labels = c("no", "yes")), rad = factor(rad, ordered = TRUE))

## linear model tree
bh_tree <- lmtree(medv ~ log(lstat) + I(rm^2) | zn + indus + chas + nox + age + 
  dis + rad + tax + crim + b + ptratio, data = BostonHousing, minsize = 40)

plot(bh_tree)


## rules
partykit:::.list.rules.party(bh_tree)
#>                                                            3 
#>                               "tax <= 432 & ptratio <= 15.2" 
#>                                                            6 
#> "tax <= 432 & ptratio > 15.2 & ptratio <= 19.6 & tax <= 265" 
#>                                                            7 
#>  "tax <= 432 & ptratio > 15.2 & ptratio <= 19.6 & tax > 265" 
#>                                                            8 
#>               "tax <= 432 & ptratio > 15.2 & ptratio > 19.6" 
#>                                                            9 
#>                                                  "tax > 432"

## split points
ni <- nodeids(bh_tree)
ni_terminal <- nodeids(bh_tree, terminal = TRUE)
ni_inner <- ni[!ni %in% ni_terminal]
sapply(ni_inner, function(i) split_node(node_party(bh_tree[[i]]))$breaks)
#> [1] 432.0  15.2  19.6 265.0

