해결된 질문
작성
·
237
0
lgb를 썼을 때 f1_score가 1.0이 나오는데 뭐가 문제일까요?
from sklearn.model_selection import train_test_split
X_tr, X_val, y_tr, y_val = train_test_split(train.drop('target', axis=1), train['target'], test_size=0.15, random_state=2023)
X_tr.shape, X_val.shape, y_tr.shape, y_val.shape
from sklearn.ensemble import RandomForestClassifier
import lightgbm as lgb
from sklearn.metrics import f1_score
model = lgb.LGBMClassifier(random_state=2023, max_depth=11)
model.fit(X_tr, y_tr)
pred = model.predict(X_val)
print(f1_score(y_val, pred))
다시 해봐도 똑같네요. 랜덤포레스트로는 f1스코어가 잘 나오는 것 같은데, lgb로 해보면 f1스코어가 1.0으로 나와요 ㅠㅠ