display.CoreModel: Displaying decision and regression trees

View source: R/Rinterface.R

display.CoreModelR Documentation

Displaying decision and regression trees

Description

The method display prints the tree models returned by CoreModel() function. Depending of parameter format the output is prepared for either screen or in dot format.

Usage

    ## S3 method for class 'CoreModel'
display(x, format=c("screen","dot"))

Arguments

x

The model structure as returned by CoreModel.

format

The type of output, i.e., prepared for screen display or in dot language

Details

The tree based models returned by function CoreModel are visualized. Only tree based models supported, including the trees which include other prediction models in their leaves. Tree based models available are decision trees (obtained by using parameter model="tree" in CoreModel), and regression trees (with model="regTree").

Models in the leaves of decision trees can be set using parameter modelType in CoreModel. At the moment naive Bayes and kNN are available, for details see helpCore.

Models in the leaves of regression trees can be set using parameter modelTypeReg in CoreModel. At the moment kNN, kernel regression, and several types of linear models are available, for details see helpCore.

The output in dot language can be used with graphViz visualization software to create model visualization in various formats.

Value

The method invisibly returns a printed character vector.

Author(s)

Marko Robnik-Sikonja

See Also

CoreModel, plot.CoreModel.

Examples

# decision tree
dataset <- CO2
md <- CoreModel(Plant ~ ., dataset, model="tree")
display(md)
destroyModels(md) #clean up

# regression tree
dataset <- CO2
mdr <- CoreModel(uptake ~ ., dataset, model="regTree")
display(mdr, format="dot")
destroyModels(mdr) # clean up


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