xgboost 包使用
来源:互联网 发布:协同过滤算法 python 编辑:程序博客网 时间:2024/06/16 05:06
为了程序的通用性, 最近在使用caret 包代替xgboost包外加记忆力比较差,所以扔上来防小白:训练数据包括 训练集, eval集训练集: 训练数据中用来训练模型的数据eval集: 训练过程中看训练数据训练出的模型的误差,相当于cross_validationlibrary(xgboost)#like python 训练数据dtrain <- xgb.DMatrix(train.mx, label=train$algorithms )#eval 数据dtest <- xgb.DMatrix(test.mx, label=test$algorithms)model <- xgb.train(data = dtrain, watchlist = list(test = dtrain, train = dtest), #训练误差 和 eval集误差 params = list( objective = 'multi:softmax', #active function eta = 0.1, #学习率 一般 0.05 max_depth = 20, #树的深度 subsample = 0.6, #使用多少样本进行训练 num_class = 6 #类别 ), nrounds = 1000, #程序运行次数 print.every.n = 10, #每几次打印train 和 eval结果 maximize = FALSE)#预测xgb.pre <- predict(xgb_model, test[, -6])#计算准确率accuracy <- confusionMatrix(test$algorithms, xgb.pre)
阅读全文
0 0
- xgboost 包使用
- scala-spark版本xgboost包使用
- python包xgboost安装和简单使用
- xgboost使用
- xgboost包的安装
- XGBoost:在Python中使用XGBoost
- XGBoost:在Python中使用XGBoost
- XGBoost:在Python中使用XGBoost
- xgboost使用调参
- xgboost使用案例一
- xgboost使用案例二
- xgboost使用小结
- xgboost使用步骤
- xgboost使用案例一
- xgboost使用入门
- R --xgboost使用
- Xgboost原理及使用
- Rstudio安装使用xgboost
- [线段树] Codeforces 794F Round #414 F. Leha and security system
- 排序算法总结(10)--桶排序
- AngularJS 服务(Service)
- Javascript中Event事件的属性大全
- 批处理
- xgboost 包使用
- POJ 1318 Word Amalgamation 笔记
- 自动化功能测试实战
- 数据结构之List
- oracle 11g 修改密码
- laravel(一)-为什么要使用框架
- ui-router路由 很详细
- HDU-4463 Outlets(次小生成树)
- TCP 的拥塞控制