Skip to main content
100%

Tut2

✓ Published0🌍 Public
BBenHeubl
Last edited Feb 13, 2020
Created on Feb 13, 2020

This example demonstrates how to train a decision tree classification model using the R `rpart` package. The code defines a model that predicts a target `Column_of_interest` from all other variables in a user-supplied dataframe, using the `method = "class"` setting for categorical outcomes. It also incorporates a parameter for an optimal complexity parameter (`cp`) to control tree pruning, which is passed through `rpart.control`. The snippet does not include any data or visualization, serving instead as a template for building the underlying statistical model.

AI-generated description

Similar vizzes