将 sci-kit 学习逻辑回归导入 pytorch

问题描述 投票:0回答:0

所以我有一个在 sci-kit learn 中训练过的逻辑回归模型。我想要 pytorch 中的等效模型,而无需再次训练。

我尝试在 pytorch 中初始化一个

Linear
层(后面是 sigmoid),其中
bias
作为训练过的 sklearn 模型的
intercept_
,而
coef
作为 sklearn 模型的
coef_
。但是,性能不匹配。

看来我在这个导入中遗漏了一些东西。

完成此任务的最佳方法是什么?

scikit-learn pytorch linear-regression logistic-regression
© www.soinside.com 2019 - 2024. All rights reserved.