-
[교차검증]GridSearchCVMachine Learning/알고리즘이해 2022. 3. 26. 09:24
GirdSearchCV API를 이용해 분류,회귀 알고리즘 예측
grid_parameters ={'max_depth':[1,2,3],
'min_samples_split':[2,3]}
GridSearchCV 클래스의 주요 파라미터
-estimator : classifier,regressor,pipeline
-param_grid : key + 리스트 값을 가지는 딕셔너리
-scoring : 예측성능을 평가 할 방법 지정
-cv:교차 검증을 위해 분할되는 학습/테스트 세트 개수 지정
-refit: 디폴트가 True이며 가장 최적의 하이퍼 파라미터를 찾은 뒤 입력된 estimator 객체를 해당 하이터 파라미터로 재학습
max_depth:3, min_samples_split:2 로 결과 나옴 / 최고 정확도:0.9667 반응형