get_calibrated_nodes: Node-wise calibration of predictions of decision tree using...

View source: R/get_calibrated_nodes.R

get_calibrated_nodesR Documentation

Node-wise calibration of predictions of decision tree using mondrian conformal prediction

Description

get_calibrated_nodes calculates lower and upper limit for prediction interval for each observation of the test data set using mondrian conformal prediction

Usage

get_calibrated_nodes(
  y_cal_pred,
  y_cal,
  y_test_pred,
  significance_level,
  tree,
  cal_data,
  test_data,
  dependent_varname,
  calibrate_all_nodes = FALSE
)

Arguments

y_cal_pred

Predictions of decision tree for calibration set.

y_cal

True label of outcome variable for calibration set. Has to be in the same order as y_cal_pred.

y_test_pred

Predictions of test data set that should be calibrated.

significance_level

Level of uncertainty that should be reached by calibration, should be between 0 and 1.

tree

Tree whose predictions are to be calibrated, tree should be an object of class ranger.

cal_data

Data frame with calibration data (should contain same variables as train data).

test_data

Data frame with test data (should contain same variables as train data).

dependent_varname

Name of the dependent variable used to create the tree.

calibrate_all_nodes

If TRUE prediction interval is calculated for all nodes, if FALSE only for termial nodes.

Value

data frame with point prediction and lower and upper bound of prediction interval for nodes.

Author(s)

Lea Louisa Kronziel, M.Sc.


imbs-hl/timbR documentation built on April 17, 2025, 2:08 p.m.