![]() |
libsvm and Python
I am not familiar with libsvm.
I have succeeded to install the libsvm software for Python/windows. However I have not found any good documentation about the functions supported by Libsvm in Python. How to call the different functions, parameters, examples etc. Has anybody found a good tutorial that provides information about libsvm/Python?? I would like to check some very basic question to see if i getting it right. It seems that there are changes in the Python interface. I have seen in the Web some old examples using the following import statement in Python. But I cannot use this import statement (Python 2.73, libsvm 3.12). PHP Code:
PHP Code:
Any help about finding more info is really appreciated |
Re: libsvm and Python
Quote:
|
Re: libsvm and Python
Hi !
All you need for this HW is svm_train and a bit svm_predict. So how to use them ? I found that svm_train cant take data from numpy.array, so this is what I do: Code:
with open('features.train') as f: Code:
import svmutil as svm Code:
p_label, p_acc, p_val = svm.svm_predict(Y_train, X_train, model) Hope this helps. edit: one important note. If you train your model with '-v' parameter (for cross validation) function will not return the Model, but only a float number - 'Cross Validation Accuracy' |
Re: libsvm and Python
Quote:
Gamma is not clearly defined in our formula and it is multiplicating the inner product. Are you setting the values 1 to gamma and coeff0 ? Any other parameters that I should pay attention (other than the degree = 2)? |
Re: libsvm and Python
Quote:
|
All times are GMT -7. The time now is 07:08 AM. |
Powered by vBulletin® Version 3.8.3
Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.
The contents of this forum are to be used ONLY by readers of the Learning From Data book by Yaser S. Abu-Mostafa, Malik Magdon-Ismail, and Hsuan-Tien Lin, and participants in the Learning From Data MOOC by Yaser S. Abu-Mostafa. No part of these contents is to be communicated or made accessible to ANY other person or entity.