oneClass
oneClass copied to clipboard
Qustions about the parameters of C+ and C-
Hi, I have one question about the paremeters you set in your code.
In the function of bsvm, there are three parameters "sigma", "cNeg", and "cMultiplier", and these parameters were set by using ksvm function. see below
fit = function(x, y, wts, param, lev, last, weights,
classProbs, ...) {
cPos <- param$cNeg*param$cMultiplier
ksvm(x = as.matrix(x), y = y,
kernel = rbfdot,
kpar = list(sigma = param$sigma),
C = 1,
class.weights=c("un" = param$cNeg, "pos" = cPos),
prob.model = FALSE, #=class.probs
...)
However, I saw you set the cost C as the default value 1. C+ and C_ seem come from "class.weights". C+ = C_*cMultiplier. To my understanding, the class.weight is equal to "un"/"pos". From your code the class.weight can be finally transfer to 1/cMultiplier, so maybe the the C+ and C_ you set only can extend the range of the class.weight value. I mean if it is possible to use one parameter to define more values of class.weight when using grid search, rather than used two parameter to define the class.weight. Moreover, I was wondering if we also need to consider the COST, instead just set as default 1.
In the paper"uilding text classifiers using positive and unlabeled examples", they used SVMlight package. They controlled the C+ and C_ through the parameters c (Cost)and j (I guess it is the class.weights ), where c is C- and j =C+/C-. There were also few papers implemented BSVM by using e1071 package, and they also tuned the "Cost" and "weight.class". For example"Single-Species Detection With Airborne Imaging Spectroscopy Data: A Comparison of Support Vector Techniques"
Looking forward to your reply!
Thanks in advance and best wishes Pulni
Hi Pulni, thanks for your comment. This is in fact interesting what you raise here. I implemented this long ago and to be honest I do not exactly remember why i made the decision to do it like this. I would need to think quite a bit about it to be able to give you a proper answer but I am not sure when I could dig into it. How would you implement it? Would you feel confident to contribute a suggestion in terms of code? Best regards Ben