Open Startonix opened 1 month ago
XGBoost Example xgboost_example.py
import xgboost as xgb import numpy as np
data = np.random.rand(100, 10) labels = np.random.randint(2, size=100)
dtrain = xgb.DMatrix(data, label=labels) param = {'max_depth': 2, 'eta': 1, 'objective': 'binary:logistic'} bst = xgb.train(param, dtrain, num_boost_round=10)
XGBoost Example xgboost_example.py
import xgboost as xgb import numpy as np
Example data
data = np.random.rand(100, 10) labels = np.random.randint(2, size=100)
dtrain = xgb.DMatrix(data, label=labels) param = {'max_depth': 2, 'eta': 1, 'objective': 'binary:logistic'} bst = xgb.train(param, dtrain, num_boost_round=10)