Pythonで学ぶ機械学習のモニタリング
Maciej Balawejder
Data Scientist


# アルゴリズムを初期化
cbpe = nannyml.CBPE(
problem_type='classification_binary',
y_pred_proba='predicted_probability',
y_pred='prediction',
y_true='employed',
metrics=['roc_auc'],
chunk_period='m',
# chunk_size = 5000,
# chunk_number = 10
)
標準偏差しきい値
# 標準偏差しきい値
stdt = StandardDeviationThreshold(
std_lower_multiplier=3,
std_upper_multiplier=3
)
定数しきい値
# 定数しきい値
ct = ConstantThreshold(
lower=0.85,
upper=0.95
)
# しきい値メソッドをインポート(前スライド)
from nannyml.thresholds import ConstantThreshold, StandardDeviationThreshold
# CBPE にしきい値を渡す
estimator = nannyml.CBPE(...
metrics = ['roc_auc', 'accuracy'],
thresholds={'roc_auc': ct, 'accuracy' : stdt}
)

filtered_results = results.filter(period='analysis')
指標で絞り込む
filtered_results = results.filter(metrics=['mae'])
両方
filtered_results = results.filter(period='analysis', metrics=['mae'])
# 結果をDataFrame形式でエクスポート
results.filter(period='analysis').to_df()

Pythonで学ぶ機械学習のモニタリング