本文整理匯總了Python中xgboost.sklearn.XGBClassifier.colsample_bylevel方法的典型用法代碼示例。如果您正苦於以下問題:Python XGBClassifier.colsample_bylevel方法的具體用法?Python XGBClassifier.colsample_bylevel怎麽用?Python XGBClassifier.colsample_bylevel使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類xgboost.sklearn.XGBClassifier
的用法示例。
在下文中一共展示了XGBClassifier.colsample_bylevel方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: XGBClassifier
# 需要導入模塊: from xgboost.sklearn import XGBClassifier [as 別名]
# 或者: from xgboost.sklearn.XGBClassifier import colsample_bylevel [as 別名]
y_tr = y_train[:n]
X_va = data_valid.values
y_va = y_valid
model = XGBClassifier(n_estimators=1,
learning_rate=0.1,
max_depth=1000,
min_child_weight=1000,
reg_lambda=0,
seed=12)
for cb in [0.1, 1.]:
print('\ncolsample_bytree: %.1f' % cb)
model.colsample_bylevel = cb
model.fit(X_tr, y_tr, eval_set=[(X_tr, y_tr), (X_va, y_va)],
eval_metric='auc', verbose=True)
y_train=y_train.astype(int)
n = data_train.shape[0]
n = 327690
dtrain = xgb.DMatrix(data_train.values[:n], label = y_train[:n])
param2 = {'objective':'binary:logistic','tree_method':'approx', 'sketch_eps':0.00392,
'eta':.1, 'min_child_weight':10, 'max_depth':10, 'lambda':0,
'eval_metric':['logloss','auc'],
'nthread':2, 'seed':123, 'silent':1}
param2 = {'objective':'binary:logistic',