def xgbtest(model, x_test, y_test): # xgtest=xgb.DMatrix(x_test) #ntreelimits : 如果提前结束了训练,那么在预测时就使用最佳迭代次数 #If early stopping is enabled during training, you can predict with the best iteration. #y_pre=model.predict(x_test,ntree_limit=model.best_iteration) y_pre = model.predict(x_test) score = plot_confuseMatrix(y_test, y_pre) return y_pre, score
def rfautotest(model, x_test, y_test): y_pre = model.predict(x_test) score = plot_confuseMatrix(y_test, y_pre) return y_pre, score
def lrtest(lrmodel, x_test, y_test): y_pre = lrmodel.predict(x_test) score = plot_confuseMatrix(y_test, y_pre) return y_pre, score