# For example, to train a decision tree with a minimum leaf size of 20 on the
# dataset contained in "data" with labels "labels", saving the output model
# to "tree" and printing the training error, one could call
if (FALSE) {
output <- decision_tree(training=data, labels=labels, minimum_leaf_size=20,
minimum_gain_split=0.001, print_training_accuracy=TRUE)
tree <- output$output_model
}
# Then, to use that model to classify points in "test_set" and print the test
# error given the labels "test_labels" using that model, while saving the
# predictions for each point to "predictions", one could call
if (FALSE) {
output <- decision_tree(input_model=tree, test=test_set,
test_labels=test_labels)
predictions <- output$predictions
}
Run the code above in your browser using DataLab