There is an M5P method in the RWeka package. This is a regression tree with linear equations in the leaves. Code example
library("RWeka") MT_model <- M5P(DEP ~ ., data = my_data)
There are some parameters that need to be configured ...
MT_model <- M5P(DEP ~ ., data = my_data, control = Weka_control(M = 4, N = FALSE, U = TRUE, R = FALSE))
To view a description of the settings:
WOW('M5P')
But there is also a carriage package that can adjust your settings automatically.
library(caret) train(DEP ~ ., data = my_data, method = 'M5')
source share