| reg_dtree | R Documentation |
Regression tree using recursive partitioning via the tree package.
reg_dtree(attribute)
attribute |
attribute target to model building. |
Splits are chosen to reduce squared error within nodes; result is an interpretable set of piecewise constants.
returns a decision tree regression object
Breiman, L., Friedman, J., Olshen, R., and Stone, C. (1984). Classification and Regression Trees. Wadsworth.
data(Boston)
model <- reg_dtree("medv")
# preparing dataset for random sampling
sr <- sample_random()
sr <- train_test(sr, Boston)
train <- sr$train
test <- sr$test
model <- fit(model, train)
test_prediction <- predict(model, test)
test_predictand <- test[,"medv"]
test_eval <- evaluate(model, test_predictand, test_prediction)
test_eval$metrics
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.