开始使用免费开始使用

酒店预订数据集中的漂移

在上一章中,您计算了用于预测预订取消的模型的业务价值和 ROC AUC 表现。您在生成的图中注意到一些警报,因此需要进一步检查分析数据中是否存在漂移。

在本练习中,您将初始化多变量漂移检测方法,并将其结果与上一章计算的性能结果进行比较。

StandardDeviationThreshold 已经导入,业务价值和 ROC AUC 的结果已存储在变量 perf_results 中,同时 feature_column_names 也已定义。

本练习是课程的一部分

Python 中的机器学习监控

查看课程

练习说明

  • 初始化 StandardDeviationThreshold 方法,并将 std_lower_multiplier 设为 2std_upper_multiplier 参数设为 1
  • 添加以下特征名称:countrylead_timeparking_spaceshotel。保持其原有顺序。
  • 将之前定义的阈值和特征名称传递给 DataReconstructionDriftCalculator
  • 显示包含多变量漂移检测结果(mv_results)和性能结果(perf_results)的对比图。

交互式实操练习

通过完成这段示例代码来试试这个练习。

# Create standard deviation thresholds
stdt = StandardDeviationThreshold(____=____, ____=____)

# Define feature columns
feature_column_names = [____, ____, ____, ____]

# Intialize, fit, and show results of multivariate drift calculator
mv_calc = nannyml.DataReconstructionDriftCalculator(
    column_names=____,
	threshold = ____,
    timestamp_column_name='timestamp',
    chunk_period='m')
mv_calc.fit(reference)
mv_results = mv_calc.calculate(analysis)
mv_results.filter(period='analysis').____(____).plot().show()
编辑并运行代码