需要注意的是,您需要将 training_set8$Employee_Turnover 转换为 0 和 1。希望你已经做到了,如果没有看到我下面的例子。
其次,你需要在做xgboost的时候指定objective = "binary:logistic",这就是分类。
所以从你所拥有的开始:
library(caTools)
library(xgboost)
library(caret)
set.seed(12345)
# reproducible results
XGBoostDataSet_Hr_Admin_8 <- read.csv("CompletedDataImputed_HR_Admin.csv")
#Use factor function to convert categorical data to numerical data
XGBoostDataSet_Hr_Admin_8$Salary = as.numeric(factor(XGBoostDataSet_Hr_Admin_8$Salary, levels =c('L','M', 'H', 'V'), labels =c(1,2,3,4)))
XGBoostDataSet_Hr_Admin_8$Rude_Behavior = as.numeric(factor(XGBoostDataSet_Hr_Admin_8$Rude_Behavior, levels=c('Y', 'M', 'N'), labels =c(1,2,3)))
XGBoostDataSet_Hr_Admin_8$Feeling_undervalued =as.numeric(factor(XGBoostDataSet_Hr_Admin_8$Feeling_undervalued, levels=c('Y', 'M', 'N'), labels =c(1,2,3)))
XGBoostDataSet_Hr_Admin_8$Overall_satisfaction = as.numeric(factor(XGBoostDataSet_Hr_Admin_8$Overall_satisfaction, levels=c('Y', 'M', 'N'), labels =c(1,2,3)))
XGBoostDataSet_Hr_Admin_8$Raises_frozen = as.numeric(factor(XGBoostDataSet_Hr_Admin_8$Raises_frozen, levels=c('Y', 'M', 'N'), labels =c(1,2,3)))
XGBoostDataSet_Hr_Admin_8$Poor_Conditions = as.numeric(factor(XGBoostDataSet_Hr_Admin_8$Poor_Conditions, levels=c('Y', 'M', 'N'), labels =c(1,2,3)))
XGBoostDataSet_Hr_Admin_8$Growth_not_available = as.numeric(factor(XGBoostDataSet_Hr_Admin_8$Growth_not_available, levels=c('Y', 'M', 'N'), labels =c(1,2,3)))
XGBoostDataSet_Hr_Admin_8$Workplace_Conflict = as.numeric(factor(XGBoostDataSet_Hr_Admin_8$Workplace_Conflict, levels=c('Y', 'M', 'N'), labels =c(1,2,3)))
对于这一部分,我们将标签正确设置为 0 和 1
#set levels
lvl = c('N', 'Y')
# sorry I have to do it like this, it's too long for me to read
lb = as.character(XGBoostDataSet_Hr_Admin_8$Employee_Turnover)
lb = as.numeric(factor(lb,levels=lvl))-1
XGBoostDataSet_Hr_Admin_8$Employee_Turnover = lb
我们按照您的方式将其拆分为训练 + 测试:
#split the data in train dataset and test dataset
split = sample.split(XGBoostDataSet_Hr_Admin_8$Employee_Turnover,SplitRatio = 0.7)
training_set8 = subset(XGBoostDataSet_Hr_Admin_8, split==TRUE)
test_set8 = subset(XGBoostDataSet_Hr_Admin_8, split==FALSE)
做适合:
#fitting XGBoost to the Training Test
classifier9 = xgboost(data = as.matrix(training_set8[-10]),
label = training_set8$Employee_Turnover, nrounds = 10)
现在我们得到概率方面的预测并转换
pred <- predict(classifier9, as.matrix(training_set8[-10]))
# we convert to predicted labels
pred_label <- lvl[as.numeric(pred>0.5)+1]
# we get the observed label, or iris$Species
actual_label <- lvl[as.numeric(training_set8$Employee_Turnover)+1]
最后的混淆矩阵:
# confusion matrix
table(pred_label,actual_label)
actual_label
pred_label N Y
N 41 0
Y 0 158
或使用插入符号:
confusionMatrix(factor(pred_label,levels=lvl),
factor(actual_label,levels=lvl))
Confusion Matrix and Statistics
Reference
Prediction N Y
N 41 0
Y 0 158
这是实际数据(由 OP 友情提供):
structure(list(Salary = structure(c(2L, 3L, 2L, 3L, 2L, 3L, 2L,
2L, 3L, 2L, 2L, 2L, 2L, 2L, 2L, 3L, 2L, 2L, 3L, 3L, 2L, 2L, 2L,
3L, 2L, 3L, 2L, 2L, 3L, 1L, 2L, 2L, 3L, 3L, 2L, 3L, 2L, 2L, 2L,
2L, 2L, 2L, 2L, 2L, 3L, 3L, 3L, 3L, 2L, 3L, 2L, 2L, 2L, 2L, 2L,
3L, 1L, 3L, 2L, 2L, 2L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 2L, 3L, 2L,
2L, 3L, 2L, 3L, 2L, 2L, 3L, 2L, 3L, 2L, 2L, 2L, 2L, 2L, 2L, 3L,
2L, 2L, 3L, 3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