@@ -175,21 +175,26 @@ def _dense_fit(self, X, y, class_weight=None, sample_weight=None):
175175 self .gamma = 1.0 / X .shape [1 ]
176176 self .shape_fit_ = X .shape
177177
178- params = self .get_params ()
179- if 'scale_C' in params :
180- if params ['scale_C' ]:
181- params ['C' ] = params ['C' ] / float (X .shape [0 ])
182- del params ['scale_C' ]
183- if 'sparse' in params :
184- del params ['sparse' ]
185-
178+ # set default parameters
179+ C = self .C
180+ if getattr (self , 'scale_C' , False ):
181+ C = self .C / float (X .shape [0 ])
182+ epsilon = self .epsilon
183+ if epsilon is None :
184+ epsilon = 0.1
185+
186+ # we don't pass **self.get_params() to allow subclasses to
187+ # add other parameters to __init__
186188 self .support_ , self .support_vectors_ , self .n_support_ , \
187189 self .dual_coef_ , self .intercept_ , self .label_ , self .probA_ , \
188190 self .probB_ = libsvm .fit (X , y ,
189191 svm_type = solver_type , sample_weight = sample_weight ,
190192 class_weight = class_weight ,
191193 class_weight_label = class_weight_label ,
192- ** params )
194+ kernel = self .kernel , C = C , nu = self .nu ,
195+ probability = self .probability , degree = self .degree ,
196+ shrinking = self .shrinking , tol = self .tol , cache_size = self .cache_size ,
197+ coef0 = self .coef0 , gamma = self .gamma , epsilon = epsilon )
193198
194199 def _sparse_fit (self , X , y , class_weight = None , sample_weight = None ):
195200 """
0 commit comments