TPOT의 안정성 분석하기
이제 서로 다른 random state로 분류기를 구성해 보고, 알고리즘이 무엇을 최적으로 찾는지 확인하면서 TPOT의 무작위성을 살펴보겠습니다. 이는 충분한 시간 동안 실행하지 않으면 TPOT의 결과가 꽤 불안정할 수 있음을 보여 줍니다.
이 연습은 강의의 일부입니다
Python에서의 하이퍼파라미터 튜닝
실습형 인터랙티브 연습
이 예제를 이 샘플 코드를 완성하여 풀어보세요.
# Create the tpot classifier
tpot_clf = TPOTClassifier(generations=2, population_size=4, offspring_size=3, scoring='accuracy', cv=2,
verbosity=2, random_state=____)
# Fit the classifier to the training data
tpot_clf.fit(X_train, y_train)
# Score on the test set
print(tpot_clf.score(X_test, y_test))