ext/libsvm/svm.cpp in rb-libsvm-1.4.3 vs ext/libsvm/svm.cpp in rb-libsvm-1.4.4
- old
+ new
@@ -3063,13 +3063,14 @@
kernel_type != RBF &&
kernel_type != SIGMOID &&
kernel_type != PRECOMPUTED)
return "unknown kernel type";
- if(param->gamma < 0)
+ if((kernel_type == POLY || kernel_type == RBF || kernel_type == SIGMOID) &&
+ param->gamma < 0)
return "gamma < 0";
- if(param->degree < 0)
+ if(kernel_type == POLY && param->degree < 0)
return "degree of polynomial kernel < 0";
// cache_size,eps,C,nu,p,shrinking
if(param->cache_size <= 0)