def __init__(self, kernel, nu=0.5, **kwargs): """ Parameters: - `nu`: XXX """ LibSvmModel.__init__(self, kernel, **kwargs) self.nu = nu self.param.svm_type = libsvm.ONE_CLASS self.param.nu = nu
def __init__(self, kernel, weights, **kwargs): LibSvmModel.__init__(self, kernel, **kwargs) if weights is not None: self.weight_labels = N.empty((len(weights),), dtype=N.intp) self.weights = N.empty((len(weights),), dtype=N.float64) weights = weights[:] weights.sort() for i, (label, weight) in enumerate(weights): self.weight_labels[i] = label self.weights[i] = weight self.param.nr_weight = len(weights) self.param.weight_label = self.weight_labels.ctypes.data_as(POINTER(c_int)) self.param.weight = self.weights.ctypes.data_as(POINTER(c_double))
def __init__(self, kernel, **kwargs): LibSvmModel.__init__(self, kernel, **kwargs)