summary_dt {lazy.tree} | R Documentation |
This function calculates various fit statistics given
the class DecTree object with or without a new regressor matrix.
Japanese help file: summary_dt_JPH
summary_dt(
obj = NULL,
y = NULL,
X = NULL,
yhat = NULL,
prob = NULL,
minp = 1e-04,
nleaf = 0,
print = 1,
outpred = 0,
title = ""
)
obj |
The output of DecTree or list of nodes. |
y |
The criterion |
X |
The NEW regressor matrix |
yhat |
predicted value |
prob |
probability of predicted value |
minp |
Minimum value of probability |
nleaf |
# of leaves when obj is not a class DecTree object |
print |
= 0 to suppress the output |
outpred |
= 1 to output the predicted values |
title |
The title string |
A set of summary statistics will be calculated using a pair of vectors
(y,yhat)
where y
or yhat
may come from obj
or given explicitly.
When y
and yhat
are present, it will be used to calculate the
summary statistics regardless of the presence of obj
.
When X
and y
are given, the predicted values will be calculated
by predict_dt
using the rules contained in obj
.
When neither X
nor yhat
are given, yhat
will be
picked up from the node information contained in obj
without using predict_dt
.
A list of the following:
When \code{y} is categorical nleaf: # of leaves Tab: cross table: (row=true, col=predicted) margin : marginal frequencies Gini: gini coefficient mllh: minus log multinomial likelihood nparam: # of parameters aic: aic bic: bic tprecision: total precision macroF1: macro F1 weightedF1: # of obs. weighted F1 SCT: a matrix of accuracy, precision, recall, specificity, and F1-score for each levels of the criterion. When \code{y} is not categorical nleaf: # of leaves corr: correlation coefficient
When outpred=1
, yhat, prob, Node
will be output.
Xc <- as.data.frame(cbind(square$c1,square$c2))
res1 <- DecTree( square$Class4, Xc, maxdepth=3, print=1 )
# temp and temp2 should be the same since Xc is not a new regressor matrix.
# No X is given.
temp <- summary_dt( res1, square$Class4, title="square" )
# The same X as contained in obj is given.
temp2 <- summary_dt( res1, square$Class4, Xc, title="square" )
# from y and yhat, no probs
temp22 <- summary_dt( yhat=res1$yhat, y=square$Class4)
# new X is given.
temp3 <- summary_dt( res1, square$Class4[1:10], Xc[1:10,], title="square" )