PrInDTAll {PrInDT}R Documentation

Conditional inference tree (ctree) based on all observations

Description

ctree based on all observations. Interpretability is checked (see 'ctestv'); probability threshold can be specified.

Reference: Weihs, C., Buschfeld, S. 2021a. Combining Prediction and Interpretation in Decision Trees (PrInDT) - a Linguistic Example. arXiv:2103.02336

Usage

PrInDTAll(datain, classname, ctestv=NA, conf.level=0.95, thres=0.5)

Arguments

datain

Input data frame with class factor variable 'classname' and the
influential variables, which need to be factors or numericals (transform logicals and character variables to factors)

classname

Name of class variable (character)

ctestv

Vector of character strings of forbidden split results;
see function PrInDT for details.
If no restrictions exist, the default = NA is used.

conf.level

(1 - significance level) in function ctree (numerical, > 0 and <= 1); default = 0.95

thres

Probability threshold for prediction of smaller class (numerical, >= 0 and < 1); default = 0.5

Details

Standard output can be produced by means of print(name) or just name as well as plot(name) where 'name' is the output data frame of the function.

Value

treeall

ctree based on all observations

baAll

balanced accuracy of 'treeall'

interpAll

criterion of interpretability of 'treeall' (TRUE / FALSE)

confAll

confusion matrix of 'treeall'

Examples

datastrat <- PrInDT::data_zero
data <- na.omit(datastrat)
ctestv <- rbind('ETH == {C2a,C1a}','MLU == {1, 3}')
conf.level <- 0.99 # 1 - significance level (mincriterion) in ctree
outAll <- PrInDTAll(data,"real",ctestv,conf.level) 
print(outAll) # print model based on all observations
plot(outAll) # plot model based on all observations


[Package PrInDT version 1.0.1 Index]