【问题标题】:Mlflow it is possible to log confusion matrix every step?Mlflow 可以在每一步都记录混淆矩阵吗?
【发布时间】:2020-06-23 06:39:41
【问题描述】:

是否可以像简单的指标一样使用 mlflow 记录每一步的混淆矩阵? 如果有可能它有这样的可视化?

【问题讨论】:

  • 您没有添加太多关于您正在使用的库和函数的信息。无论如何,这是一个使用 scikit-learn 的worked out example
  • This answer 可能会有所帮助。
  • 我的问题是是否可以在 mlflow 中将其记录为指标或其他内容,或者我粗暴地创建文件并将其记录为工件...

标签: data-visualization confusion-matrix mlflow


【解决方案1】:

对于每个可能的运行,您可以获得单独的混淆矩阵值

# get confusion matrix values
conf_matrix = confusion_matrix(y_test,y_pred)
true_positive = conf_matrix[0][0]
true_negative = conf_matrix[1][1]
false_positive = conf_matrix[0][1]
false_negative = conf_matrix[1][0]

mlflow.log_metric("true_positive", true_positive)
mlflow.log_metric("true_negative", true_negative)
mlflow.log_metric("false_positive", false_positive)
mlflow.log_metric("false_negative", false_negative)

And then log_artifact(<your_plot>, "confusion_matrix")


【讨论】:

    猜你喜欢
    • 2016-09-19
    • 2022-08-05
    • 2017-10-17
    • 1970-01-01
    • 2015-12-17
    • 2020-10-01
    • 2012-01-20
    • 2019-11-23
    • 1970-01-01
    相关资源
    最近更新 更多