我正在处理分类问题中高度不平衡的数据,因此我使用加权类来处理此问题, 但是当我刚运行Jupyter笔记本单元(拟合单元)时,Python停止工作。
我的代码:
xg = XGBClassifier(objective ='reg:logistic', colsample_bytree = 0.3, learning_rate = 0.01,
max_depth = 5, alpha = 10, n_estimators = 100)
class_weight = {0: 1,
1: 9}
xg.fit(X_train,y_train,sample_weight=class_weight)