我收到以下错误消息:
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'))
是什么原因造成的?