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))