pruning_make_predictions: pruning_make_predictions Make predictions for each test...

Description Usage Arguments Value

View source: R/hhcartr_predictors.R

Description

This internal function is a front-end to function make_predictions for making predictions on CCP generated subtrees.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
pruning_make_predictions(
  loop_count,
  j,
  alpha_df,
  current_tree,
  test,
  useIdentity,
  classify,
  colname = "collapse_this_node",
  pred_type = "fatbears"
)

Arguments

loop_count

The current fold number.

j

The current tree number.

alpha_df

A dataframe containing the CCP generated subtrees.

current_tree

The current decision tree in the hhcartr internal format.

test

The test dataset.

useIdentity

Whether the training data has been transformed with the householder transform.

classify

Default is TRUE. Set TRUE for a classification problem and FALSE for a regression problem.

colname

The column name in alpha_df that contains the list of internal node numbers that will be collapsed in the current subtree. The default value is "collapse_this_node".

pred_type

Is pruning_make_predictions being called with CCP generated subtrees or fatbears generated subtrees. Can have a value of either "ccp" or "fatbears". The default value is "fatbears".

Value

Returns a list of (new_df, subtree_accuracy_predictions_df).


hhcartr documentation built on July 2, 2021, 9:06 a.m.