如何正确地将自制模型应用于Jupiter笔记本程序

2024-06-16 12:01:37 发布

您现在位置:Python中文网/ 问答频道 /正文

首先,我将Orange3中的模型保存为temp.pkcls enter image description here

我已将模型加载为此代码

with open("temp.pkcls", "rb") as f:
    model = pickle.load(f)

那我已经试过了

predicts = model.predict(X_test)

预测结果如下

(array([0., 0., 0., 0.]), array([[0.43952093, 0.33988087, 0.2205982 ], [0.43989096, 0.33966234, 0.22044671]],[0.43952093, 0.33988087, 0.2205982 ],[0.43952093, 0.33988087, 0.2205982 ]))

我不知道orange3制作的模型的结果,但是笔记本制作的模型的正确结果应该是这样的(分类问题)

array(['Logician', 'Supporter', 'Adapter', 'Supporter'], dtype='

问题是我如何正确保存orange3中的模型并应用于我的Jupyter笔记本程序


Tags: 代码模型imagemodelherewith笔记本description