小编Khi*_* Le的帖子

在 Windows 10 上安装 Detectron2

我尝试按照此官方存储库安装 Facebook 的 Detectron2 。遵循该存储库,Detectron2 只能安装在 Linux 上。但是,我正在开发在 Windows 操作员上运行的服务器。有人知道如何在 Windows 上安装它吗?

python python-3.x deep-learning pytorch object-detection-api

10
推荐指数
3
解决办法
3万
查看次数

Plotly:如何使用热图制作带注释的混淆矩阵?

我喜欢使用 Plotly 来可视化所有内容,我试图通过 Plotly 来可视化混淆矩阵,这是我的代码:

def plot_confusion_matrix(y_true, y_pred, class_names):
    confusion_matrix = metrics.confusion_matrix(y_true, y_pred)
    confusion_matrix = confusion_matrix.astype(int)

    layout = {
        "title": "Confusion Matrix", 
        "xaxis": {"title": "Predicted value"}, 
        "yaxis": {"title": "Real value"}
    }

    fig = go.Figure(data=go.Heatmap(z=confusion_matrix,
                                    x=class_names,
                                    y=class_names,
                                    hoverongaps=False),
                    layout=layout)
    fig.show()
Run Code Online (Sandbox Code Playgroud)

结果是

在此处输入图片说明

如何在相应的单元格内显示数字而不是悬停,像这样在此处输入图片说明

python visualization machine-learning confusion-matrix plotly

4
推荐指数
3
解决办法
7388
查看次数