predict_dt {lazy.tree}R Documentation

Calculate the Predicted Values from the Regressor Matrix

Description

This function classifies the observations into one of the leaf nodes.
Japanese help file: predict_dt_JPH

Usage

predict_dt(X, obj)

Arguments

X

The regressor matrix as a data frame

obj

The class DecTree object or list of nodes.

Details

The rules concerning how to classify an observation into Left and Right node recorded in each obj$node will be applied for each observations (rows) in X.

When X contains a new set of observations with categorical regressor variables, those must be converted to factors using the same levels as the training data.

Value

A list of:
yhat: vector of the predicted values
prob: matrix of the posterior probabilities
Node: vector of the leaf node numbers

Examples

Xc=data.frame(square$c1,square$c2)
res1 <- DecTree( square$Class4, Xc, maxdepth=3, print=1 )
pred <- predict_dt( Xc, res1 )
Print(pred$yhat, pred$prob)


[Package lazy.tree version 0.1.6 ]