Skip to content

Instantly share code, notes, and snippets.

@zeryx
Created February 7, 2016 03:18
Show Gist options
  • Save zeryx/cd466bc8e63ab1d85ec4 to your computer and use it in GitHub Desktop.
Save zeryx/cd466bc8e63ab1d85ec4 to your computer and use it in GitHub Desktop.
from sklearn.externals import joblib
self.svmStorage = "/tmp/svm/"
def onConnect(self, request):
print("Client connecting: {0}".format(request.peer))
self.training = True
self.svm = joblib.load(self.svmStorage + 'my_model.pkl')
def saveSVM(self):
print("+ Saving SVM to local directory " + self.svmStorage)
joblib.dump(self.svm, self.svmStorage + 'my_model.pkl', compress=9)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment