机器学习----xgboost学习笔记
2017-07-13 19:56
483 查看
1、利用xgboost做特征组合
1)XGBModel.apply(self, X, ntree_limit=0)
return the predicted leaf every tree for each sample
X: 训练集特征,features matrix
ntree_limit: 预测时数的个数, Limit number of trees in the prediction; defaults to 0 (use all trees)。
GBDT与GBDT+LR区别
我理解如下:
GBDT: 拟合上次预测后与实际结果的残差(即拟合[(y-y1^)-y^2]).
GBDT+LR: 即将GBDT每课树预测的结果,通过线性再次组合,自动学习每次的权重。
菜鸟学习中,笔记方便自己后期学习理解,边学习边修改中,如有不正确的地方,烦请指正。
1)XGBModel.apply(self, X, ntree_limit=0)
return the predicted leaf every tree for each sample
X: 训练集特征,features matrix
ntree_limit: 预测时数的个数, Limit number of trees in the prediction; defaults to 0 (use all trees)。
def apply(self, X, ntree_limit=0): """Return the predicted leaf every tree for each sample. Parameters ---------- X : array_like, shape=[n_samples, n_features] Input features matrix. ntree_limit : int Limit number of trees in the prediction; defaults to 0 (use all trees). Returns ------- X_leaves : array_like, shape=[n_samples, n_trees] For each datapoint x in X and for each tree, return the index of the leaf x ends up in. Leaves are numbered within ``[0; 2**(self.max_depth+1))``, possibly with gaps in the numbering. """ test_dmatrix = DMatrix(X, missing=self.missing) return self.get_booster().predict(test_dmatrix, pred_leaf=True, ntree_limit=ntree_limit)
GBDT与GBDT+LR区别
我理解如下:
GBDT: 拟合上次预测后与实际结果的残差(即拟合[(y-y1^)-y^2]).
GBDT+LR: 即将GBDT每课树预测的结果,通过线性再次组合,自动学习每次的权重。
菜鸟学习中,笔记方便自己后期学习理解,边学习边修改中,如有不正确的地方,烦请指正。
相关文章推荐
- LR(Logistic Regression) & XGBOOST 学习笔记
- 决策树、随机森林、GBDTxgboostfastRGF 学习笔记
- 王小草【机器学习】笔记--提升之XGBoost工具的应用
- 机器学习笔记(七)Boost算法(GDBT,AdaBoost,XGBoost)原理及实践
- XGBoost学习笔记
- 【机器学习笔记】GBM以及xgboost的调参汇总
- 决策树、CART、GBDT、Xgboost学习笔记
- 学习笔记:XGBoost原理解析
- 机器学习校招笔记3:集成学习之Adaboost
- 正则表达式学习笔记 boost
- boost 学习笔记:regex语法规范(翻译)
- 经典的Boost学习笔记
- Boost python 学习笔记
- boost uuid 学习笔记
- Boost学习笔记----SmartPointer之Boost::scoped_ptr
- boost asio io_service学习笔记
- C++ 之Boost学习笔记--Linux下编程
- boost::asio学习笔记 server端
- Boost property_map 学习笔记及其与CGAL的关系
- boost 学习笔记:regex语法规范(翻译)ZT