The syntax to the OneR
model should be familiar. The outcome variable frisked
is specified on the left side of the formula (~
) and the features are specified on the right side. As you will recall, the metacharacter (.
) designates that all features will be used as predictors:
model <- OneR(train_data, frisked ~ ., verbose = TRUE) summary(model)
The (partial) summary output displays the accuracy based upon selecting only one variable as a predictor along with its classification rate. The significant variables are starred.
The attribute and the accuracy metrics for the first 7 variables are shown next. Notice that once accuracy reaches 67.61% it does not decrease:
The call to the function is shown in the log, and the Decision Tree rules are displayed.