Prediction of test data from a fitted CARTGV tree.

predict_cartgv(new, tree, carts, coups)

Arguments

new

a new data frame containing the same variables that "data".

tree

the data frame "tree" returned by the function "cartgv".

carts

the list "carts" returned by the function "cartgv".

coups

the list "table_coupures" returned by the function "cartgv".

Value

a matrix with "nrows(new)" rows (the i-th row is provided prediction information about the -ith observation in "new") and the 4 followingcolumns, - hat.Y: the predicted label ("0" or "1"), - Y: the true label ("0" or "1"), - noeuds: name of the node in the CARTGV tree, - score: conditionnal probability that the observation has "Y=1", - i_noeuds: name of the node in the splitting tree.

Details

The function called the function "pred_cart".