Beispiel #1
0
 def create_learner(self):
     kernel = ["linear", "poly", "rbf", "sigmoid"][self.kernel_type]
     common_args = {
         'kernel': kernel,
         'degree': self.degree,
         'gamma': self.gamma or self._default_gamma,
         'coef0': self.coef0,
         'tol': self.tol,
         'max_iter': self.max_iter if self.limit_iter else -1,
         'preprocessors': self.preprocessors
     }
     if self.svm_type == self.SVM:
         return SVMLearner(C=self.C, epsilon=self.epsilon, **common_args)
     else:
         return NuSVMLearner(nu=self.nu, C=self.nu_C, **common_args)
 def create_learner(self):
     kernel = ["linear", "poly", "rbf", "sigmoid"][self.kernel_type]
     common_args = {
         "kernel": kernel,
         "degree": self.degree,
         "gamma": self.gamma or self._default_gamma,
         "coef0": self.coef0,
         "probability": True,
         "tol": self.tol,
         "max_iter": self.max_iter if self.limit_iter else -1,
         "preprocessors": self.preprocessors,
     }
     if self.svm_type == self.SVM:
         return SVMLearner(C=self.C, epsilon=self.epsilon, **common_args)
     else:
         return NuSVMLearner(nu=self.nu, C=self.nu_C, **common_args)