Learn R Programming

hhcartr (version 1.0.0)

calculate_margin_for_tree: calculate_margin_for_tree() - Calculate the margin for a tree.

Description

This internal function is called from bagging_predict to calculate the margin on the current tree using the test set.

Usage

calculate_margin_for_tree(preds, actuals, count_classified_correct, total)

Arguments

preds

Predictions on the test set.

actuals

The actuals classes ie. the target variables.

count_classified_correct

The number of correctly classified predictions.

total

The number of rows in the test set.

Value

returns the margin for the current tree.