Description Usage Arguments Value Examples
This function trains a classification decision tree using the rpart package.
1 | train_tree(objective, data)
|
objective |
The objective function for training, of type formula. |
data |
Training dataset, a dataframe. |
tree.model A classification model.
1 2 3 4 5 6 | train.index <- split_data(iris.data, 0.7)
training.data <- iris.data[train.index, ]
test.data <- iris.data[-train.index, ]
obj.func <- formula(Species ~ Sepal.Length + Sepal.Width)
my.model <- train_tree(obj.func, training.data)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.