Learn R Programming

LogicForest (version 2.1.3)

frame.logreg2: Evaluate Predicted Values for Logic Regression Trees

Description

INTERNAL FUNCTION TO EVALUATE IMPORTANCE OF PREDICTOR COMBINATIONS. Prepares a data frame with responses, weights, censoring indicators, and evaluated predicted values for each tree in a fitted logic regression model. Called by predict.logreg2, not intended to be used independently.

Usage

frame.logreg2(fit, msz, ntr, newbin, newresp, newsep, newcens, newweight)

Value

A data.frame containing the response, weights, censoring indicators (if applicable), separate predictors, and evaluated predicted values for each tree.

Arguments

fit

An object of class "logreg" fit to the training data

msz

Maximum number of leaves on a tree (optional)

ntr

Number of trees in the fit (optional)

newbin

Binary matrix of predictors for new/out-of-sample data

newresp

Vector of response values for new data

newsep

Matrix of separate predictors for new data

newcens

Vector of censoring indicators for new data (for survival models)

newweight

Optional vector of observation weights

Details

This function constructs a data frame for evaluating predicted values from logic regression trees. It supports in-bag and out-of-sample data, handles optional censoring indicators, separate predictors, and observation weights. The resulting data frame contains columns for:

  • Response variable

  • Observation weights

  • Censoring indicators (for survival models)

  • Separate predictors (if applicable)

  • Predicted values from each tree in the model