无法腌制<class'sklearn.linear_model.logistic.LogisticRegression'>:它与sklearn.linear_model.logistic.LogisticRegression不同

时间:2019-07-05 06:21:10

标签: python machine-learning scikit-learn

我收到以下错误消息:

Can't pickle <class 'sklearn.linear_model.logistic.LogisticRegression'>: it's not the same object as sklearn.linear_model.logistic.LogisticRegression

代码如下:

logR_pipeline_ngram = Pipeline([('LogR_tfidf',FeatureSelection.tfidf_ngram),
    ('LogR_clf',LogisticRegression(penalty="l2",C=1))])

logR_pipeline_ngram.fit(DataPrep.train_news['Statement'],DataPrep.train_news['label'])

model_file = 'final_model.sav'
pickle.dump(logR_pipeline_ngram,open(model_file,'wb'))

是什么原因造成的?

0 个答案:

没有答案