저는 데이터 과학에 대한 경험이 있습니다. 필자는 9500 회의 관측치와 4500 가지 이상의 관측치를 가진 데이터 세트를 보유하고 있습니다. 필자가 간략하게 언급 한 것은 다음과 같습니다. 6000 개 이상의 비 -NAs가있는 컬럼을 삭제하고 적어도 6000 개가 아닌 NAs가있을 때 NAs를 해당 컬럼의 중간 값으로 대체했습니다. 상관 관계에 관해서, 나는 다른 사람들과의 상관 관계가 0.7 이하인 특징만을 유지했다. 그렇게함으로써 필자는 기능의 수를 약 750 개로 줄였습니다. 그런 다음 임의의 포리스트에서 이진 분류 작업에 이러한 기능을 사용했습니다.매우 성공적인 교차 유효성 검사 결과가 있지만 무작위 포리스트가 적합합니다.
(0 : 1)의 비율이 (10 : 1) 인 경우 내 데이터 세트가 매우 불균형합니다. 그래서 10 배 CV로 RF를 적용 할 때 각 Cv (AUC는 99 %)에서 너무 좋은 결과를 보았습니다. 실제로 좋은 결과를 얻었고 테스트 세트에서 0.7과 같은 결과가 나 빠졌습니다. 여기 내 코드는 다음과 같습니다.
import h2o
from h2o.estimators import H2ORandomForestEstimator
h2o.init(port=23, nthreads=4)
train = fs_rf[fs_rf['Year'] <= '201705']
test = fs_rf[fs_rf['Year'] > '201705']
train = train.drop('Year',axis=1)
test = test.drop('Year',axis=1)
test.head()
train = h2o.H2OFrame(train)
train['BestWorst2'] = train['BestWorst2'].asfactor()
test = h2o.H2OFrame(test)
test['BestWorst2'] = test['BestWorst2'].asfactor()
training_columns = train.drop('BestWorst2',axis=1).col_names
response_column = 'BestWorst2'
model = H2ORandomForestEstimator(ntrees=100, max_depth=20, nfolds=10, balance_classes=True)
model.train(x=training_columns, y=response_column, training_frame=train)
performance = model.model_performance(test_data=test)
print(performance)
어떻게 지나치게 피할 수 있습니까? 그리드 검색에서 많은 다른 매개 변수를 시도했지만 그 중 아무도 결과를 개선하지 못했습니다.