我使用r中的rpart软件包从培训数据构建了一个决策树。现在我有更多的数据,并且我想根据树来检查它以检查模型。逻辑上/迭代地,我想要做到以下几点:如何根据R中的决策树模型测试数据?
for each datapoint in new data
run point thru decision tree, branching as appropriate
examine how tree classifies the data point
determine if the datapoint is a true positive or false positive
我该如何做R?
使用'预测()'函数:http://stat.ethz.ch/R-manual/R -devel/library/rpart/html/predict.rpart.html – David