3

I am getting the following error message:

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

Here is the code:

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'))

What is causing this?

Martin Evans
  • 45,791
  • 17
  • 81
  • 97

0 Answers0