Error in libSVM Python interface -


i called

 model = svm_model(svm_problem(prob_y, prob_x), svm_param) 

but error:

traceback (most recent call last): file "./multiprob.py", line 267, in <module> main() file "./multiprob.py", line 226, in main train_x, train_y, test_x, test_y, param, outfile) file "./multiprob.py", line 89, in testing model[i,j]=base_train(cls_x[i], cls_x[j], param) file "/data/svm/svmprob-1.2/svmplatt.py", line 15, in svmplatttrain model = svm_model(svm_problem(prob_y, prob_x), svm_param) typeerror: __init__() takes 1 argument (3 given) 

i view code in /usr/lib64/python2.6/site-packages/libsvm/svm.py

class svm_model(structure): >---_names = ['param', 'nr_class', 'l', 'sv', 'sv_coef', 'rho', >--->--->---'proba', 'probb', 'label', 'nsv', 'free_sv'] >---_types = [svm_parameter, c_int, c_int, pointer(pointer(svm_node)), >--->--->---pointer(pointer(c_double)), pointer(c_double), >--->--->---pointer(c_double), pointer(c_double), pointer(c_int), >--->--->---pointer(c_int), c_int] >---_fields_ = genfields(_names, _types) >---def __init__(self): >--->---self.__createfrom__ = 'python' 

the init_ take 1 argument... how fix it?

it libsvm's edition error. libsvm 3.x changes model used in libsvm 2.8.9.


Comments

Popular posts from this blog

javascript - backbone.js Collection.add() doesn't `construct` (`initialize`) an object -

php - Get uncommon values from two or more arrays -

Adding duplicate array rows in Php -