Giám sát Machine Learning bằng Python
Maciej Balawejder
Data Scientist


# Khởi tạo thuật toán
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
)
Ngưỡng độ lệch chuẩn
# Standard deviation thresholds
stdt = StandardDeviationThreshold(
std_lower_multiplier=3,
std_upper_multiplier=3
)
Ngưỡng cố định
# Constant thresholds
ct = ConstantThreshold(
lower=0.85,
upper=0.95
)
# Import phương pháp đặt ngưỡng (slide trước)
from nannyml.thresholds import ConstantThreshold, StandardDeviationThreshold
# Truyền ngưỡng vào thuật toán CBPE
estimator = nannyml.CBPE(...
metrics = ['roc_auc', 'accuracy'],
thresholds={'roc_auc': ct, 'accuracy' : stdt}
)

filtered_results = results.filter(period='analysis')
Theo chỉ số
filtered_results = results.filter(metrics=['mae'])
Kết hợp
filtered_results = results.filter(period='analysis', metrics=['mae'])
# Xuất kết quả sang dạng dataframe
results.filter(period='analysis').to_df()

Giám sát Machine Learning bằng Python