使用另一个数据集重新估算C5.0规则的置信度

时间:2017-03-07 06:03:30

标签: r machine-learning prediction r-caret

背景信息:我已为我的数据添加了glmnet。但出于运营原因,我们实际上希望有规则制定。然后,我将C5.0Rules模型与glmnet中的预测类相匹配。即C5.0Rules基本上接近我的glmnet。但是,因此,C5.0Rules将报告非常高的置信度(以及其他效果指标),因为其目标很简单。纠正这种情况的一种自然方法是使用真实响应或其他数据集重新估计置信度(和其他性能指标)。但我需要做到这一点,以便模型记住这种新的信心,因此在将来,它将报告校正的置信水平以及预测。我该怎么做?

可重复的例子:

library(glmnet)
library(C50)
library(caret)

data(churn)

## original glmnet
glmnet=train(churn~.-state-area_code-international_plan-voice_mail_plan,data=churnTrain,method="glmnet")

## only retain useful predictors
temp=varImp(glmnet)$importance
reducedVar=rownames(temp)[temp>0]
churnTrain2=data.frame(churnTrain[,match(reducedVar,colnames(churnTrain))],
                      prediction=fitted(glmnet))

## fit my C5.0 which approximates the glmnet prediction
C5=train(prediction~.,data=churnTrain2,method="C5.0Rules")
summary(C5) ## notice the high confidence and performance measure.

(我能想到的另一种方法是让C5.0预测预测的概率而不是类,但这会把它变成一个回归问题,所以我无法做到使用C5.0

0 个答案:

没有答案