-1
분류를 위해 sklearn의 RF 모델을 교육하려고합니다. 테스트를 위해 얻은 정확도는 지정된 특성 벡터 세트로 상당히 낮습니다. 내가 선택한 특성 벡터가 모델을 오도하는 것으로 가정합니다. 그래서 RFE, RFECV 등을 사용하여 관련 기능 세트를 찾아 냈습니다. 정확성을 향상시키는 데 도움이되지 못했습니다. 아래에서 간단한 기능 선택 과정을 생각해 냈습니다.>임의의 숲 : 관련 기능 찾기
ml_feats = #initial set of feature vector
while True
feats_to_del=[]
prev_score=0
for feat_len in range(2,len(ml_feats)):
classifier = RandomForestClassifier(**init_params)
classifier.fit(X[ml_feats[:feat_len]],Y)
score = classifier.score(Xt[ml_feats[:feat_len]],Yt)
if score<prev_score:
#feature that caused the score to decrease
print ml_feats[feat_len]
feat_to_del.append(ml_feats[feat_len])
prev_score=score
if len(feats_to_del)==0:
break
#delete irrelevant features
ml_feats=list(set(ml_feats)-set(feats_to_del))
print ml_feats #print all relevant features
위 코드가 올바른 기능 집합을 찾는 데 도움이됩니까? 감사합니다.
관련없는 기능을 제거하는 데 도움이됩니까? –
예. 왜 그걸 시도하지 그래? –
나는 시도했다 .... 정확도에있는 뜻 깊은 향상 없음. –