Answer the question
In order to leave comments, you need to log in
How to implement logistic regression in xgboost (Python)?
There is a tutorial :
import xgboost as xgb
# read in data
dtrain = xgb.DMatrix('demo/data/agaricus.txt.train')
dtest = xgb.DMatrix('demo/data/agaricus.txt.test')
# specify parameters via map
param = {'max_depth':2, 'eta':1, 'silent':1, 'objective':'binary:logistic' }
num_round = 2
bst = xgb.train(param, dtrain, num_round)
# make prediction
preds = bst.predict(dtest)
Answer the question
In order to leave comments, you need to log in
xgboost.readthedocs.io/en/latest/python/python_api.html
Create DMatrix from ndarray)
Well, xgboost is not a logistic regression)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question