library(xgboost)
library(gbm)
creditcard.boost=gbm((Class) ~ . ,data = smote_creditcard,distribution= "bernoulli",n.trees = 10000,shrinkage = .01,n.minobsinnode = 20)
class_prediction <- predict(object = creditcard.boost, newdata = creditcard_test,n.trees=10000)
library(caret)
library(e1071)
class_prediction<-as.factor(class_prediction)
confusionMatrix(data = class_prediction, reference = creditcard_test$Class)
“预测”功能的输出产生NaN,而没有预测。