Function used to predict the label ("0" or "1") of a new observation from a fitted CARTGV object.
pred_cart(new_obs, tableau)
new_obs | a new observation. It must be a vector containing the values of the variables of the learning data set used to built the rpart object |
---|---|
tableau | object returns by the function 'calcul_cart' |
a vector with elements (in this order): number of the predicted node in the splitting tree, index of the predicted node in the object returned
by the function 'pred_cart', the label of the predicted node, the number of observations with "Y=1
"
in the predicted node, the number of observations with "Y=0
" in the predicted node and the empirical
probability that in the predicted node an observation belongs to the label "Y=1
"