strip: Retain only basic tree structure

View source: R/stripTree.R

stripR Documentation

Retain only basic tree structure

Description

Removes all elements of a semforest or semtree except for the tree structure and terminal node parameters. This is to reduce the heavy memory footprint of sem trees and forests.

Usage

strip(x, parameters = NULL)

Arguments

x

An object for which a method exists.

parameters

Character vector, referencing parameters in the SEM model. Defaults to NULL, in which case all free model parameters are returned.

Details

Objects of class semforest and semtree are very large, which complicates downstream operations such as making partial dependence plots, or using the model in interactive contexts (like Shiny apps). Running strip removes all elements of the model except for the tree structure and terminal node parameters. Note that some methods are no longer available for the resulting object - e.g., varimp requires the terminal node SEM models to compute the likelihood ratio.

Value

List

Examples

## Not run: 
if(interactive()){
 #EXAMPLE1
 }

## End(Not run)

semtree documentation built on Nov. 26, 2023, 5:07 p.m.