Package PyML :: Package classifiers :: Module libsvmWrap
[frames] | no frames]

Source Code for Module PyML.classifiers.libsvmWrap

 1  from ext import libsvm 
 2   
 3  from ext.libsvm import svm_problem 
 4  from ext.libsvm import svm_parameter 
 5  from ext.libsvm import C_SVC, NU_SVC, ONE_CLASS, EPSILON_SVR, NU_SVR 
 6  from ext.libsvm import LINEAR, POLY, RBF, SIGMOID, PRECOMPUTED 
 7   
 8   
9 -class svmParameter (svm_parameter) :
10
11 - def __init__(self, **kw) :
12 13 svm_parameter.__init__(self) 14 15 self.svm_type = C_SVC 16 self.kernel_type = LINEAR 17 self.degree = 2 18 self.gamma = 0 19 self.coef0 = 0 20 self.nu = 0.5 21 self.cache_size = 40 22 self.C = 10 23 self.eps = 1e-3 24 self.p = 0.1 25 self.shrinking = 1 26 self.nr_weight = 0 27 for attr,val in kw.items(): 28 setattr(self,attr,val)
29