getCoreModel: Conversion of model to a list

View source: R/Rinterface.R

getCoreModelR Documentation

Conversion of model to a list

Description

Function converts given model from internal structures in C++ to R's data structures.

Usage

getCoreModel(model) 

Arguments

model

The model structure as returned by CoreModel.

Details

The function converts the model referenced by model from C++ internal structures to R's lists. Currently it is implemented only for random forests models.

Value

For random forest a resulting list contains first all the information on the forest level, followed by the list of trees. For each tree the nodes are recursively nested with indication of node type (leaf or internal node) and than required information for that data type.

Author(s)

Marko Robnik-Sikonja

See Also

CoreModel, CORElearn.

Examples

# uses iris data set

# build random forests model with certain parameters, 
# do not make too many and too large trees
modelRF <- CoreModel(Species ~ ., iris, model="rf", 
              selectionEstimator="MDL", minNodeWeightRF=50,
              rfNoTrees=5, maxThreads=1)
print(modelRF)

# get the structure of the forest 
forest <- getCoreModel(modelRF) 
# forest

destroyModels(modelRF) # clean up
 

CORElearn documentation built on Nov. 18, 2022, 5:08 p.m.