[기업은행 혁신리그 사전강의] 영화 리뷰 감성 분석

알고리즘 | NLP | 분류 | 자연어 | Accuracy

  • moneyIcon 상금 : 총 0만원
  • 52명 마감

 

Random Forest 관련 문의 드립니다

2022.10.08 04:56 516 조회
[기업은행]_영화_리뷰_감성_분석_3회차_과제_RandomForest.ipynb.zip

안녕하세요

영화 리뷰감성 분석 2회차 프로그랭에서

모델학습 부분을  아래와 같이 바꾸고

n_estimators와 random_state 값을 바꾸어서 수행 해보니

오히려 성능이 떨어지는 검증 값이 나옵니다

혹시 성능을 향상 시킬 방법이 있으면 알려주시면 감사하겠습니다 ^^

==== 수행결과 검증 값

  1. model = RandomForestClassifier(n_estimators=10, random_state=5)   : accuracy = 0.79404

                                                                                                                         accuracy = 0.7871288888888889

3.model = RandomForestClassifier(n_estimators=10, random_state=0)     : accuracy = 0.7707022222222222

 4.model = RandomForestClassifier(n_estimators=2, random_state=2)     :accuracy = 0.7222044444444444


===========================================

from sklearn.ensemble import RandomForestClassifier

model = RandomForestClassifier(n_estimators=10, random_state=5) # 1. 모델 선언

model.fit(X_train_vec, y_train)     # 2. 모델 학습



로그인이 필요합니다
0 / 1000
affjljoo3581
2022.10.11 12:29

random_state는 난수 발생을 위한 랜덤시드로, 성능 향상을 위한 최적화 대상은 아닙니다. n_estimators는 랜덤포레스트 학습 횟수를 의미하는데, 통상적으로 100, 500, 1000 정도를 선택합니다. 정확한 하이퍼파라미터 튜닝을 위해서는 validation accuracy를 기준으로 값을 변경하면 되겠습니다.