Example #1
0
        private XGBooster Train(IDictionary <string, object> args, DMatrix train, int numBoostRound = 10)
        {
            var bst = new XGBooster(args, train);

            for (var i = 0; i < numBoostRound; i++)
            {
                bst.Update(train, i);
            }
            return(bst);
        }
Example #2
0
        private static XGBooster Train(IDictionary <string, object> parameters, DMatrix dTrain, int numBoostRound = 10)
        {
            XGBooster booster = new XGBooster(parameters, dTrain);

            for (int round = 0; round < numBoostRound; round++)
            {
                booster.Update(dTrain, round);
            }
            return(booster);
        }
Example #3
0
        public XGBClassifier Clone()
        {
            byte[]    modelBytes = booster.GetModelRaw();
            XGBooster newBooster = new XGBooster();

            newBooster.LoadModelFromBuffer(modelBytes);

            return(new XGBClassifier
            {
                booster = newBooster,
                parameters = new Dictionary <string, object>(parameters)
            });
        }