run_model: Run the classification tree

Description Usage Arguments Value Examples

Description

This function will execute a classification tree built with this package on new data.

Usage

1
run_model(model, new.data)

Arguments

model

A model object trained with the train_tree function of this package.

new.data

Dataset to be classified using the defined model.

Value

predict Returns new.data dataset with classes appended as column "predict"

Examples

1
2
3
4
5
6
7
8
 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)

 predictions <- run_model(my.model, test.data)

PACCAR/DataScience_PkgPattern documentation built on May 7, 2019, 11:48 p.m.