Machine learning----Xgboost Learning Notes

Source: Internet
Author: User
Tags xgboost

1, using Xgboost for feature set
1) xgbmodel.apply (self, X, ntree_limit=0)
Return the predicted leaf every tree for each Sampl E
X: Training set features, features matrix
Ntree_limit: The number of predicted hours, limit numbers of trees in the prediction; defaults to 0 Trees).

    def apply (self, X, ntree_limit=0): "" "Return to 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 (with all trees).

        Returns
        -------
        x_leaves:array_like, Shape=[n_samples, n_trees] for each datapoint x in X and for each
            tre E, return the index of the
            leaf x ends up in. Leaves is 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)
The difference between GBDT and GBDT+LR
I understand the following:
GBDT: Fits the residuals of the actual result after the last prediction (i.e. fitting [(y-y1^)-y^2]).
GBDT+LR: The results of each lesson tree prediction will be GBDT, and the weights are automatically learned by combining the linear again.

Novice learning, notes to facilitate their own later learning to understand, while learning to modify, if there is an incorrect place, please correct me.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.