0 points

python - How to save scikit-learn classifiert objects? - Stack Overflow


dashboard

Wed Sep 23 2020 16:08:28 GMT+0000 (UTC)

Posted by @david.starobinski #python

my_classifiers = {'logit': '<trained_logit_here>',
                  'KNN' : '<trained_KNN_here>'
                  }
pickle._dump(my_classifiers, open(filename, 'wb'))

loaded_classifiers = pickle.load(open(filename, 'rb'))
logit_model = loaded_classifiers['logit']
knn_model = loaded_classifiers['KNN']

results = logit_model.predict(X)
content_copy Copy

https://stackoverflow.com/questions/48382289/how-to-save-scikit-learn-classifiert-objects