728x90
반응형
원인 : 모델이 대부분 클래스에 대해 낮은 성능 보임, 데이터 불균형
해결방법 : 메타정보 추가 및 하이퍼파라미터 튜닝
param_grid = {
'max_depth': [3, 5, 7, 9],
'learning_rate': [0.01, 0.1, 0.2],
'n_estimators': [100, 200, 300],
'subsample': [0.8, 1.0],
'colsample_bytree': [0.8, 1.0]
}
grid_search = GridSearchCV(estimator=xgb_model, param_grid=param_grid,
cv=3, n_jobs=-1, verbose=2, scoring='f1_weighted')
grid_search.fit(X_train, y_train)
728x90
반응형