Reputation: 173
I have generated a libsvm model and i need to invoke them into my python codes. So that the user gives the raw input and then it converts into libsvm format and finally predicts the results stating the accuracy . Is it possible to do it.
Upvotes: 1
Views: 249
Reputation: 66835
svmutil.py
which is included in the libsvm
official release contains the method for loading the trainged libsvm model from file:
svm_load_model(model_file_name)
So you can just run (after importing it from svmutil
)
clf = svm_load_model( 'model.txt' )
Of course package includes the full python binding to the libsvm, so you can perform any kind of actions (training, testing, predicting etc.) with it.
Upvotes: 1