Prediction of test data from a fitted CARTGV tree.
predict_cartgv(new, tree, carts, coups)
new | a new data frame containing the same variables that " |
---|---|
tree | the data frame " |
carts | the list " |
coups | the list " |
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.
The function called the function "pred_cart
".