アンサンブル学習

Pythonで学ぶ不正検知

Charlotte Werger

Data Scientist

アンサンブル学習とは:バギング vs スタッキング

Pythonで学ぶ不正検知

スタッキングによるアンサンブル

Pythonで学ぶ不正検知

不正検知でアンサンブルを使う理由

アンサンブル学習の利点:

  • 頑健です
  • 過学習を避けやすい
  • 予測精度を高めやすい
  • Kaggle 上位入賞の定番手法
Pythonで学ぶ不正検知

投票分類器(VotingClassifier)

from sklearn.ensemble import VotingClassifier

clf1 = LogisticRegression(random_state=1) clf2 = RandomForestClassifier(random_state=1) clf3 = GaussianNB()
ensemble_model = VotingClassifier(estimators=[('lr', clf1), ('rf', clf2), ('gnb', clf3)], voting='hard')
ensemble_model.fit(X_train, y_train) ensemble_model.predict(X_test)
VotingClassifier(estimators=[('lr', clf1), ('rf', clf2), ('gnb', clf3)], voting='soft', weights=[2,1,1])
Pythonで学ぶ不正検知

不正検知における信頼できるラベル

Pythonで学ぶ不正検知

練習しましょう!

Pythonで学ぶ不正検知

Preparing Video For Download...